302  INTRODUCTION  GFtoDVI changes for Berkeley UNIX §1

1* . Introduction. The utility program reads binary generic font (“ ”) files that are produced by font compilers such as , and converts them into device-independent (“ ”) files that can be printed to give annotated hardcopy proofs of the character shapes. The annotations are specified by the comparatively simple conventions of plain ; i.e., there are mechanisms for labeling chosen points and for superimposing horizontal or vertical rules on the enlarged character shapes.

The purpose of is simply to make proof copies; it does not exhaustively test the validity of a file, nor do its algorithms much resemble the algorithms that are typically used to prepare font descriptions for commercial typesetting equipment. Another program, , is available for validity checking; also serves as a model of programs that convert fonts from format to some other coding scheme.

The banner string defined here should be changed whenever gets modified. define banner ≡ ´ ␣ ␣ ␣ ␣ ␣ ´ { printed when the program starts }

3* . The main input and output files are not mentioned in the program header, because their external names will be determined at run time (e.g., by interpreting the command line that invokes this program). Error messages and other remarks are written on the output file, which the user may choose to assign to the terminal if the system permits it.

The term print is used instead of write when this program writes on the output file, so that all such output can be easily deflected.

define term out ≡ stdout define print (#) ≡ write(term out , #) define print ln(#) ≡ write ln(term out , #) define print nl (#) ≡ begin write ln(term out ); write(term out , #); end

program GF to DVI ; const ⟨ Constants in the outer block 5* ⟩ type ⟨ Types in the outer block 9 ⟩ var ⟨ Globals in the outer block 12 ⟩ procedure initialize; { this procedure gets things started properly }

var i, j, m, n: integer ; { loop indices for initializations } begin print ln(banner ); ⟨ Set initial values 13 ⟩ end;

4* . This module deleted, since it only defined the label final end .

5* . The following parameters can be changed at compile time to extend or reduce ’s capacity.

define file name size ≡ FILENAMESIZE { a file name shouldn’t be longer than this } ⟨ Constants in the outer block 5* ⟩ ≡

max labels = 2000; { maximum number of labels and dots and rules per character } pool size = 10000; { maximum total length of labels and other strings } max strings = 1100; { maximum number of labels and other strings } terminal line length = 150;

{ maximum number of characters input in a single line of input from the terminal } font mem size = 2000; { space for font metric data } dvi buf size = 800; { size of the output buffer; must be a multiple of 8 } widest row = 8192; { maximum number of pixels per row } lig lookahead = 20; { size of stack used when inserting ligature characters }

This code is used in section 3*.

§8  GFtoDVI changes for Berkeley UNIX  INTRODUCTION 303

8* . If the file is badly malformed, the whole process must be aborted; will give up, after issuing an error message about the symptoms that were noticed.

Such errors might be discovered inside of subroutines inside of subroutines, so a procedure called jump out has been introduced. This procedure, which simply transfers control to the label final end at the end of the program, contains the only non-local goto statement in .

define abort (#) ≡ begin print ln(#); uexit (1); end

define bad gf (#) ≡ abort (´ ␣ ␣ ␣´ , #, ´ ␣ ␣ ␣´ , cur loc − 1 : 1, ´ ´ ) procedure jump out ;

begin uexit (0);

end;

304  THE CHARACTER SET  GFtoDVI changes for Berkeley UNIX §10

11* . The original Pascal compiler was designed in the late 60s, when six-bit character sets were common, so it did not make provision for lowercase letters. Nowadays, of course, we need to deal with both capital and small letters in a convenient way. So we shall assume that the Pascal system being used for has a character set containing at least the standard visible ASCII characters ( through ). If additional characters are present, can be configured to work with them too.

Some Pascal compilers use the original name char for the data type associated with the characters in text files, while other Pascals consider char to be a 64-element subrange of a larger data type that has some other name. In order to accommodate this difference, we shall use the name text char to stand for the data type of the characters in the output file. We shall also assume that text char consists of the elements chr (first text char ) through chr (last text char ), inclusive. The following definitions should be adjusted if necessary.

define text char ≡ ASCII code { the data type of characters in text files }

define first text char = 0 { ordinal number of the smallest element of text char }

define last text char = 255 { ordinal number of the largest element of text char } ⟨ Types in the outer block 9 ⟩ +≡

text file = packed file of text char ;

14* . Here now is the system-dependent part of the character set. If is being implemented on a garden-variety Pascal for which only standard ASCII codes will appear in the input and output files, you don’t need to make any changes here. But if you have, for example, an extended character set like the one in Appendix C of The TEXbook, the first line of code in this module should be changed to

for i ← 0 to ´ 37 do xchr [i] ← chr (i);

’s character set is essentially identical to TEX’s. ⟨ Set initial values 13 ⟩ +≡

for i ← 1 to ´ 37 do xchr [i] ← chr (i);

for i ← ´ 177 to ´ 377 do xchr [i] ← chr (i);

16* . The input ln routine waits for the user to type a line at his or her terminal; then it puts ASCII-code equivalents for the characters on that line into the buffer array. The term in file is used for terminal input.

Since the terminal is being used for both input and output, some systems need a special routine to make sure that the user can see a prompt message before waiting for input based on that message. (Otherwise the message may just be sitting in a hidden buffer somewhere, and the user will have no idea what the program is waiting for.) We shall call a system-dependent subroutine update terminal in order to avoid this problem.

define update terminal ≡ flush(stdout ) { empty the terminal output buffer }

define term in ≡ stdin { standard input } ⟨ Globals in the outer block 12 ⟩ +≡ buffer : array [0 . . terminal line length] of 0 . . 255;

17* . A global variable line length records the first buffer position after the line just read. procedure input ln; { inputs a line from the terminal }

begin update terminal ;

if eoln(term in) then read ln(term in);

line length ← 0;

while (line length < terminal line length) ∧ ¬eoln(term in) do begin buffer [line length] ← xord [getc(term in)]; incr (line length); end;

end;

§19  GFtoDVI changes for Berkeley UNIX  INPUT FROM BINARY FILES 305

47* . To prepare these files for input or output, we reset or rewrite them. An extension of Pascal is needed, since we want to associate it with external files whose names are specified dynamically (i.e., not known at compile time). The following code assumes that ‘reset (f, s)’ and ‘rewrite(f, s)’ do this, when f is a file variable and s is a string variable that specifies the file name.

In C, we use the external test read access procedure, which also does path searching based on the user’s environment or the default path. We also read the command line and print the banner here (since we don’t want to print the banner if the command line is unreasonable). procedure open gf file; { prepares to read packed bytes in gf file }

begin if test read access (name of file, GFFILEPATH ) then begin reset (gf file, name of file); end

else begin print pascal string (name of file); abort (´ ␣ ␣ ␣ ␣ ´ );

end; cur loc ← 0; end;

procedure open tfm file; { prepares to read packed bytes in tfm file }

begin if test read access (name of file, TFMFILEPATH ) then begin reset (tfm file, name of file); end

else begin print pascal string (name of file); abort (´ ␣ ␣ ␣ ␣ ´ );

end; end;

procedure open dvi file; { prepares to write packed bytes in dvi file } begin rewrite(dvi file, name of file); end;

51* . We shall use another set of simple functions to read the next byte or bytes from gf file. There are four possibilities, each of which is treated as a separate function in order to minimize the overhead for subroutine calls. function get byte: integer ; { returns the next byte, unsigned }

var b: eight bits ; begin if eof (gf file) then get byte ← 0 else begin read (gf file, b); incr (cur loc); get byte ← b;

end; end;

function get two bytes : integer ; { returns the next two bytes, unsigned } var a, b: eight bits ; begin read (gf file, a); read (gf file, b); cur loc ← cur loc + 2; get two bytes ← a ∗ toint (256) + b; end;

function get three bytes : integer ; { returns the next three bytes, unsigned } var a, b, c: eight bits ; begin read (gf file, a); read (gf file, b); read (gf file, c); cur loc ← cur loc + 3; get three bytes ← (a ∗ toint (256) + b) ∗ 256 + c; end;

306  READING THE FONT INFORMATION  GFtoDVI changes for Berkeley UNIX §52

function signed quad : integer ; { returns the next four bytes, signed } var a, b, c, d: eight bits ; begin read (gf file, a); read (gf file, b); read (gf file, c); read (gf file, d); cur loc ← cur loc + 4; if a < 128 then signed quad ← ((a ∗ toint (256) + b) ∗ 256 + c) ∗ 256 + d else signed quad ← (((a − 256) ∗ toint (256) + b) ∗ 256 + c) ∗ 256 + d; end; 52* . Reading the font information. Now let’s get down to brass tacks and consider the more substantial routines that actually convert data into a form suitable for computation. The routines in this part of the program have been borrowed from TEX, with slight changes, since has to do some of the things that TEX does.

The data is stored in a large array called font info. Each item of font info is a memory word ; the fix word data gets converted into scaled entries, while everything else goes into words of type four quarters . (These data structures are special cases of the more general memory words of TEX. On some machines it is necessary to define min quarterword = −128 and max quarterword = 127 in order to pack four quarterwords into a single word.)

define min quarterword = 0 { change this to allow efficient packing, if necessary } define max quarterword = 255 { ditto } define qi (#) ≡ # + min quarterword { to put an eight bits item into a quarterword } define qo(#) ≡ # − min quarterword { to take an eight bits item out of a quarterword } define title font = 1 define label font = 2 define gray font = 3 define slant font = 4 define logo font = 5 define non char ≡ qi (256) define non address ≡ font mem size

⟨ Types in the outer block 9 ⟩ +≡ font index = 0 . . font mem size; quarterword = min quarterword . . max quarterword ; { 1/4 of a word } four quarters = packed record B0 : quarterword ;

B1 : quarterword ; B2 : quarterword ; B3 : quarterword ; end;

\underline{\overline{# ␣}} \{ note the ; so web2c will translate types that come after this \} internal font number = title font . . logo font ;

§55  GFtoDVI changes for Berkeley UNIX  READING THE FONT INFORMATION 307

55* . Of course we want to define macros that suppress the detail of how font information is actually packed, so that we don’t have to write things like

font info[width base[f] + font info[char base[f] + c].qqqq .b0 ].sc

too often. The definitions here make char info(f)(c) the four quarters word of font information corresponding to character c of font f. If q is such a word, char width(f)(q) will be the character’s width; hence the long formula above is at least abbreviated to

char width(f)(char info(f)(c)).

In practice we will try to fetch q first and look at several of its fields at the same time.

The italic correction of a character will be denoted by char italic(f)(q), so it is analogous to char width. But we will get at the height and depth in a slightly different way, since we usually want to compute both height and depth if we want either one. The value of height depth(q) will be the 8-bit quantity

b = height index × 16 + depth index ,

and if b is such a byte we will write char height (f)(b) and char depth(f)(b) for the height and depth of the character c for which q = char info(f)(c). Got that?

The tag field will be called char tag (q); and the remainder byte will be called rem byte(q). define char info end (#) ≡ # ] .qqqq define char info(#) ≡ font info [ char base[#] + char info end define char width end (#) ≡ #.B0 ] .sc define char width(#) ≡ font info [ width base[#] + char width end define char exists (#) ≡ (#.B0 > min quarterword ) define char italic end (#) ≡ (qo(#.B2 )) div 4 ] .sc define char italic(#) ≡ font info [ italic base[#] + char italic end define height depth(#) ≡ qo(#.B1 ) define char height end (#) ≡ (#) div 16 ] .sc define char height (#) ≡ font info [ height base[#] + char height end define char depth end (#) ≡ # mod 16 ] .sc define char depth(#) ≡ font info [ depth base[#] + char depth end define char tag (#) ≡ ((qo(#.B2 )) mod 4) define skip byte(#) ≡ qo(#.B0 ) define next char (#) ≡ #.B1 define op byte(#) ≡ qo(#.B2 ) define rem byte(#) ≡ #.B3

60* . define read two halves end (#) ≡ # ← b2 ∗ toint (256) + b3

define read two halves (#) ≡ read tfm word ; # ← b0 ∗ toint (256) + b1 ; read two halves end ⟨ Read the size fields 60* ⟩ ≡

begin read two halves (lf )(lh); read two halves (bc)(ec); if (bc > ec + 1) ∨ (ec > 255) then abend ; if bc > 255 then { bc = 256 and ec = 255 }

begin bc ← 1; ec ← 0; end;

read two halves (nw )(nh); read two halves (nd )(ni ); read two halves (nl )(nk ); read two halves (ne)(np); if lf ≠ 6 + lh + (ec − bc + 1) + nw + nh + nd + ni + nl + nk + ne + np then abend ; end

This code is used in section 59.

62* . Only the first two words of the header are needed by .

define store four quarters (#) ≡ begin read tfm word ; qw .B0 ← qi (b0 ); qw .B1 ← qi (b1 ); qw .B2 ← qi (b2 ); qw .B3 ← qi (b3 ); # ← qw ; end

⟨ Read the header 62* ⟩ ≡ begin if lh < 2 then abend ; store four quarters (font check [f]); read tfm word ; if b0 > 127 then abend ; { design size must be positive } z ← ((b0 ∗ toint (256) + b1 ) ∗ toint (256) + b2 ) ∗ 16 + (b3 div 16); if z < unity then abend ; while lh > 2 do

begin read tfm word ; decr (lh); { ignore the rest of the header } end;

font dsize[f] ← z; if s > 0 then z ← s; font size[f] ← z; end

This code is used in section 59.

66* . define check byte range(#) ≡ begin if (# < bc) ∨ (# > ec) then abend end

⟨ Read ligature/kern program 66* ⟩ ≡ begin bch label ← ´ 77777 ; bchar ← 256; if nl > 0 then

begin for k ← lig kern base[f] to kern base[f] − 1 do begin store four quarters (font info[k].qqqq ); if b0 > stop flag then

begin if 256 ∗ b2 + b3 ≥ nl then abend ;

if b0 = 255 then

if k = lig kern base[f] then bchar ← b1 ; end

else begin if b1 ≠ bchar then check byte range(b1 ); if b2 < kern flag then check byte range(b3 ) else if toint (256) ∗ (b2 − 128) + b3 ≥ nk then abend ; end; end;

if b0 = 255 then bch label ← 256 ∗ b2 + b3 ;

end; for k ← kern base[f] to exten base[f] − 1 do store scaled (font info[k].sc); end

This code is used in section 59.

§70  GFtoDVI changes for Berkeley UNIX  FILE NAMES 309

88* . Font metric files whose areas are not given explicitly are assumed to appear in a standard system area called home font area. This system area name will, of course, vary from place to place. Under the Berkeley UNIX version, we set home font area to null string because the default areas to search for files are built into the routine test read access . ⟨ Initialize the strings 77 ⟩ +≡

l ← 0; init str0 (home font area);

90* . And here’s the second. function more name(c : ASCII code): boolean;

begin if c = ␣ then more name ← false else begin if (c = ) then

begin area delimiter ← pool ptr ; ext delimiter ← 0;

end else if c = then ext delimiter ← pool ptr ; str room(1); append char (c); { contribute c to the current string } more name ← true; end;

end;

94* . The start gf procedure obtains the name of the generic font file to be input from the command line. It opens the file, making sure that some input is present; then it opens the output file. procedure start gf ;

label done; var arg buffer : packed array [1 . . FILENAMESIZE ] of char ;

arg buf ptr : 1 . . FILENAMESIZE ; begin if (argc < 1) ∨ (argc > 2) then abort (´ ␣ ␣ ␣ ´ ); if argc = 1 then

begin print nl (´ ␣ ␣ ␣´ ); input ln;

end else begin argv (1, arg buffer ); arg buffer [FILENAMESIZE ] ← ´ ␣´ ; arg buf ptr ← 1; line length ← 0;

while (arg buf ptr < FILENAMESIZE ) ∧ (arg buffer [arg buf ptr ] = ´ ␣´ ) do incr (arg buf ptr ); while (arg buf ptr < FILENAMESIZE )∧(line length < terminal line length)∧(arg buffer [arg buf ptr ] ≠

´ ␣´ ) do begin buffer [line length] ← xord [arg buffer [arg buf ptr ]]; incr (line length); incr (arg buf ptr ); end;

end; buf ptr ← 0; buffer [line length] ← ; while buffer [buf ptr ] = ␣ do incr (buf ptr ); if buf ptr < line length then

begin ⟨ Scan the file name in the buffer 95 ⟩;

if cur ext = null string then cur ext ← gf ext ;

pack file name(cur name, cur area, cur ext ); open gf file;

end; job name ← cur name; pack file name(job name, null string , dvi ext ); open dvi file; end;

310  SHIPPING PAGES OUT  GFtoDVI changes for Berkeley UNIX §102

107* . The actual output of dvi buf [a . . b] to dvi file is performed by calling write dvi (a, b). It is safe to assume that a and b + 1 will both be multiples of 4 when write dvi (a, b) is called; therefore it is possible on many machines to use efficient methods to pack four bytes per word and to output an array of words with one system call.

In C, we can write out the entire array with one call. procedure write dvi (a, b : dvi index );

begin write chunk (dvi file, dvi buf , a, b); end;

111* . Here’s a procedure that outputs a font definition.

define select font (#) ≡ dvi out (fnt num 0 + #) { set current font to # } procedure dvi font def (f : internal font number );

var k: integer ; { index into str pool } begin dvi out (fnt def1 ); dvi out (f); dvi out (qo(font check [f].B0 )); dvi out (qo(font check [f].B1 )); dvi out (qo(font check [f].B2 )); dvi out (qo(font check [f].B3 )); dvi four (font size[f]); dvi four (font dsize[f]); dvi out (length(font area[f])); dvi out (length(font name[f])); ⟨ Output the font name whose internal number is f 112 ⟩; end;

⟨ Declare the procedure called load fonts 98 ⟩

115* . At the end of the program, we must finish things off by writing the postamble. An integer variable k will be declared for use by this routine. ⟨ Finish the file and goto final end 115* ⟩ ≡

begin dvi out (post ); { beginning of the postamble } dvi four (last bop); last bop ← dvi offset + dvi ptr − 5; { post location } dvi four (25400000); dvi four (473628672); { conversion ratio for sp } dvi four (1000); { magnification factor } dvi four (max v ); dvi four (max h); dvi out (0); dvi out (3); { ‘max push’ is said to be 3 } dvi out (total pages div 256); dvi out (total pages mod 256); if ¬fonts not loaded then

for k ← title font to logo font do

if length(font name[k]) > 0 then dvi font def (k); dvi out (post post ); dvi four (last bop); dvi out (dvi id byte); k ← 4 + ((dvi buf size − dvi ptr ) mod 4); { the number of 223’s } while k > 0 do

begin dvi out (223); decr (k); end;

⟨ Empty the last bytes out of dvi buf 109 ⟩; uexit (0); end

This code is used in section 219*.

§116  GFtoDVI changes for Berkeley UNIX  RUDIMENTARY TYPESETTING 311

118* . ⟨ Set initial values 13 ⟩ +≡ dummy info.B0 ← qi (0); dummy info.B1 ← qi (0); dummy info.B2 ← qi (0); dummy info.B3 ← qi (0);

312  SLANT FONTS  GFtoDVI changes for Berkeley UNIX §124

138* . The following error message is given when an absent slant has been requested. procedure slant complaint (r : real );

begin if abs (r − slant reported ) > 0.001 then begin print nl (´ ␣ ␣ ´ ´ ␣ ␣ ␣ ␣ ␣ ␣´ ); print real (r, 10, 5); print (´ ´ ); slant reported ← r; end;

end;

§139  GFtoDVI changes for Berkeley UNIX  DOING THE LABELS 313

164* . The process of ferreting everything away comes to an abrupt halt when a boc command is sensed. The following steps are performed at such times: ⟨ Process a character 164* ⟩ ≡

begin check fonts ; ⟨ Finish reading the parameters of the boc 165 ⟩; ⟨ Get ready to convert coordinates to coordinates 170 ⟩; ⟨ Output the bop and the title line 172 ⟩; ⟨ Output all rules for the current character 173 ⟩; ⟨ Output all labels for the current character 181 ⟩; do pixels ; dvi out (eop); { finish the page } ⟨ Adjust the maximum page width 203 ⟩; end

This code is used in section 219*.

314  DOING THE PIXELS  GFtoDVI changes for Berkeley UNIX §204

215* . define do skip ≡ z ← 0; paint black ← false

define end with(#) ≡

begin #; cur gf ← get byte; goto done1 ; end

define five cases (#) ≡ #, # + 1, # + 2, # + 3, # + 4 define eight cases (#) ≡ #, # + 1, # + 2, # + 3, # + 4, # + 5, # + 6, # + 7 define thirty two cases (#) ≡ eight cases (#), eight cases (# + 8), eight cases (# + 16), eight cases (# + 24) define sixty four cases (#) ≡ thirty two cases (#), thirty two cases (# + 32)

⟨ Read and process commands until coming to the end of this row 215* ⟩ ≡

loop begin continue: if (cur gf ≥ new row 0 ) ∧ (cur gf ≤ new row 0 + 164) then

end with(z ← cur gf − new row 0 ; paint black ← true)

else case cur gf of

sixty four cases (0): k ← cur gf ; paint1 : k ← get byte; paint2 : k ← get two bytes ; paint3 : k ← get three bytes ; eoc: goto done1 ; skip0 : end with(blank rows ← 0; do skip); skip1 : end with(blank rows ← get byte; do skip); skip2 : end with(blank rows ← get two bytes ; do skip); skip3 : end with(blank rows ← get three bytes ; do skip); xxx1 , xxx2 , xxx3 , xxx4 , yyy , no op: begin skip nop; goto continue;

end; othercases bad gf (´ ␣ ´ ) endcases;

⟨ Paint k bits and read another command 216 ⟩; end;

done1 :

This code is used in section 214.

§219  GFtoDVI changes for Berkeley UNIX  THE MAIN PROGRAM 315

219* . The main program. Now we are ready to put it all together. This is where starts, and where it ends.

begin initialize; { get all variables initialized } ⟨ Initialize the strings 77 ⟩; { initialize paths from environment variables } set paths (GF FILE PATH BIT + TFM FILE PATH BIT ); start gf ; { open the input and output files } ⟨ Process the preamble 221 ⟩; cur gf ← get byte; init str ptr ← str ptr ; loop begin ⟨ Initialize variables for the next character 144 ⟩;

while (cur gf ≥ xxx1 ) ∧ (cur gf ≤ no op) do ⟨ Process a no-op command 154 ⟩; if cur gf = post then ⟨ Finish the file and goto final end 115* ⟩; if cur gf ≠ boc then

if cur gf ≠ boc1 then abort (´ ␣ ´ ); ⟨ Process a character 164* ⟩; cur gf ← get byte; str ptr ← init str ptr ; pool ptr ← str start [str ptr ]; end;

print ln(´ ␣´ ); end.

316  INDEX  GFtoDVI changes for Berkeley UNIX §223

223* . Index. Here is a list of the section numbers where each identifier is used. Cross references to error messages and a few other tidbits of information also appear.

The following sections were changed by the change file: 1, 3, 4, 5, 8, 11, 14, 16, 17, 47, 51, 52, 55, 60, 62, 66, 88, 90, 94, 107, 111, 115, 118, 138, 164, 215, 219, 223.

a: \underline{51*} , \underline{92}, \underline{107*} , \underline{211}. abend : \underline{58}, 60* , 62* , 63, 64, 66* . abort : \underline{8*} , 47* , 58, 61, 73, 74, 75, 91, 94* , 141,

165, 169, 184, 219* . abs : 138* , 151, 152, 173, 178. adjust : \underline{69}. alpha: \underline{58}, 64, 65. append char : \underline{73}, 75, 83, 90* , 101, 221. append to name: \underline{92}. area code: \underline{77}, 98, 100, 101, 154. area delimiter : \underline{87}, 89, 90* , 91. arg buf ptr : 94* . arg buffer : \underline{94*} . argc: 94* . argv : 94* . ASCII code: \underline{10}, 11* , 12, 71, 73, 90* , 92, 116. at size: 39. at code: \underline{77}, 154. b: \underline{51*} , \underline{107*} , \underline{207}. backpointers: 32. : 8* . : 163. : 58. bad gf : \underline{8*} , 215* , 221. bad tfm: \underline{58}. banner : \underline{1*} , 3* . bc: \underline{37}, 38, 40, 42, \underline{58}, 60* , 61, 66* , 69. bch label : \underline{58}, 66* , 69. bchar : \underline{58}, 66* , 69, \underline{116}, 122. bchar label : \underline{53}, 69, 120. begin name: 86, \underline{89}, 95. best q : \underline{150}, 151, 152. beta: \underline{58}, 64, 65. BigEndian order: 19, 37. black : 28, 29. blank rows : \underline{212}, 214, 215* , 217, 218. boc: 27, 29, \underline{30}, 31, 32, 35, 85, 96, 153, 154,

164* , 165, 219* . boc1 : 29, \underline{30}, 165, 219* . boolean: 90* , 96, 116, 117, 145, 149, 194, 218, 220. bop: 19, 21, \underline{22}, 24, 25, 102, 172. bot : \underline{43}. bot coords : \underline{186}, 190, 196, 197, 198, 199. box depth: 116, \underline{117}, 121, 185, 186. box height : 116, \underline{117}, 121, 185, 186. box width: 116, \underline{117}, 119, 121, 185, 186. buf ptr : \underline{18}, 94* , 95, 100, 101. buffer : \underline{16*} , 17* , 18, 75, 82, 83, 94* , 95, 100, 101, 114. byte file: \underline{45}, 46. b0 : \underline{49}, 50, 53, 55* , 60* , 62* , 63, 64, 66* , 67, 68. B0 : \underline{52*} , 55* , 62* , 111* , 118* . b1 : \underline{49}, 50, 60* , 62* , 63, 64, 66* , 67, 68. B1 : \underline{52*} , 55* , 62* , 111* , 118* . b2 : \underline{49}, 50, 60* , 62* , 63, 64, 66* , 67, 68. B2 : \underline{52*} , 55* , 62* , 111* , 118* . b3 : \underline{49}, 50, 60* , 62* , 63, 64, 66* , 67, 68. B3 : \underline{52*} , 55* , 62* , 111* , 118* . c: \underline{51*} , \underline{75}, \underline{81}, \underline{90*} , \underline{92}, \underline{113}, \underline{127}. char : 11* , 48, 94* . char base: \underline{53}, 55* , 61. char code: 165, \underline{166}, 172. char depth: \underline{55*} , 121. char depth end : \underline{55*} . char exists : \underline{55*} , 121, 169, 184, 205. char header : \underline{78}, 172. char height : \underline{55*} , 121, 137, 169, 184. char height end : \underline{55*} . char info: 40, 53, \underline{55*} , 117, 120, 121, 137, 169,

184, 205, 210. char info end : \underline{55*} . char info word : 38, 40, 41. char italic: \underline{55*} . char italic end : \underline{55*} . char kern: \underline{56}, 120. char kern end : \underline{56}. char loc: 29, 32. char loc0 : \underline{29}. char tag : \underline{55*} , 120, 210. char width: \underline{55*} , 121, 169, 184. char width end : \underline{55*} . : 165. check sum: 24, 31, 39. check byte range: \underline{66*} , 67. check fonts : \underline{96}, 164* . Chinese characters: 32. chr : 11* , 12, 14* , 15. coding scheme: 39. continue: \underline{6}, 98, 99, 116, 122, 123, 215* , 218. convert : \underline{167}, 168, 173, 187. cs : \underline{31}. cur area: \underline{86}, 91, 94* . cur ext : \underline{86}, 91, 94* . cur gf : 79, \underline{80}, 81, 82, 84, 85, 154, 165, 214,

215* , 216, 217, 218, 219* . cur l : \underline{116}, 120, 121, 122, 123.

cur loc: 8* , 47* , \underline{48}, 51* , 154, 163.

§223  GFtoDVI changes for Berkeley UNIX  INDEX 317

cur name: \underline{86}, 91, 94* . cur r : \underline{116}, 120, 122, 123. cur string : 79, \underline{80}, 81, 83, 154, 162, 163. d: \underline{51*} , \underline{127}, \underline{150}. d min: \underline{150}, 151, 152. decr : \underline{7}, 62* , 69, 75, 95, 114, 115* , 122, 179, 180,

210, 213, 214, 217. default fonts: 78. default gray font : \underline{78}, 97. default label font : \underline{78}, 97. default rule thickness : 44, \underline{57}, 135, 175. default title font : \underline{78}, 97. del m: \underline{29}. del n: \underline{29}. delta: \underline{183}, 184, 185, 186. delta x : 167, \underline{168}, 170, 209, 218. delta y : 167, \underline{168}, 170, 218. den: 21, \underline{23}, 25. depth base: \underline{53}, 55* , 61, 64. depth index : \underline{40}, 55* . design size: 31, 39. dfl : \underline{194}, 195, 196, 197, 198, 199. dm: \underline{29}. do nothing : \underline{7}, 63, 154. do pixels : 164* , \underline{218}. do skip: \underline{215*} . done: \underline{6}, 58, 69, 81, 83, 85, 94* , 95, 98, 99, 116,

120, 122, 208, 218. done1 : \underline{6}, 81, 82, 215* , 218. dot for label : \underline{188}, 190, 192, 193, 194, 195, 202. dot height : 148, \underline{183}, 184, 185, 186, 188. dot width: 148, \underline{183}, 184, 186, 188. down1 : 21. down2 : 21. down3 : 21. down4 : 21, \underline{22}, 171. ds : \underline{31}. dummy info: \underline{117}, 118* , 120. files : 19. dvi buf : 104, \underline{105}, 107* , 108. dvi buf size: \underline{5*} , 104, 105, 106, 108, 109, 115* . dvi ext : \underline{78}, 94* . dvi file: \underline{46}, 47* , 107* . dvi font def : 98, \underline{111*} , 115* . dvi four : \underline{110}, 111* , 115* , 119, 121, 171, 172, 176,

177, 179, 180, 209, 221. dvi goto: \underline{171}, 172, 176, 177, 178, 188, 190,

194, 202, 218. dvi id byte: \underline{23}, 115* , 221. dvi index : \underline{104}, 105, 107* . dvi limit : 104, \underline{105}, 106, 108, 109. dvi offset : 104, \underline{105}, 106, 108, 115* , 172.

dvi out : \underline{108}, 110, 111* , 112, 113, 114, 115* , 119,

121, 164* , 171, 172, 176, 177, 178, 179, 180, 188, 190, 194, 202, 208, 209, 218, 221. dvi ptr : 104, \underline{105}, 106, 108, 109, 115* , 172.

dvi scaled : \underline{114}, 172, 202.
dvi swap: \underline{108}.

dvi x : 167, \underline{168}, 173, 176, 177, 178, 185, 186,

187, 188, 190, 194, 195. dvi y : 167, \underline{168}, 173, 176, 177, 178, 185, 186,

187, 188, 190, 194, 195. dx : 29, 32, 192, \underline{220}. dy : 29, 32, 179, 180, 192, \underline{220}. d0 : 148, \underline{150}, 151, 152. e: \underline{92}. ec: \underline{37}, 38, 40, 42, \underline{58}, 60* , 61, 66* , 69. eight bits : \underline{45}, 49, 51* , 52* , 53, 80, 105, 113, 116, 218. eight cases : \underline{215*} . eighth octant : \underline{192}, 196, 197, 198, 199. else: 2. end: 2. end k : \underline{116}, 122, 123. end name: 86, \underline{91}, 95. end of list : \underline{142}, 144, 145, 160, 161, 189, 193, 201. end with: \underline{215*} . endcases: \underline{2}. eoc: 27, 29, \underline{30}, 31, 81, 85, 214, 215* , 217. eof : 51* . eoln: 17* . eop: 19, 21, \underline{22}, 24, 164* . equals sign: \underline{78}, 202. exit : \underline{6}, 7, 145, 194, 218. ext : 165, \underline{166}, 172. ext delimiter : \underline{87}, 89, 90* , 91. ext header : \underline{78}, 172. ext tag : \underline{41}, 63. exten: \underline{41}. exten base: \underline{53}, 61, 66* , 67, 69. extensible recipe: 38, \underline{43}. extra space: 44. f: \underline{58}, \underline{98}, \underline{111*} , \underline{116}. false: 90* , 97, 98, 116, 120, 145, 150, 190, 194,

195, 215* , 218, 221. fifth octant : \underline{192}, 196, 197, 198, 199. file name size: \underline{5*} , 48, 92. FILENAMESIZE : 5* , 94* . final end : 4* , 8* . finishing col : 208, 216, 217, \underline{218}. first dot : 148, \underline{149}, 161, 187, 201. first octant : \underline{192}, 196, 197, 198, 199. first string : \underline{75}, 76. first text char : \underline{11*} , 15. five cases : \underline{215*} . fix word : \underline{38}, 39, 44, 52* , 64. flush: 16* . fmem ptr : \underline{53}, 54, 61, 63, 69. fnt def1 : 21, \underline{22}, 111* . fnt def2 : 21. fnt def3 : 21. fnt def4 : 21. fnt num 0 : 21, \underline{22}, 111* . fnt num 1 : 21. fnt num 63 : 21. fnt1 : 21. fnt2 : 21. fnt3 : 21. fnt4 : 21. font area: \underline{96}, 97, 98, 101, 111* , 112, 154. font at : \underline{96}, 97, 98, 101, 154. font bc: \underline{53}, 69, 120, 205. font bchar : \underline{53}, 69, 116. font change: \underline{154}. font check : \underline{53}, 62* , 111* . font dsize: \underline{53}, 62* , 111* . font ec: \underline{53}, 69, 120, 137, 205. font index : \underline{52*} , 53, 58, 116. font info: 52* , \underline{53}, 55* , 56, 57, 58, 61, 63, 64,

66* , 67, 68, 120. font mem size: \underline{5*} , 52* , 61. font name: \underline{96}, 97, 98, 101, 111* , 112, 115* , 137, 154. font size: \underline{53}, 62* , 111* . fonts not loaded : \underline{96}, 97, 98, 115* , 154. found : \underline{6}, 98, 99, 100, 194, 196, 197, 198, 199. four quarters : \underline{52*} , 53, 55* , 58, 98, 116, 117, 218. fourth octant : \underline{192}, 196, 197, 198, 199. Fuchs, David Raymond: 19, 26, 33. fudge factor : \underline{168}, 169, 202. get avail : \underline{141}, 159, 162, 163, 188. get byte: \underline{51*} , 81, 82, 83, 84, 85, 165, 215* , 216,

218, 219* , 221. get three bytes : \underline{51*} , 81, 85, 215* . get two bytes : \underline{51*} , 81, 85, 215* . get yyy : \underline{84}, 154, 157, 159, 163. getc: 17* . : 94* . gf ext : \underline{78}, 94* . gf file: \underline{46}, 47* , 48, 51* , 80. GF FILE PATH BIT : 219* . gf id byte: \underline{29}, 221. GF to DVI : \underline{3*} . GFFILEPATH : 47* . gray fonts: 35, 39, 124. gray font : \underline{52*} , 58, 77, 78, 97, 154, 169, 175, 181,

184, 205, 210, 218. gray rule thickness : 173, \underline{174}, 175. half buf : 104, \underline{105}, 106, 108, 109. half x height : \underline{183}, 184, 186. hbox : \underline{116}, 117, 172, 183, 185, 190, 194, 202. hd : \underline{116}, 121. header : 39. height base: \underline{53}, 55* , 61, 64. height depth: \underline{55*} , 121, 137, 169, 184. height index : \underline{40}, 55* . home font area: \underline{78}, 88* , 98. hppp: \underline{31}. i: \underline{3*} , \underline{23}, \underline{98}, \underline{116}, \underline{218}. incr : \underline{7}, 17* , 51* , 73, 74, 75, 82, 83, 91, 92, 94* , 95,

100, 101, 108, 114, 116, 119, 122, 123, 128, 129, 141, 172, 180, 192, 202, 208, 217, 221. info: 139, \underline{140}, 148, 162, 163, 172, 188, 190,

194, 202. init str ptr : \underline{71}, 101, 154, 219* . init str0 : \underline{75}, 77, 88* . init str1 : \underline{75}. init str10 : \underline{75}, 77. init str11 : \underline{75}, 77. init str12 : \underline{75}, 77, 78. init str13 : \underline{75}, 77. init str2 : \underline{75}, 78. init str3 : \underline{75}, 78. init str4 : \underline{75}, 77, 78. init str5 : \underline{75}, 77, 78. init str6 : \underline{75}, 77, 78. init str7 : \underline{75}, 77, 78. init str8 : \underline{75}, 77, 78. init str9 : \underline{75}, 77. initialize: \underline{3*} , 219* . input ln: 16* , \underline{17*} , 18, 94* , 99. integer : 3* , 9, 45, 48, 51* , 53, 58, 75, 76, 81, 85, 92, 98, 102, 105, 110, 111* , 114, 134, 166, 182, 212, 218, 220. interaction: 95, \underline{96}, 97, 98. internal font number : \underline{52*} , 53, 96, 98, 111* , 116. interpret xxx : 79, \underline{81}, 154. italic base: \underline{53}, 55* , 61, 64. italic index : \underline{40}. j: \underline{3*} , \underline{81}, \underline{85}, \underline{92}, \underline{98}, \underline{116}, \underline{218}. Japanese characters: 32. job name: \underline{93}, 94* . jump out : \underline{8*} . k: \underline{23}, \underline{58}, \underline{81}, \underline{85}, \underline{92}, \underline{98}, \underline{111*} , \underline{114}, \underline{116}, \underline{220}. kern: 42. kern amount : \underline{116}, 120, 121. kern base: \underline{53}, 56, 61, 66* , 69, 120. kern flag : \underline{42}, 66* , 120. keyword code: \underline{79}, 81. l: \underline{76}, \underline{81}, \underline{116}, \underline{218}. lab typ: \underline{160}, 163, 181, 187, 189, 190, 191, 193. label font : \underline{52*} , 58, 77, 78, 97, 154, 181, 184,

190, 194, 202. label for dot : \underline{188}, 193, 201, 202. label head : \underline{160}, 161, 181, 187, 189, 191, 193, 200. label tail : \underline{160}, 161, 163, 181. label type: 79, \underline{80}, 83, 163. last bop: \underline{102}, 103, 115* , 172. last text char : \underline{11*} , 15. left coords : \underline{186}, 190, 196, 197, 198, 199. left quotes : \underline{78}, 172. length: \underline{72}, 83, 98, 100, 111* , 115* , 137. lf : \underline{37}, \underline{58}, 60* , 61, 69. lh: \underline{37}, 38, \underline{58}, 60* , 61, 62* . lig kern: 41, 42, 53. lig kern base: \underline{53}, 56, 61, 64, 66* , 69. lig kern command : 38, \underline{42}. lig kern restart : \underline{56}, 120. lig kern restart end : \underline{56}. lig kern start : \underline{56}, 120. lig lookahead : \underline{5*} , 116, 117. lig stack : 116, \underline{117}, 122. lig tag : \underline{41}, 63, 120. line length: 17* , \underline{18}, 94* , 95, 99, 100, 101. list tag : \underline{41}, 63, 210. load fonts : 96, \underline{98}. logo font : \underline{52*} , 58, 97, 98, 115* , 172. logo font name: \underline{78}, 97. longest keyword : \underline{75}, 81, 82, 98. loop: 6, \underline{7}. m: \underline{3*} , \underline{81}, \underline{98}, \underline{114}, \underline{220}. mag : 21, \underline{23}, 24, 25. make string : \underline{74}, 83, 91, 101, 221. max depth: \underline{140}, 143, 144, 147. max h: \underline{102}, 103, 115* , 203. max height : \underline{140}, 143, 144, 146. max k : \underline{116}. max keyword : \underline{77}, 78, 79, 83. max labels : \underline{5*} , 139, 140, 141, 142, 161. max m: 29, \underline{31}. max n: 29, \underline{31}. max node: \underline{140}, 141, 144, 187. max quarterword : \underline{52*} . max strings : \underline{5*} , 70, 74, 91. max v : \underline{102}, 103, 115* , 170. max x : 165, \underline{166}, 170, 218. max y : 165, \underline{166}, 167, 170, 218. memory word : 52* , 53. mid : \underline{43}. min m: 29, \underline{31}. min n: 29, \underline{31}. min quarterword : \underline{52*} , 53, 55* , 61, 69, 116. min x : 165, \underline{166}, 167, 170, 218. min y : 165, \underline{166}, 170. : 219* . : 184. : 169. more name: 86, \underline{90*} , 95. n: \underline{3*} , \underline{92}, \underline{114}. name length: \underline{92}. name of file: 47* , \underline{48}, 92. nd : \underline{37}, 38, \underline{58}, 60* , 61, 63. ne: \underline{37}, 38, \underline{58}, 60* , 61, 63. nearest dot : 148, \underline{150}, 192, 201, 202. new row 0 : 29, \underline{30}, 215* . new row 1 : \underline{29}. new row 164 : \underline{29}. next : 139, \underline{140}, 143, 144, 145, 146, 151, 159,

160, 162, 163, 172, 173, 181, 187, 189, 191, 193, 200, 201, 202. next char : 42, \underline{55*} , 120. nh: \underline{37}, 38, \underline{58}, 60* , 61, 63. ni : \underline{37}, 38, \underline{58}, 60* , 61, 63. nil: 7. nk : \underline{37}, 38, \underline{58}, 60* , 61, 66* . nl : \underline{37}, 38, 42, \underline{58}, 60* , 61, 63, 66* , 69. : 221. : 61. no op: 29, \underline{30}, 32, 79, 81, 85, 154, 215* , 219* . no operation: \underline{79}, 81, 154. no tag : \underline{41}, 63. node ins : \underline{143}, 188, 190, 194. node pointer : \underline{139}, 140, 141, 143, 145, 149, 150,

158, 160, 185, 186, 194. non address : \underline{52*} , 53, 69, 120. non char : \underline{52*} , 53, 116, 122. nop: 19, 21, 24, 25. not found : \underline{6}, 81, 82, 98, 99. np: \underline{37}, 38, \underline{58}, 60* , 61, 68. null : \underline{139}, 150, 161, 162, 172, 173, 181, 187, 189,

191, 192, 193, 200, 201, 202. null string : \underline{77}, 79, 81, 83, 86, 88* , 91, 94* , 97,

98, 101, 154. num: 21, \underline{23}, 25. nw : \underline{37}, 38, \underline{58}, 60* , 61, 63. n1 : \underline{81}, 83, \underline{98}, 100. n2 : \underline{81}, 83, \underline{98}, 100. oct : \underline{194}, 195, 196, 197, 198, 199. octant : \underline{191}, 192, 194, 195. odd : 210. offset code: \underline{77}, 154. offset x : \underline{155}, 156, 157, 170. offset y : \underline{155}, 156, 157, 170. op byte: 42, \underline{55*} , 56, 120, 122. open dvi file: \underline{47*} , 94* . open gf file: \underline{47*} , 94* . open tfm file: \underline{47*} , 98. ord : 12. oriental characters: 32. othercases: \underline{2}. others : 2. output : 3* . over col : \underline{168}, 170, 202, 203. overflow line: 181, \underline{182}, 202, 203. overlap: \underline{145}, 146, 147, 196, 197, 198, 199. p: \underline{143}, \underline{145}, \underline{150}, \underline{185}, \underline{186}, \underline{194}, \underline{220}. pack file name: \underline{92}, 94* , 98. page header : \underline{78}, 172. page height : \underline{168}, 170. page width: 168, 170, 203. paint black : 215* , 216, \underline{218}. paint switch: \underline{28}, 29. paint 0 : 29, \underline{30}. paint1 : 29, \underline{30}, 215* . paint2 : 29, \underline{30}, 215* . paint3 : 29, \underline{30}, 215* . param: 39, 44, \underline{57}. param base: \underline{53}, 57, 61, 67, 68, 69. param end : \underline{57}. place label : 193, \underline{194}, 195. plus sign: \underline{78}, 202. pool pointer : \underline{70}, 71, 81, 87, 98, 116. pool ptr : \underline{71}, 73, 74, 75, 77, 90* , 219* . pool size: \underline{5*} , 70, 73. pop: 20, 21, \underline{22}, 25, 171, 172, 176, 177, 178, 188,

190, 194, 202, 208, 218. pop stack : \underline{122}, 123. post : 19, 21, \underline{22}, 25, 26, 27, 29, 31, 33, 115* , 219* . post post : 21, \underline{22}, 25, 26, 29, 31, 33, 115* . pre: 19, 21, \underline{22}, 27, 29, 221. pre max x : \underline{155}, 156, 159, 163, 170. pre max y : \underline{155}, 156, 159, 163, 170. pre min x : \underline{155}, 156, 159, 163, 170. pre min y : \underline{155}, 156, 159, 163, 170. prev : 139, \underline{140}, 143, 144, 147, 152, 160, 201, 202. print : \underline{3*} , 99, 138* . print ln: \underline{3*} , 8* , 219* . print nl : \underline{3*} , 58, 94* , 99, 138* , 154, 163. print pascal string : 47* . print real : 138* . proofing : 32. push: 20, 21, \underline{22}, 25, 171, 208. put rule: 21, \underline{22}, 176, 177. put1 : 21. put2 : 21. put3 : 21. put4 : 21. q: \underline{143}, \underline{145}, \underline{220}. qi : \underline{52*} , 62* , 69, 116, 118* , 120. qo: \underline{52*} , 55* , 69, 111* , 122, 123, 210. qqqq : 53, 55* , 63, 66* , 67, 120. quad : 44. quarterword : \underline{52*} , 117. qw : \underline{58}, 62* . r: \underline{138*} , \underline{143}, \underline{145}, \underline{220}. read : 50, 51* . read font info: \underline{58}, 98. read ln: 17* . read tfm word : \underline{50}, 60* , 62* , 64, 68. read two halves : \underline{60*} . read two halves end : \underline{60*} . real : 114, 134, 138* , 168. rem byte: \underline{55*} , 56, 122, 210. remainder : \underline{40}, 41, 42. rep: \underline{43}. reset : 47* . reswitch: \underline{6}, 210, 218. return: 6, \underline{7}. rewrite: 47* . rho: 206, \underline{207}, 217. right coords : \underline{186}, 190, 196, 197, 198, 199. right quotes : \underline{78}, 172. right1 : 21. right2 : 21. right3 : 21. right4 : 21, \underline{22}, 119, 121, 171, 209. round : 114, 167, 170, 178, 179, 180, 209, 218. rule code: \underline{77}, 154. rule ptr : \underline{158}, 159, 161, 173. rule size: \underline{158}, 159, 173, 176, 177, 178. rule slant : \underline{134}, 137, 173, 178. rule thickness : 154, \underline{155}, 156, 159. rule thickness code: \underline{77}, 79, 154. s: \underline{58}, \underline{116}, \underline{220}. Samuel, Arthur Lee: 191. save c: \underline{116}. sc: 53, 55* , 56, 57, 64, 66* , 68. scaled : \underline{9}, 29, 31, 32, 52* , 53, 58, 84, 96, 102, 116, 117, 140, 145, 150, 155, 167, 168, 171, 174, 183.

second octant : \underline{192}, 196, 197, 198, 199. select font : \underline{111*} , 172, 173, 181, 218. send it : \underline{116}, 119, 121. set char 0 : 21. set char 1 : 21. set char 127 : 21. set cur r : \underline{116}, 122, 123. set paths : 219* . set rule: 19, 21. set1 : 21, \underline{22}, 113. set2 : 21. set3 : 21. set4 : 21. seventh octant : \underline{192}, 196, 197, 198, 199. signed quad : \underline{51*} , 81, 84, 85, 165. sixth octant : \underline{192}, 196, 197, 198, 199. sixty four cases : \underline{215*} . skip byte: 42, \underline{55*} , 120. skip nop: \underline{85}, 215* . skip0 : 29, \underline{30}, 215* . skip1 : 29, \underline{30}, 215* . skip2 : 29, \underline{30}, 215* . skip3 : 29, \underline{30}, 215* . slant : \underline{44}, \underline{57}, 68, 137, 169. slant fonts: 35, 39. slant complaint : \underline{138*} , 178. slant font : \underline{52*} , 58, 77, 97, 98, 100, 137, 154, 173. slant n: \underline{134}, 137, 178. slant ratio: 167, \underline{168}, 169, 170. slant reported : \underline{134}, 137, 138* . slant unit : \underline{134}, 137, 178, 179, 180. small logo: \underline{78}, 172. : 138* . sp: 23. space: 44, \underline{57}, 119, 184. space shrink : 44. space stretch: 44. : 99. stack ptr : \underline{116}, 122, 123. start gf : \underline{94*} , 219* . starting col : 208, 214, 217, \underline{218}. stdin: 16* . stdout : 3* , 16* . stop flag : \underline{42}, 66* , 120. store four quarters : \underline{62*} , 63, 66* , 67. store scaled : \underline{64}, 66* , 68. str number : \underline{70}, 71, 74, 80, 86, 92, 93, 96,

116, 140, 220. str pool : 70, \underline{71}, 73, 74, 75, 83, 92, 100, 111* ,

112, 116, 221. str ptr : \underline{71}, 74, 75, 77, 91, 101, 154, 219* , 221. str room: \underline{73}, 83, 90* , 101. str start : 70, \underline{71}, 72, 74, 75, 77, 83, 91, 92, 100,

112, 116, 219* , 221. suppress lig : 116, \underline{117}, 120, 122. sw : \underline{58}, 64, 68. system dependencies: \underline{2}, 3* , 8* , 11* , 14* , 16* , 17* , 26,

33, 45, 47* , 50, 51* , 52* , 78, 86, 87, 88* , 89, 90* , 91, 92, 105, 107* , 222.

t: \underline{220}. tag : \underline{40}, 41.

: 154. temp x : 173, \underline{174}, 177, 178. temp y : 173, \underline{174}, 176, 178. term in: \underline{16*} , 17* . term out : \underline{3*} . terminal line length: \underline{5*} , 16* , 17* , 18, 94* . test read access : 47* , 88* . text char : \underline{11*} , 12. text file: \underline{11*} . tfm ext : \underline{78}, 98. tfm file: \underline{46}, 47* , 50, 58. TFM FILE PATH BIT : 219* . TFMFILEPATH : 47* . third octant : \underline{192}, 196, 197, 198, 199. thirty two cases : \underline{215*} . thrice x height : \underline{183}, 184, 202. time stamp: 172, \underline{220}, 221. title code: \underline{77}, 154. title font : \underline{52*} , 58, 77, 78, 97, 98, 100, 115* , 154, 172. title head : \underline{160}, 161, 162, 172. title tail : \underline{160}, 161, 162, 172. toint : 51* , 60* , 62* , 66* . tol : \underline{173}. : 74, 141. : 73, 91. top: \underline{43}. top coords : \underline{185}, 190, 196, 197, 198, 199. total pages : \underline{102}, 103, 115* , 172. true: 7, 90* , 95, 96, 97, 122, 146, 147, 148, 151,

152, 172, 190, 194, 202, 215* , 221. twin: 148, \underline{149}, 150, 151, 152, 192. two to the: 126, \underline{127}, 128, 129, 206. typeset : \underline{113}, 121, 179, 180, 210. uexit : 8* , 115* . unity : \underline{9}, 62* , 114, 137, 168, 169, 170. unsc slant ratio: \underline{168}, 169, 170, 209. unsc x ratio: \underline{168}, 169, 170, 209, 218. unsc y ratio: \underline{168}, 169, 170, 218. update terminal : \underline{16*} , 17* . use logo: 172, \underline{220}, 221. v: \underline{84}, \underline{98}, \underline{218}. : 169. vppp: \underline{31}. : 72. web2c: 52* . white: 29. widest row : \underline{5*} , 165, 211, 218. width base: \underline{53}, 55* , 61, 63, 64, 69. width index : \underline{40}, 53. write: 3* . write chunk : 107* . write dvi : \underline{107*} , 108, 109. write ln: 3* . : 221. w0 : 21. w1 : 21. w2 : 21. w3 : 21. w4 : 21. x: \underline{23}, \underline{110}, \underline{114}, \underline{116}, \underline{166}, \underline{167}, \underline{171}. x height : 44, \underline{57}, 184. x left : \underline{145}, 146, 147. x offset : 154, \underline{155}, 156, 167. x offset code: \underline{77}, 154. x ratio: 167, \underline{168}, 169, 170, 202. x right : \underline{145}, 146, 147. xchr : \underline{12}, 13, 14* , 15, 92. xclause: 7. xl : 139, \underline{140}, 145, 146, 147, 148, 158, 185, 186, 188. xord : \underline{12}, 15, 17* , 94* . xr : 139, \underline{140}, 145, 146, 147, 148, 158, 185,

186, 188, 191. xx : 139, \underline{140}, 148, 151, 152, 158, 163, 185, 186,

187, 188, 190, 192, 194, 195, 202. xxx1 : 21, 29, \underline{30}, 79, 81, 85, 154, 215* , 219* . xxx2 : 21, 29, \underline{30}, 81, 85, 215* . xxx3 : 21, 29, \underline{30}, 81, 85, 215* . xxx4 : 21, 29, \underline{30}, 79, 81, 85, 215* . x0 : 21, \underline{158}, 159, 173. x1 : 21, \underline{158}, 159, 173. x2 : 21. x3 : 21. x4 : 21. y: \underline{166}, \underline{167}, \underline{171}. y bot : \underline{145}, 146, 147. y offset : 154, \underline{155}, 156, 167. y offset code: \underline{77}, 154. y ratio: 167, \underline{168}, 169, 170, 202. y thresh: \underline{145}, 146, 147. y top: \underline{145}, 146, 147. yb: 139, \underline{140}, 143, 145, 146, 147, 148, 158,

185, 186, 188. yt : 139, \underline{140}, 143, 145, 146, 147, 148, 158,

185, 186, 188. yy : 139, \underline{140}, 142, 143, 146, 147, 148, 151, 152,

163, 185, 186, 187, 188, 190, 192, 194, 195, 202. yyy : 29, \underline{30}, 32, 79, 81, 84, 85, 215* . y0 : 21, \underline{158}, 159, 173. y1 : 21, \underline{158}, 159, 173. y2 : 21. y3 : 21. y4 : 21. z: \underline{58}, \underline{166}. z0 : 21, \underline{22}, 179, 180.

z1 : 21. z2 : 21. z3 : 21. z4 : 21, \underline{22}, 179, 180.

§223  GFtoDVI changes for Berkeley UNIX  NAMES OF THE SECTIONS 323

⟨ Add a full set of k-bit characters 128 ⟩ Used in section 126. ⟨ Add more rows to a, until 12-bit entries are obtained 213 ⟩ Used in section 218. ⟨ Add special k-bit characters of the form 129 ⟩ Used in section 126. ⟨ Adjust the maximum page width 203 ⟩ Used in section 164*. ⟨ Advance to the next row that needs to be typeset; or return, if we’re all done 217 ⟩ Used in section 218. ⟨ Carry out a ligature operation, updating the cursor structure and possibly advancing k; goto continue if

the cursor doesn’t advance, otherwise goto done 122 ⟩ Used in section 120. ⟨ Compute the octant code for floating label p 192 ⟩ Used in section 191. ⟨ Constants in the outer block 5* ⟩ Used in section 3*. ⟨ Declare the procedure called load fonts 98 ⟩ Used in section 111*. ⟨ Empty the last bytes out of dvi buf 109 ⟩ Used in section 115*. ⟨ Enter a dot for label p in the rectangle list, and typeset the dot 188 ⟩ Used in section 187. ⟨ Enter a prescribed label for node p into the rectangle list, and typeset it 190 ⟩ Used in section 189. ⟨ Find nearest dots, to help in label positioning 191 ⟩ Used in section 181. ⟨ Find non-overlapping coordinates, if possible, and goto found; otherwise set place label ← false and

return 195 ⟩ Used in section 194.

⟨ Finish reading the parameters of the boc 165 ⟩ Used in section 164*.

⟨ Finish the file and goto final end 115* ⟩ Used in section 219*.

⟨ Get online special input 99 ⟩ Used in section 98.

⟨ Get ready to convert  coordinates to  coordinates 170 ⟩ Used in section 164*.

⟨ Globals in the outer block 12, 16*, 18, 37, 46, 48, 49, 53, 71, 76, 80, 86, 87, 93, 96, 102, 105, 117, 127, 134, 140, 149, 155,

158, 160, 166, 168, 174, 182, 183, 207, 211, 212, 220 ⟩ Used in section 3*.

⟨ If the keyword in buffer [1 . . l] is known, change c and goto done 83 ⟩ Used in section 82. ⟨ If there’s a ligature or kern at the cursor position, update the cursor data structures, possibly advancing k;

continue until the cursor wants to move right 120 ⟩ Used in section 116. ⟨ Initialize global variables that depend on the font data 137, 169, 175, 184, 205, 206 ⟩ Used in section 98.

⟨ Initialize the strings 77, 78, 88* ⟩ Used in section 219*.

⟨ Initialize variables for the next character 144, 156, 161 ⟩ Used in section 219*. ⟨ Look for overlaps in node q and its predecessors 147 ⟩ Used in section 145. ⟨ Look for overlaps in the successors of node q 146 ⟩ Used in section 145. ⟨ Make final adjustments and goto done 69 ⟩ Used in section 59. ⟨ Move the cursor to the right and goto continue, if there’s more work to do in the current word 123 ⟩

Used in section 116.

⟨ Move to column j in the output 209 ⟩ Used in section 208. ⟨ Output a horizontal rule 177 ⟩ Used in section 173. ⟨ Output a vertical rule 176 ⟩ Used in section 173. ⟨ Output all attachable labels 193 ⟩ Used in section 181.

⟨ Output all dots 187 ⟩ Used in section 181.

⟨ Output all labels for the current character 181 ⟩ Used in section 164*. ⟨ Output all overflow labels 200 ⟩ Used in section 181. ⟨ Output all prescribed labels 189 ⟩ Used in section 181. ⟨ Output all rules for the current character 173 ⟩ Used in section 164*. ⟨ Output the equivalent of k copies of character v 210 ⟩ Used in section 208. ⟨ Output the font name whose internal number is f 112 ⟩ Used in section 111*. ⟨ Output the bop and the title line 172 ⟩ Used in section 164*.

⟨ Override the offsets 157 ⟩ Used in section 154.

⟨ Paint k bits and read another command 216 ⟩ Used in section 215*.

⟨ Process a character 164* ⟩ Used in section 219*.

⟨ Process a no-op command 154 ⟩ Used in section 219*.

⟨ Process the preamble 221 ⟩ Used in section 219*.

⟨ Put the bits for the next row, times l, into a 214 ⟩ Used in section 213.

324  NAMES OF THE SECTIONS  GFtoDVI changes for Berkeley UNIX §223

⟨ Read and check the font data; abend if the file is malformed; otherwise goto done 59 ⟩

Used in section 58.

⟨ Read and process commands until coming to the end of this row 215* ⟩ Used in section 214. ⟨ Read box dimensions 64 ⟩ Used in section 59. ⟨ Read character data 63 ⟩ Used in section 59. ⟨ Read extensible character recipes 67 ⟩ Used in section 59. ⟨ Read font parameters 68 ⟩ Used in section 59. ⟨ Read ligature/kern program 66* ⟩ Used in section 59. ⟨ Read the next k characters of the file; change c and goto done if a keyword is recognized 82 ⟩

Used in section 81. ⟨ Read the header 62* ⟩ Used in section 59. ⟨ Read the size fields 60* ⟩ Used in section 59.

⟨ Remove all rectangles from list, except for dots that have labels 201 ⟩ Used in section 200. ⟨ Replace z by z′ and compute α, β 65 ⟩ Used in section 64. ⟨ Scan the file name in the buffer 95 ⟩ Used in section 94*. ⟨ Search buffer for valid keyword; if successful, goto found 100 ⟩ Used in section 99. ⟨ Search for the nearest dot in nodes following p 151 ⟩ Used in section 150. ⟨ Search for the nearest dot in nodes preceding p 152 ⟩ Used in section 150.

⟨ Set initial values 13, 14*, 15, 54, 97, 103, 106, 118*, 126, 142 ⟩ Used in section 3*. ⟨ Store a label 163 ⟩ Used in section 154. ⟨ Store a rule 159 ⟩ Used in section 154. ⟨ Store a title 162 ⟩ Used in section 154.

⟨ Try the first choice for label direction 196 ⟩ Used in section 195. ⟨ Try the fourth choice for label direction 199 ⟩ Used in section 195. ⟨ Try the second choice for label direction 197 ⟩ Used in section 195. ⟨ Try the third choice for label direction 198 ⟩ Used in section 195. ⟨ Try to output a diagonal rule 178 ⟩ Used in section 173.

⟨ Types in the outer block 9, 10, 11*, 45, 52*, 70, 79, 104, 139 ⟩ Used in section 3*.

⟨ Typeset a space in font f and advance k 119 ⟩ Used in section 116. ⟨ Typeset an overflow label for p 202 ⟩ Used in section 200. ⟨ Typeset character cur l , if it exists in the font; also append an optional kern 121 ⟩ Used in section 116. ⟨ Typeset the pixels of the current row 208 ⟩ Used in section 218. ⟨ Update the font name or area 101 ⟩ Used in section 99. ⟨ Use size fields to allocate font information 61 ⟩ Used in section 59. ⟨ Vertically typeset p copies of character k + 1 180 ⟩ Used in section 178. ⟨ Vertically typeset q copies of character k 179 ⟩ Used in section 178.

The GFtoDVI processor

(Version 3.0, October 1989)

Section Page

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 302 The character set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 304 Device-independent file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 305 Generic font file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 305 Extensions to the generic format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 305 Font metric data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 305 Input from binary files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 305 Reading the font information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 306 The string pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 309 File names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 309 Shipping pages out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 310 Rudimentary typesetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 311 Gray fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 312 Slant fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 312 Representation of rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 313 Doing the labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 313 Doing the pixels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 314 The main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 315 System-dependent changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 316 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 316

The preparation of this report was supported in part by the National Science Foundation under grants IST-8201926, MCS-8300984, and CCR-8610181, and by the System Development Foundation. ‘TEX’ is a trademark of the American Mathematical Society. ‘ ’ is a trademark of Addison-Wesley Publishing Company.