202  INTRODUCTION  VPtoVF changes for C §1

1* . Introduction. The utility program converts virtual-property-list (“ ”) files into an equivalent pair of files called a virtual font (“ ”) file and a TEX font metric (“ ”) file. It also makes a thorough check of the given file, so that the file should be acceptable to device drivers and the file should be acceptable to TEX.

is an extended version of the program , which is part of the standard TEXware library. The idea of a virtual font was inspired by the work of David R. Fuchs who designed a similar set of conventions in 1984 while developing a device driver for ArborText, Inc. He wrote a somewhat similar program called .

The banner string defined here should be changed whenever gets modified.

define banner ≡ ´ ␣ ␣ ␣ ␣ ␣ ´ { printed when the program starts }

2* . This program is written entirely in standard Pascal, except that it has to do some slightly systemdependent character code conversion on input. Furthermore, lower case letters are used in error messages; they could be converted to upper case if necessary. The input is read from vpl file, and the output is written on vf file and tfm file; 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 print (#) ≡ write(#)

define print ln(#) ≡ write ln(#) program VPtoVF ;

const ⟨ Constants in the outer block 3 ⟩

type ⟨ Types in the outer block 23 ⟩

var ⟨ Globals in the outer block 5 ⟩

procedure initialize; { this procedure gets things started properly } var ⟨ Local variables for initialization 25 ⟩ begin ⟨ Set initial values 6* ⟩ end;

§5  VPtoVF changes for C  PROPERTY LIST DESCRIPTION OF FONT METRIC DATA 203

6* . ⟨ Set initial values 6* ⟩ ≡

if argc < 4 then begin print ln(´ ␣ ␣ ␣ ␣ ␣ ␣ ␣ ´ ); uexit (1); end;

argv (1, vpl name); reset (vpl file, vpl name); print ln(banner );

See also sections 22*, 26, 28, 30, 32, 45, 49, 68, 80, 84, and 148. This code is used in section 2*.

21* . The next question is, “What are and files?” A complete answer to that question appears in the documentation of the companion programs, and , so the details will not be repeated here. Suffice it to say that a or file stores all of the relevant font information in a sequence of 8-bit bytes. The number of bytes is always a multiple of 4, so we could regard the files as sequences of 32-bit words; but TEX uses the byte interpretation, and so does . Note that the bytes are considered to be unsigned numbers. ⟨ Globals in the outer block 5 ⟩ +≡ vf file: packed file of 0 . . 255; tfm file: packed file of 0 . . 255; vf name, tfm name, vpl name: packed array [1 . . FILENAMESIZE ] of char ;

22* . On some systems you may have to do something special to write a packed file of bytes. ⟨ Set initial values 6* ⟩ +≡

argv (2, vf name); rewrite(vf file, vf name); argv (3, tfm name); rewrite(tfm file, tfm name);

204  THE CHECKING AND MASSAGING PHASE  VPtoVF changes for C §23

144* . define round message(#) ≡

if delta > 0 then begin print (´ ␣ ␣ ␣ ␣ ␣´ , #, ´ ␣ ␣´ ); print real ((((delta + 1) div 2)/´ 4000000 ), 1, 7); print ln(´ ␣ ´ ); end

⟨ Put the width, height, depth, and italic lists into final form 144* ⟩ ≡ delta ← shorten(width, 255); set indices (width, delta); round message(´ ´ ); delta ← shorten(height , 15); set indices (height , delta); round message(´ ´ ); delta ← shorten(depth, 15); set indices (depth, delta); round message(´ ´ ); delta ← shorten(italic, 63); set indices (italic, delta); round message(´ ␣ ´ );

This code is used in section 139.

152* . (More good stuff from .)

ifdef (´ ´ ) function f(h, x, y : indx ): indx ;

begin end;

{ compute f for arguments known to be in hash[h] } endif (´ ´ ) function eval (x, y : indx ): indx ; { compute f(x, y) with hashtable lookup }

var key : integer ; { value sought in hash table } begin key ← 256 ∗ x + y + 1; h ← (1009 ∗ key ) mod hash size; while hash[h] > key do

if h > 0 then decr (h) else h ← hash size; if hash[h] < key then eval ← y { not in ordered hash table } else eval ← f(h, x, y); end;

153* . Pascal’s beastly convention for forward declarations prevents us from saying function f(h, x, y : indx ): indx here. function f(h, x, y : indx ): indx ;

begin case class [h] of simple: do nothing ; left z : begin class [h] ← pending ; lig z [h] ← eval (lig z [h], y); class [h] ← simple;

end; right z : begin class [h] ← pending ; lig z [h] ← eval (x, lig z [h]); class [h] ← simple;

end; both z : begin class [h] ← pending ; lig z [h] ← eval (eval (x, lig z [h]), y); class [h] ← simple;

end; pending : begin x lig cycle ← x; y lig cycle ← y; lig z [h] ← 257; class [h] ← simple;

end; { the value 257 will break all cycles, since it’s not in hash } end; { there are no other cases } f ← lig z [h]; end;

§156  VPtoVF changes for C  THE TFM OUTPUT PHASE 205

156* . The TFM output phase. Now that we know how to get all of the font data correctly stored in ’s memory, it only remains to write the answers out.

First of all, it is convenient to have an abbreviation for output to the file: define out (#) ≡ putbyte(#, tfm file)

165* . When a scaled quantity is output, we may need to divide it by design units . The following subroutine takes care of this, using floating point arithmetic only if design units ≠ 1.0. procedure out scaled (x : fix word ); { outputs a scaled fix word }

var n: byte; { the first byte after the sign }

m: 0 . . 65535; { the two least significant bytes } begin if fabs (x/design units ) ≥ 16.0 then

begin print (´ ␣ ␣ ␣´ ); print real (x/´ 4000000 , 1, 3); print ln(´ ␣ ␣ ␣ ´ ); print (´ ␣␣ ␣ ␣ ␣ ␣ ´ ); if design units ≠ unity then

begin print (´ ␣ ´ ); print real (design units /´ 200000 , 1, 3); print (´ ␣ ´ ); end;

print ln(´ ´ ); x ← 0;

end; if design units ≠ unity then x ← round ((x/design units ) ∗ 1048576.0); if x < 0 then

begin out (255); x ← x + ´ 100000000 ;

end else out (0); n ← x div ´ 200000 ; m ← x mod ´ 200000 ; out (n); out (m div 256); out (m mod 256); end;

169* . ⟨ Insert all labels into label table 169* ⟩ ≡ label ptr ← 0; label table[0].rr ← −1; { sentinel } for c ← bc to ec do

if char tag [c] = lig tag then begin sort ptr ← label ptr ; { there’s a hole at position sort ptr + 1 } while label table[sort ptr ].rr > toint (char remainder [c]) do

begin label table[sort ptr + 1] ← label table[sort ptr ]; decr (sort ptr ); { move the hole } end;

label table[sort ptr + 1].cc ← c; label table[sort ptr + 1].rr ← char remainder [c]; incr (label ptr ); end

This code is used in section 168.

206  THE VF OUTPUT PHASE  VPtoVF changes for C §175

175* . The VF output phase. Output to vf file is considerably simpler.

define id byte = 202 { current version of format } define vout (#) ≡ putbyte(#, vf file)

§183  VPtoVF changes for C  INDEX 207

⟨ Globals in the outer block 5 ⟩ +≡ vcount : integer ; { number of bytes written to vf file } 183* . Index. Pointers to error messages appear here together with the section numbers where each identifier is used.

The following sections were changed by the change file: 1, 2, 6, 21, 22, 144, 152, 153, 156, 165, 169, 175, 183.

a: \underline{39}. : 142. acc: \underline{60}, 61, 62, 63, 64, 65, \underline{72}, 74, 76. : 72. argc: 6* . argv : 6* , 22* . ASCII code: \underline{23}, 24, 36, 44, 46, 60. : 120. backup: \underline{38}, 62, 63, 64, 112. bad indent : \underline{35}. banner : \underline{1*} , 6* . bc: \underline{158}, 159, 160, 163, 164, 169* , 177. bchar : \underline{77}, 80, 95, 149, 154, 155, 167, 168, 171. bchar label : \underline{82}, 84, 112, 139, 145, 154, 168. boolean: 29, 41, 50, 72, 77, 113, 128, 138,

150, 158, 167. : 141. both z : \underline{146}, 150, 151, 153* . boundary char code: \underline{52}, 55, 95. buf size: \underline{3}, 29, 33, 34. buffer : \underline{29}, 33, 34, 35, 37, 38, 40, 41, 61. byte: \underline{23}, 39, 52, 53, 60, 66, 77, 82, 83, 89, 90, 91,

97, 111, 124, 128, 136, 158, 165* , 167, 180. b0 : \underline{66}, 67, 68, 104, 114, 115, 116, 117, 121, 141,

145, 149, 155, 171, 172, 178. b1 : \underline{66}, 67, 68, 104, 116, 117, 121, 141, 145, 149,

151, 155, 171, 172, 178. b2 : \underline{66}, 67, 68, 104, 116, 117, 121, 141, 145, 149,

151, 155, 168, 171, 172, 178. b3 : \underline{66}, 67, 68, 104, 116, 117, 121, 141, 145, 149,

151, 155, 168, 171, 172, 178. c: \underline{69}, \underline{83}, \underline{91}, \underline{124}, \underline{150}, \underline{180}. : 61. cc: \underline{124}, 127, \underline{150}, 151, \underline{167}, 169* , 170. char : 21* , 24, 29. char dp: \underline{82}, 84, 119, 164. char dp code: \underline{52}, 55, 119. char ht : \underline{82}, 84, 119, 164. char ht code: \underline{52}, 55, 119. char ic: \underline{82}, 84, 119, 164. char ic code: \underline{52}, 55, 119. char info: 164. char info code: \underline{52}. char info word : 82. char remainder : \underline{82}, 84, 112, 119, 120, 140, 141,

142, 149, 154, 164, 167, 169* , 170. char tag : \underline{82}, 84, 111, 112, 119, 120, 140, 142,

154, 164, 169* .

char wd : \underline{82}, 84, 85, 118, 119, 139, 140, 155,

159, 163, 164, 177, 179. char wd code: \underline{52}, 55, 103, 119. : 127. character code: \underline{52}, 55, 94, 95. chars on line: \underline{31}, 32, 33, 137. check existence: \underline{140}, 149. check existence and safety : \underline{140}, 141. check sum code: \underline{52}, 55, 95. check sum loc: \underline{80}, 95, 163, 177. check sum specified : \underline{77}, 80, 95, 162. check tag : \underline{111}, 112, 119, 120. chr : 26, 34. class : \underline{147}, 150, 153* , 154. clear lig kern entry : \underline{145}. coding scheme code: \underline{52}, 55, 95. coding scheme loc: \underline{80}, 95. comment code: \underline{52}, 55, 94, 103, 106, 110, 119,

121, 125. copy to end of item: \underline{41}, 95, 107, 108, 134.

corr and check : \underline{180}, 181.
cur bytes : 66, \underline{67}, 69, 70, 104, 106, 126.

cur char : \underline{36}, 37, 38, 39, 40, 42, 43, 58, 60, 61, 62, 63, 64, 65, 69, 70, 72, 73, 74, 76, 92, 94, 97, 100, 102, 104, 109, 112, 118, 120, 124, 134. cur code: \underline{52}, 58, 94, 95, 103, 106, 110, 116, 119,

121, 125, 130, 131, 134. cur font : \underline{77}, 104, 105, 106, 107, 108, 124, 126,

127, 177, 178, \underline{180}. cur hash: \underline{47}, 50, 51, 53. cur name: \underline{46}, 50, 51, 53, 54, 58. c0 : \underline{67}, 70, 96, 163. c1 : \underline{67}, 70, 96, 163. c2 : \underline{67}, 70, 96, 163. c3 : \underline{67}, 70, 96, 163. d: \underline{79}, \underline{85}, \underline{87}, \underline{88}, \underline{90}. : 69. decr : \underline{4}, 38, 40, 41, 50, 58, 76, 90, 97, 102, 117, 124, 128, 133, 150, 152* , 159, 169* , 170, 171.

delta: \underline{143}, 144* .

depth: \underline{52}, 84, 119, 144* , 159, 160.
design size: \underline{77}, 80, 98, 162.
design size code: \underline{52}, 55, 95.
design size loc: \underline{80}, 162, 177.

design units : \underline{77}, 80, 99, 106, 128, 163, 165* , 179.

design units code: \underline{52}, 55, 95.
dict ptr : \underline{44}, 45, 53.
dictionary : \underline{44}, 50, 53.
do nothing : \underline{4}, 111, 140, 151, 153* .

208  INDEX  VPtoVF changes for C §183

: 132. double check ext : \underline{155}. double check lig : \underline{155}. double check rep: \underline{155}. double check tail : \underline{155}. down1 : \underline{122}, 131. ec: \underline{158}, 159, 160, 163, 164, 169* , 177. : 133. endif : 152* . enter name: \underline{53}, 54. eof : 34. eoln: 34. equiv : \underline{52}, 53, 55, 58. err print : \underline{33}, 35, 38, 39, 40, 41, 42, 43, 58, 85, 92,

93, 95, 97, 98, 99, 100, 104, 107, 108, 111, 114, 115, 116, 117, 120, 124, 126, 127, 132, 133, 135.

eval : \underline{152*} , 153* . excess : 88, \underline{89}, 90. existence tail : \underline{140}. ext tag : \underline{82}, 111, 120, 140. exten: \underline{77}, 120, 121, 141, 155, 172. : 92. extra loc needed : \underline{167}, 168, 170, 171. f: \underline{152*} , \underline{153*} . fabs : 165* . face code: \underline{52}, 55, 95. face loc: \underline{80}, 95. false: 30, 34, 41, 50, 72, 80, 100, 112, 114, 115,

128, 139, 150, 159, 168, 170. family code: \underline{52}, 55, 95. family loc: \underline{80}, 95. farea length: \underline{77}, 105, 108, 178. farea start : \underline{77}, 105, 108, 178. : 40. FILENAMESIZE : 21* . fill buffer : \underline{34}, 35, 37, 38, 40, 41. finish inner property list : \underline{102}, 104, 109, 118,

120, 124. finish the property : \underline{43}, 94, 102, 103, 106, 110,

119, 121, 125. first ord : \underline{24}, 26. fix word : \underline{71}, 72, 77, 81, 82, 85, 86, 87, 88, 90, 91,

105, 123, 124, 128, 143, 158, 165* . flush error : \underline{42}, 94, 103, 106, 110, 119, 121, 125. fname length: \underline{77}, 105, 107, 178. fname start : \underline{77}, 105, 107, 178. fnt def1 : 77, \underline{122}, 178. fnt num 0 : \underline{122}, 126. fnt1 : 77, \underline{122}, 126. font area code: \underline{52}, 56, 106. font at : \underline{77}, 105, 106, 178. font at code: \underline{52}, 56, 106. font checksum: \underline{77}, 105, 106, 178. font checksum code: \underline{52}, 56, 106. font dimen code: \underline{52}, 55, 95. font dsize: \underline{77}, 105, 106, 178. font dsize code: \underline{52}, 56, 106. font name code: \underline{52}, 56, 106. font number : \underline{77}, 104, 126. font ptr : \underline{77}, 80, 104, 105, 126, 127, 177. : 108. : 107. forward : 153* . four bytes : \underline{66}, 67, 69, 77. fraction digits : \underline{75}, 76. frozen du: \underline{77}, 80, 99, 106, 128. Fuchs, David Raymond: 1* . g: \underline{180}. get byte: \underline{60}, 95, 101, 103, 112, 115, 116, 117,

118, 119, 121, 127. get fix : \underline{72}, 98, 99, 103, 106, 117, 119, 129,

130, 131. get four bytes : \underline{69}, 96, 104, 106, 126. get hex : \underline{39}, 134. get keyword char : \underline{37}, 58. get name: \underline{58}, 94, 103, 106, 110, 119, 121, 125. get next : \underline{38}, 39, 42, 43, 58, 60, 61, 62, 63, 64,

65, 69, 70, 72, 73, 74, 76, 92, 97, 100, 102, 104, 109, 112, 118, 120, 124.

good indent : \underline{27}, 28, 35. h: \underline{48}, \underline{85}, \underline{87}, \underline{88}, \underline{90}, \underline{124}, \underline{147}, \underline{152*} , \underline{153*} . hash: \underline{147}, 148, 150, 152* , 153* , 154. hash input : 149, \underline{150}. hash list : \underline{147}, 150, 154, 180. hash prime: \underline{47}, 48, 49, 50, 51. hash ptr : \underline{147}, 148, 150, 154. hash size: \underline{3}, 147, 148, 150, 152* , 154, 180. header : 10. : 101. header bytes : \underline{77}, 79, 80, 95, 96, 97, 101, 161,

162, 163, 177. header code: \underline{52}, 55, 95. header index : 77, \underline{78}, 79, 96, 97. header ptr : \underline{77}, 80, 101, 159, 162. height : \underline{52}, 81, 84, 119, 144* , 159, 160. hh: \underline{147}, 154, \underline{180}. hstack : \underline{123}, 124, 132, 133. : 104. : 144* . : 41. id byte: \underline{175*} , 177. ifdef : 152* . : 38, 41. : 70.

: 65. : 39. incr : \underline{4}, 34, 35, 37, 38, 40, 41, 53, 58, 65, 76,

85, 87, 90, 92, 97, 101, 102, 103, 104, 105, 116, 117, 120, 126, 128, 132, 137, 145, 150, 159, 169* , 170, 177.

indent : \underline{27}, 28, 35. index : \underline{89}, 90, 164. indx : \underline{78}, 147, 150, 152* , 153* . : 154. initialize: \underline{2*} , 181. input has ended : \underline{29}, 30, 34, 40, 92. int part : \underline{72}. integer : 25, 27, 39, 40, 41, 60, 69, 71, 72, 75, 77,

87, 88, 91, 128, 150, 152* , 175* , 176, 180. invalid code: \underline{26}, 38, 41. italic: \underline{52}, 81, 84, 119, 144* , 159, 160, 161, 166. j: \underline{50}, \underline{72}, \underline{161}. : 43. junk error : 92, \underline{93}, 102, 104, 109, 118, 120, 124. k: \underline{25}, \underline{33}, \underline{50}, \underline{53}, \underline{88}, \underline{91}, \underline{97}, \underline{124}, \underline{128}, \underline{180}. kern: \underline{77}, 113, 117, 171, 180. kern flag : \underline{113}, 117, 149, 151, 155. key : \underline{150}, \underline{152*} . : 149. krn code: \underline{52}, 55, 110. krn ptr : \underline{113}, 117, 171, \underline{180}. l: \underline{40}, \underline{41}, \underline{87}, \underline{90}. label code: \underline{52}, 55, 110. label ptr : \underline{167}, 169* , 170, 171. label table: \underline{167}, 169* , 170, 171. last ord : \underline{24}, 26. left ln: \underline{29}, 30, 33, 34. left z : \underline{146}, 151, 153* . level : \underline{27}, 28, 35, 40, 41, 58, 102, 104, 109,

118, 120, 124. lf : \underline{158}, 159, 160. lh: \underline{158}, 159, 160. : 149. : 149. lig code: \underline{52}, 55, 110, 116. lig exam: \underline{149}. lig gen: \underline{149}. lig kern: \underline{77}, 114, 115, 116, 117, 145, 147, 149,

151, 155, 168, 171, 180. lig ptr : \underline{147}, 149, 155, 171, \underline{180}. lig table code: \underline{52}, 55, 95. lig tag : \underline{82}, 111, 112, 140, 154, 169* . lig z : \underline{147}, 150, 153* . limit : \underline{29}, 30, 33, 34, 35, 37, 38, 40, 41. line: \underline{27}, 28, 33, 34. link : 81, \underline{82}, 84, 85, 87, 90, 166. list tag : \underline{82}, 111, 119, 140, 142. lk offset : 159, 160, \underline{167}, 168, 170, 171. lk step ended : 112, \underline{113}, 114, 115, 116, 117. load10 : \underline{54}, 55, 56, 57. load11 : \underline{54}, 55. load12 : \underline{54}, 55, 56. load13 : \underline{54}, 57. load14 : \underline{54}. load15 : \underline{54}. load16 : \underline{54}, 55. load17 : \underline{54}. load18 : \underline{54}. load19 : \underline{54}. load20 : \underline{54}, 57. load3 : \underline{54}, 55, 56. load4 : \underline{54}, 55, 56, 57. load5 : \underline{54}, 55, 57. load6 : \underline{54}, 55, 56, 57. load7 : \underline{54}, 55, 56, 57. load8 : \underline{54}, 55, 56. load9 : \underline{54}, 55, 56. loc: \underline{29}, 30, 33, 34, 35, 37, 38, 40, 41, 58, 61,

92, 102. longest name: \underline{46}, 50, 53, 58. lookup: \underline{50}, 53, 58. m: \underline{87}, \underline{90}, \underline{165*} . map code: \underline{52}, 56, 119. map font code: \underline{52}, 56, 95. max header bytes : \underline{3}, 10, 78, 101, 161. max kerns : \underline{3}, 77, 113, 117, 180. max letters : \underline{44}, 50. max lig steps : \underline{3}, 77, 115, 116, 117, 147, 180. max name index : \underline{44}, 46, 47, 52. max param words : \underline{3}, 12, 77, 103, 161. max stack : \underline{3}, 123, 132. : 115. mem ptr : \underline{82}, 84, 85. mem size: \underline{81}, 85. memory : 81, \underline{82}, 84, 85, 87, 88, 89, 90, 158, 159,

160, 161, 163, 166, 179. : 85. : 141. min cover : \underline{87}, 88. min nl : \underline{77}, 80, 112, 115, 145. : 124. move down code: \underline{52}, 56, 125, 131. move right code: \underline{52}, 56, 125, 130. n: \underline{165*} . name enter : \underline{180}, 181. name length: \underline{46}, 50, 51, 53, 54, 58. name ptr : \underline{46}, 50, 58. ne: \underline{77}, 80, 120, 121, 155, 159, 160, 172. negative: \underline{72}, 73, \underline{128}. next d : \underline{86}, 87, 88, 98, 99. next larger code: \underline{52}, 55, 119. nhash: \underline{47}, 49, 50, 53. nk : \underline{77}, 80, 117, 159, 160, 171. nl : \underline{77}, 80, 112, 114, 115, 116, 117, 139, 145, 149,

154, 155, 159, 160, 168, 171. no tag : \underline{82}, 84, 111, 140, 142, 154. nonblank found : \underline{41}. not found : \underline{50}, \underline{158}, 159. np: \underline{77}, 80, 103, 159, 160, 173. numbers differ : \underline{104}, 126. opcode: \underline{128}. out : \underline{156*} , 160, 162, 164, 165* , 166, 171, 172, 174. out scaled : \underline{165*} , 166, 171, 173. out size: \underline{160}, 171. output : 2* . p: \underline{85}, \underline{87}, \underline{90}, \underline{150}, \underline{161}. packet length: \underline{77}, 80, 124, 179. packet start : \underline{77}, 80, 124, 179. par ptr : \underline{161}, 173. param: \underline{77}, 103, 173, 174. param enter : \underline{180}. : 103. parameter code: \underline{52}, 55, 57, 103. pending : \underline{146}, 147, 153* . pointer : \underline{81}, 82, 85, 87, 88, 89, 90, 161. pop: \underline{122}, 124, 133. pop code: \underline{52}, 56, 125. post : \underline{122}, 177. pre: \underline{122}, 177. print : \underline{2*} , 33, 136, 137, 140, 142, 144* , 154, 155, 165* . print ln: \underline{2*} , 6* , 33, 85, 137, 139, 140, 142, 144* ,

154, 155, 165* , 181. print octal : \underline{136}, 137, 140, 142, 154, 155. print real : 144* , 165* . push: \underline{122}, 132. push code: \underline{52}, 56, 125. putbyte: 156* , 175* . q: \underline{90}, \underline{161}. r: \underline{69}. read : 34. read BCPL: 95, \underline{97}. read char info: 95, \underline{180}. read four bytes : 95, \underline{96}, 101. read input : \underline{180}, 181. read lig kern: 95, \underline{180}. read ln: 34. read packet : 119, \underline{124}. : 72, 74. : 141. reset : 6* . rewrite: 22* . right ln: \underline{29}, 30, 33, 34, 37. right z : \underline{146}, 151, 153* . right1 : \underline{122}, 130. round : 106, 128, 163, 165* , 179. round message: \underline{144*} . rr : \underline{167}, 169* , 170, 171. select font code: \underline{52}, 56, 125. set char code: \underline{52}, 56, 125. set char 0 : \underline{122}. set indices : \underline{90}, 144* . set rule: \underline{122}, 129. set rule code: \underline{52}, 56, 125. set1 : \underline{122}, 127, 179. seven bit safe flag : \underline{77}, 80, 100, 139. seven bit safe flag code: \underline{52}, 55, 95. seven flag loc: \underline{80}, 162. seven unsafe: \underline{138}, 139, 140, 149, 162. shorten: \underline{88}, 144* . show error context : \underline{33}. simple: \underline{146}, 147, 150, 151, 153* , 154. : 115. skip code: \underline{52}, 55, 110. skip error : \underline{42}, 60, 61, 62, 63, 64, 65, 69, 70,

72, 74, 101. skip to end of item: \underline{40}, 42, 43, 94, 102, 103, 104, 106, 109, 110, 118, 119, 120, 121, 124, 125.

skip to paren: \underline{42}, 93, 100, 112. : 58. : 154. : 99. : 115, 116, 117. : 70. : 117. sort in: \underline{85}, 118, 119, 140, 155. sort ptr : \underline{167}, 169* , 170, 171. : 135. special code: \underline{52}, 56, 125, 134. special hex code: \underline{52}, 56, 125. special start : \underline{124}, 134, 135. stack ptr : \underline{123}, 124, 130, 131, 132, 133. start : \underline{44}, 45, 46, 47, 50, 52, 53. start ptr : \underline{44}, 45, 53. : 114. stop code: \underline{52}, 55, 110. stop flag : \underline{113}, 114, 145, 149. : 97. system dependencies: 2* , 22* , 24, 34, 182. t: \underline{60}, \underline{128}, \underline{150}, \underline{167}. tail : \underline{54}. temp width: \underline{158}, 163. text : 5. tfm file: 2* , \underline{21*} , 22* , 156* . tfm name: \underline{21*} , 22* . : 140. : 98. : 100. : 139. : 99. : 165* . : 93. : 111. : 101. : 103. : 94,

103, 106, 110, 119, 121, 125. : 62, 63, 64. toint : 169* . : 141. true: 30, 34, 41, 50, 73, 95, 100, 106, 116, 117,

128, 140, 149, 150, 159, 168. tt : \underline{147}, 154. t1 : \underline{54}. t10 : \underline{54}. t11 : \underline{54}. t12 : \underline{54}. t13 : \underline{54}. t14 : \underline{54}. t15 : \underline{54}. t16 : \underline{54}. t17 : \underline{54}. t18 : \underline{54}. t19 : \underline{54}. t2 : \underline{54}. t20 : \underline{54}. t3 : \underline{54}. t4 : \underline{54}. t5 : \underline{54}. t6 : \underline{54}. t7 : \underline{54}. t8 : \underline{54}. t9 : \underline{54}. uexit : 6* . : 126. unity : \underline{71}, 72, 80, 98, 106, 128, 163, 165* , 179. : 80. : 155. : 155. : 155. v: \underline{124}. var char code: \underline{52}, 55, 119, 121. vcount : \underline{175*} , 177, 178, 179. vf : 3, 41, \underline{77}, 134, 135, 177, 178, 179. vf file: 2* , \underline{21*} , 22* , 175* .

vf fix : \underline{128}, 129, 130, 131.
vf name: \underline{21*} , 22* .
vf output : \underline{180}, 181.
vf ptr : 41, \underline{77}, 80, 95, 107, 108, 124, 134, 135.
vf size: \underline{3}, 41, 77, 80, 105, 124, 135, 178, 179.
vf store: \underline{41}, 124, 126, 127, 128, 129, 130, 131,

132, 133, 134. virtual title code: \underline{52}, 56, 95. vout : \underline{175*} , 176, 177, 178, 179. vout int : \underline{176}, 178, 179. vpl enter : \underline{180}. vpl file: 2* , \underline{5}, 6* , 34. vpl name: 6* , \underline{21*} . VPtoVF : \underline{2*} . vstack : \underline{123}, 124, 132, 133. : 95. vtitle length: \underline{77}, 80, 95, 177. vtitle start : \underline{77}, 80, 95, 177. : 35. : 35. width: \underline{52}, 81, 84, 85, 118, 119, 140, 144* , 155,

158, 159, 160, 161, 166. write: 2* . write ln: 2* . wstack : \underline{123}, 130. w0 : \underline{122}, 130. w1 : \underline{122}, 130. x: \underline{91}, \underline{124}, \underline{128}, \underline{152*} , \underline{153*} , \underline{176}. x lig cycle: \underline{147}, 153* , 154. xord : \underline{24}, 26, 34, 37, 38, 41, 61. xstack : \underline{123}, 130. xxx1 : \underline{122}, 124, 134. xxx4 : \underline{122}, 135. x0 : \underline{122}, 130. x1 : \underline{122}, 130. y: \underline{150}, \underline{152*} , \underline{153*} . y lig cycle: \underline{147}, 148, 153* , 154. : 60. ystack : \underline{123}, 131. y0 : \underline{122}, 131. y1 : \underline{122}, 131. zero bytes : \underline{67}, 68, 69, 70, 105, 120. zstack : \underline{123}, 131. zz : \underline{150}, 151. z0 : \underline{122}, 131. z1 : \underline{122}, 131.

212  NAMES OF THE SECTIONS  VPtoVF changes for C §183

⟨ Assemble a font selection 126 ⟩ Used in section 125. ⟨ Assemble a horizontal movement 130 ⟩ Used in section 125. ⟨ Assemble a rulesetting instruction 129 ⟩ Used in section 125. ⟨ Assemble a special command 134 ⟩ Used in section 125.

⟨ Assemble a stack pop 133 ⟩ Used in section 125.

⟨ Assemble a stack push 132 ⟩ Used in section 125. ⟨ Assemble a typesetting instruction 127 ⟩ Used in section 125. ⟨ Assemble a vertical movement 131 ⟩ Used in section 125. ⟨ Check for infinite ligature loops 154 ⟩ Used in section 139.

⟨ Check ligature program of c 149 ⟩ Used in sections 139 and 140.

⟨ Check the pieces of exten[c] 141 ⟩ Used in section 140. ⟨ Compute the check sum 163 ⟩ Used in section 162. ⟨ Compute the command parameters y, cc, and zz 151 ⟩ Used in section 150. ⟨ Compute the hash code, cur hash, for cur name 51 ⟩ Used in section 50. ⟨ Compute the ligature/kern program offset 168 ⟩ Used in section 159. ⟨ Compute the twelve subfile sizes 159 ⟩ Used in section 157. ⟨ Constants in the outer block 3 ⟩ Used in section 2*.

⟨ Convert xxx1 command to xxx4 135 ⟩ Used in section 134.

⟨ Correct and check the information 139 ⟩ Used in section 180. ⟨ Declare the vf fix procedure 128 ⟩ Used in section 124.

⟨ Do the output 157 ⟩ Used in section 181. ⟨ Do the output 177 ⟩ Used in section 180.

⟨ Doublecheck the lig/kern commands and the extensible recipes 155 ⟩ Used in section 139. ⟨ Enter all the names and their equivalents, except the parameter names 55 ⟩ Used in section 180.

⟨ Enter all the names 56 ⟩ Used in section 180.

⟨ Enter the parameter names 57 ⟩ Used in section 180. ⟨ Find the minimum lk offset and adjust all remainders 170 ⟩ Used in section 168. ⟨ For all characters g generated by c, make sure that char wd [g] is nonzero, and set seven unsafe if

c < 128 ≤ g 140 ⟩ Used in section 139. ⟨ Globals in the outer block 5, 21*, 24, 27, 29, 31, 36, 44, 46, 47, 52, 67, 75, 77, 82, 86, 89, 91, 113, 123, 138, 143, 147,

158, 161, 167, 175* ⟩ Used in section 2*.

⟨ Initialize a new local font 105 ⟩ Used in section 104. ⟨ Insert all labels into label table 169* ⟩ Used in section 168. ⟨ Local variables for initialization 25, 48, 79, 83 ⟩ Used in section 2*. ⟨ Make sure that c is not the largest element of a charlist cycle 142 ⟩ Used in section 139. ⟨ Make sure the ligature/kerning program ends appropriately 145 ⟩ Used in section 139. ⟨ Multiply by 10, add cur char − , and get next 74 ⟩ Used in section 72. ⟨ Multiply by r, add cur char − , and get next 70 ⟩ Used in section 69. ⟨ Output a local font definition 178 ⟩ Used in section 177. ⟨ Output a packet for character c 179 ⟩ Used in section 177. ⟨ Output the character info 164 ⟩ Used in section 157. ⟨ Output the dimensions themselves 166 ⟩ Used in section 157. ⟨ Output the extensible character recipes 172 ⟩ Used in section 157. ⟨ Output the header block 162 ⟩ Used in section 157. ⟨ Output the ligature/kern program 171 ⟩ Used in section 157. ⟨ Output the parameters 173 ⟩ Used in section 157. ⟨ Output the slant (param[1]) without scaling 174 ⟩ Used in section 173. ⟨ Output the twelve subfile sizes 160 ⟩ Used in section 157. ⟨ Print c in octal notation 137 ⟩ Used in section 118. ⟨ Put the width, height, depth, and italic lists into final form 144* ⟩ Used in section 139. ⟨ Read a character property 119 ⟩ Used in section 118. ⟨ Read a font property value 94 ⟩ Used in section 92.

§183  VPtoVF changes for C  NAMES OF THE SECTIONS 213

⟨ Read a kerning step 117 ⟩ Used in section 110. ⟨ Read a label step 112 ⟩ Used in section 110. ⟨ Read a ligature step 116 ⟩ Used in section 110.

⟨ Read a ligature/kern command 110 ⟩ Used in section 109. ⟨ Read a local font area 108 ⟩ Used in section 106. ⟨ Read a local font list 104 ⟩ Used in section 95. ⟨ Read a local font name 107 ⟩ Used in section 106. ⟨ Read a local font property 106 ⟩ Used in section 104. ⟨ Read a parameter value 103 ⟩ Used in section 102.

⟨ Read a skip step 115 ⟩ Used in section 110. ⟨ Read a stop step 114 ⟩ Used in section 110. ⟨ Read all the input 92 ⟩ Used in section 180.

⟨ Read an extensible piece 121 ⟩ Used in section 120. ⟨ Read an extensible recipe for c 120 ⟩ Used in section 119. ⟨ Read an indexed header word 101 ⟩ Used in section 95. ⟨ Read and assemble a list of commands 125 ⟩ Used in section 124. ⟨ Read character info list 118 ⟩ Used in section 180. ⟨ Read font parameter list 102 ⟩ Used in section 95. ⟨ Read ligature/kern list 109 ⟩ Used in section 180. ⟨ Read the design size 98 ⟩ Used in section 95. ⟨ Read the design units 99 ⟩ Used in section 95. ⟨ Read the font property value specified by cur code 95 ⟩ Used in section 94. ⟨ Read the seven-bit-safe flag 100 ⟩ Used in section 95.

⟨ Scan a face code 65 ⟩ Used in section 60.

⟨ Scan a small decimal number 62 ⟩ Used in section 60. ⟨ Scan a small hexadecimal number 64 ⟩ Used in section 60. ⟨ Scan a small octal number 63 ⟩ Used in section 60. ⟨ Scan an ASCII character code 61 ⟩ Used in section 60. ⟨ Scan the blanks and/or signs after the type code 73 ⟩ Used in section 72. ⟨ Scan the fraction part and put it in acc 76 ⟩ Used in section 72.

⟨ Set initial values 6*, 22*, 26, 28, 30, 32, 45, 49, 68, 80, 84, 148 ⟩ Used in section 2*.

⟨ Set loc to the number of leading blanks in the buffer, and check the indentation 35 ⟩ Used in section 34.

⟨ Types in the outer block 23, 66, 71, 78, 81 ⟩ Used in section 2*.

The VPtoVF processor

(Version 1.2, September 1990)

Section Page

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 202 Property list description of font metric data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 203 Basic input routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 204 Basic scanning routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 204 Scanning property names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 204 Scanning numeric data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 204 Storing the property values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 204 The input phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 204 Assembling the mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 204 The checking and massaging phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 204 The TFM output phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 205 The VF output phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 206 The main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 207 System-dependent changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 207 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 207

The preparation of this program was supported in part by the National Science Foundation and by the System Development Foundation. ‘TEX’ is a trademark of the American Mathematical Society.