Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ utoc(1) — NEWS-os 4.1C

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cdff(5)

ctoif(1)

ctou(1)

typeface(7)

UTOC(1)  —  NEWS-OS Programmer’s Manual

NAME

utoc − converter to convert text files to CDFF files

SYNOPSIS

utoc [ option list ]

DESCRIPTION

The utoc command converts text files into CDFF files.  Many options are available for use with this command.  Descriptions of their functions follow. 

−i text-file
Specifies the text file name to be input. Input is from the standard input when this option is not specified.

−o cdff-file
Specifies the CDFF file name to be output. Output is on the standard output when this option is not specified.

−n docname
Specifies the document name as a string be written in the header of the CDFF file to be output. If not specified, the same string as specified with the −i will be used.  If that specification is also missing, the first 80 bytes of the text file will be used. 

−p pointsize
Specifies the character point size. Units are in points (72 points = 1 inch). One point equals 1000 in this specification. The default value is 10000 (10 points).

−F typeface2
Specifies the 2-byte code typeface (font) to be used. This typeface code specification is given in hexadecimal. The default value is 1000 (Mincho) (See typeface(7)).

−f typeface1
Specifies the 1-byte code typeface (font) to be used. This typeface code specification is given in hexadecimal. The default value is 80400 (Typewriter) (See typeface(7)).

−h character-pitch
Gives the character pitch in 1000ths of total character size. The default value is 1000.

−v line-pitch
Gives the line pitch in 1000ths of total character size. The default value is 1200.

−X page-width
Specifies the page width The unit of BMU ( 1200 BMU = 1 inch ) is used when ’b’ or no unit is specified after the number. The unit of centimeter, millimeter, or inch is used when ’c’, ’m’ or ’i’ is specified after the number, respectively. All the numbers are stored in the unit of BMU in the CDIF format file. The default value is 9921 (210 mm (width of A4 portrait)). This unit specification applys for the −Y, −x, −y, −U, −L, −W options as well. 

−Y page-height
Specifies the page height in BMUs. The default value is 14031 (297 mm (height of A4 portrait)).

−U v-offset
Specifies the top-bottom margins in BMUs. This margin is the distance between the edge of the page and the printable region (frame). The default value is 600.

−L h-offset
Specifies the left margin in BMUs. This margin is the distance between the edge of the page and the printable region. The default value is 300.

−x frame-width
Specifies the width of the printable region (frame) in BMUs. The default value is page-width − h-offset − 600.  (Here, "page-width and h-offset stand for the corresponding variable values specified separately or their defaults.) 

−y frame-height
Specifies the height of the printable region (frame) in BMUs. The default value is page-height − v-offset − 600.  (Here, "page-height and v-offset stand for the corresponding variable values specified separately or their defaults.) 

−W width
This −W option divides the frame in the page layout into two columns (left and right) when this option is specified.  If the −W option is not specified, the frame created will be divided into two frames of exactly half of the specified witdth (in BMUs), each frame of width (frame-width − mid-margin)/2.  Text will flow into the frames left frame first. 

−k [1|0]
Specifies whether to convert line element codes used on NEC PC-9801 computers to JIS line element codes (X-0208).  1 specifies conversion; 0 specifies no conversion.  The default value is 1. 

−s When this −s option is specified, tabs (0x09) are converted into the equivalent number of spaces (0x20) (also known as detabbing). 
Tab stops are assumed every 8 bytes.

−K When this −K option is specified, the line attributes corresponding to line elements (between 0x849f and 0x84be in Shift-JIS code) are added.  The use of this option ensures that lines will appear unbroken even when the line pitch is larger than the height of a single character or when character pitch is wider than a single character. 
When this option is specified, the command will execute the −s option regardless of other specifications.  The command will also execute the −k option as though 1 were specified regardless of other options. 

−T direction
When the −T option is specified, the document will be specified as tategaki (upright characters running from top to bottom, lines running from right to left).  Character which have corresponding tategaki counterparts will be converted.  Select the direction from among 0, 1, 2, and 3.  These values specify the direction in which characters should run. 

0  Characters written on their sides left to right top to bottom. 

1  Characters written in standard tategaki format.  (Writing begins from the top left of the frame.) 

2  Characters written as with 0, but with the frame rotated 180 degrees. 

3  Characters written as with 1, but with the frame rotated 180 degrees. 

−I Some Japanese symbol characters are not suitable to be placed at the top of a line. The −I option forces these characters (appearing on the top) to be added to the end of the previous line. 
The character set is fixed.

−C codeset
Specifies character codeset of input text. Codeset is "sjis" or "euc". "sjis" specifies Shift-JIS and "euc" specifies EUC. If this option is not set, character codeset is specified according to environment variable LANG.  If LANG is not specified, character codeset is specified to Shift-JIS. 

EXAMPLES

Several examples of conversion from a text file (textfile) to a CDFF file (file.cdf) can be found below. 

1) This example uses the fewest possible specifications.  By default, the 2-byte code font is Mincho, and the 1-byte code font is Typewriter. 

  % utoc −i textfile −o file.cdf

2) Set the textfile’s character size to 14 points and display the results. 

  % cat textfile | utoc -p 14000 | ctoif | xif

3) Set the 1-byte code font to Roman and the line pitch to 180% of the height of a character. 

  % utoc −i textfile −f 80100 −v 1800 −o file.cdf

4) Set the line pitch and the character pitch to 150% of the size of a character while also specifying that any lines not be broken. 

  % utoc −i textfile −h 1500 −v 1500 −K −o file.cdf

5) Print characters in the top middle of the page in an area about the size of a postcard. 

  % utoc −i textfile −L 2480 −U 0 −x 4660 −y 6850 | ctoif | lpr −Pprinter −c

6) Print A4 pages on their side facing each other with a frame spacing of one half inch and a character size of 8 points. 

  % utoc −i textfile −L 600 −X 14031 −Y 9921 −W 600 −p 8000 −o file.cdf

7) Print in tategaki with a line pitch of 180% of character size. 

  % utoc −i textfile −T 0 −L 600 −K −v 1800 −o file.cdf

SEE ALSO

cdff(5), ctoif(1), ctou(1), typeface(7)

BUGS

Character pitch is based on Japanese zenkaku ("full space" as seen from the Japanese standpoint. e.i. 2-byte) characters and  1-byte code is assumed to be fixed at one half of that width.  Accordingly, there are cases in which the proportional pitch specified using typeface1 is not displayed properly. 
Characters not part of the JIS code set (X-0208) are not converted to the CDFF extended character set. 
Special processing such as where to break words, etc. is not conducted. For example, a word may be broken anywhere at the end of a line.

NEWS-OSRelease 4.1C

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026