Debian Codegraph @

texmf-dist/doc/fonts/accfonts/README

raw
1
2
3 Mkt1font, vpl2vpl and vpl2ovp: programs to generate accented fonts
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
6 John D. Smith
7 ~~~~~~~~~~~~~
8
9
10 These three programs, all made available under the GNU General Public
11 License, address the same requirement using the same basic algorithms:
12 their aim is to make it easy to create versions of existing fonts
13 containing whatever accented characters the user may need, arranged
14 according to whatever encoding he/she may favour. Mkt1font does this
15 by reading in the two files that define a Type 1 PostScript font and
16 writing out new versions of them; vpl2vpl does it by reading in the
17 file that defines a TeX virtual font and writing out a new version of
18 it; vpl2ovp does the same as vpl2vpl, but its output is a 16-bit
19 virtual font suitable for Omega, the Unicode-aware development from
20 TeX. In each case information about what accented characters are
21 required and where they should be located is supplied by means of a
22 simple definition file, which has the same format for both programs.
23
24 Note that most Type 1 PostScript fonts are commercial products
25 subject to both copyright and licensing restrictions. If the license
26 for such a font forbids reverse-engineering it, it is presumably
27 illegal to run mkt1font on it; in any case it would certainly be a
28 serious breach of copyright to make modified versions of the font
29 available to third parties. The author of mkt1font will not be held
30 responsible for any such misuses of the software. (No such legal
31 problems surround the use of TeX virtual fonts, which merely specify
32 new ways to use existing fonts.) However, would-be users may wish to
33 note the existence of a body of high-quality freeware lookalikes for
34 many of the standard Type 1 fonts: like mkt1font and vpl2vpl, the
35 Ghostscript fonts developed by URW++ Design and Development
36 Incorporated are made available under the GNU General Public License
37 (see the file COPYING), which permits them to be modified and
38 redistributed provided that certain simple decencies are observed.
39 These fonts are available from many ftp sites, including those
40 forming the Comprehensive TeX Archive Network (CTAN), for example
41 ftp.tex.ac.uk: look for the most recent font archive file in the
42 directory /tex-archive/support/ghostscript/gnu/fonts.
43
44 A detailed specification of the form of the definition file used by
45 mkt1font and vpl2vpl is given below in the instructions for using the
46 programs, but it may be helpful to give a quick idea of its contents
47 here. Each line of the file contains something similar to "128 x
48 acute", which is an instruction to create a new character formed from
49 "x" with an acute accent and located at position 128 in the character
50 set. Once a new character has been defined in this way, it "exists" in
51 just the same way as any other character, under the name "xacute" (or
52 whatever); thus it can even receive further accents. The two lines
53
54 129 e macron
55 130 emacron breve
56
57 will create a "long e" and a "long-or-short e" at the positions
58 specified. (If only the latter is desired, they can both be assigned
59 the same position in the encoding -- the second will overwrite the
60 first.) Subscript as well as superscript accents are available. Some
61 sample definition files are included to give an idea of the format:
62 note that two of these (CSX.def and Norman.def), used for Indian
63 language material in Roman script, contain the triple-accented
64 character "runderdotmacron acute"!
65
66 In addition to accented characters proper, both programs can produce
67 digraphs -- single characters composed of pairs of other characters.
68 In itself this may seem to be of limited use, since the digraph
69 should always be indistinguishable from its two constituent
70 characters printed consecutively. However, some Unicode-style
71 encodings require that certain character-pairs be treated as
72 digraphs. In addition, use of a digraph in subsequent definitions
73 allows an accent to be applied to two characters as a pair: so, for
74 example,
75
76 131 k h
77 131 kh underbar
78
79 will produce a character consisting of an underlined "kh" at
80 position 131.
81
82 The algorithms used in both programs take great care to secure the
83 most attractive results, placing accents centrally over/under their
84 characters at appropriate heights/depths, varying their position
85 according to the angle of slant in Italic and similar fonts,
86 providing new characters with kerning information (which will be
87 resolutely ignored by most word-processors), and -- in the case of
88 mkt1font -- giving hinting instructions to improve output on
89 low-resolution printers. However, users may feel that some
90 characters need "tweaking". This tends to happen when the part of
91 the character adjacent to the accent is highly asymmetrical:
92 subscript accents below "r" may need moving to the left, while
93 superscript accents above "d" may need moving to the right. It is
94 relatively easy to modify the output of vpl2vpl to make such
95 improvements by hand (vpl files are designed to be easy for humans
96 to read, and vpl2vpl identifies each character with a comment). Type
97 1 fonts are another matter; mkt1font generates a human-readable and
98 commented ".dis" file as well as the ".pfb" font file, and it is
99 possible to make changes to this and rebuild the pfb file with t1asm
100 (see below), but this is not quite as simple as modifying a TeX
101 virtual font.
102
103 For details on how vpl2ovp handles access to accented characters by
104 means of a system of ligatures, see further the CHANGES file.
105
106 The programs are written in Perl, and have not been tested on
107 systems other than Unix. (Apart from the #! line at the top, the
108 only Unix specificities the author is aware of are two references to
109 "/dev/null" in mkt1font and the general assumption that filenames
110 can be of any length.) At run time, mkt1font invokes two further
111 font utilities, t1asm and t1disasm, written by I. Lee Hetherington
112 and available from CTAN ftp sites: look in the directory
113 /tex-archive/fonts/utilities/t1utils.
114
115 Detailed instructions for using the programs follow. In each case
116 these instructions can also be seen by typing the name of the program
117 with a "-h" option.
118
119
120 Mkt1font
121 ~~~~~~~~
122 Syntax: mkt1font -n fontname -d definition-file -a afm-file -f font-file
123 [-s shrink-factor] [-c candrabindu-adjustment] [-b]
124
125 Mkt1font creates new Type 1 PostScript fonts based on existing fonts
126 ("input fonts"). In order to do this it makes use of I. Lee
127 Hetherington's programs t1asm and t1disasm, which must be present on
128 the system. A successful run will generate an AFM file and a PFB
129 file, as well as a DIS file containing a disassembled version of the
130 PFB file (including useful comments). Four options must be specified
131 on the command line, as follows:
132
133 -n should name the font it is intended to generate. Avoid names
134 such as "myfont", as both mkt1font and other programs attempt
135 to draw conclusions from the name; better would be something
136 like "Utopia_French-BoldItalic". The generated font files
137 will also use this for their basename.
138
139 -d should refer to a font definition file. This file (which could
140 usefully be named, e.g., "French.def") should consist of
141 lines of character definitions, in the form
142 "number" "character"
143 or
144 "number" "character" "accent"
145 Here "number" represents the character's position in the new
146 encoding and may be expressed in decimal, octal or hex;
147 "character" names the character (e.g. "comma", "eight",
148 "A") or consists of the word ".notdef" (indicating that
149 the specified number's "slot" in the new encoding is to be
150 empty); and "accent" optionally names an accent to be placed
151 on the character. In addition to the standard accents available
152 in PostScript fonts, "underbar" and "underdot" are also
153 available, as are "under" versions of all the normal
154 superscript accents ("underdieresis", "underring", etc.).
155 The Indian accent "candrabindu" may also be specified: it
156 is formed by overprinting a breve with a dotaccent. Finally,
157 "overdot" may be used as a synonym for "dotaccent".
158
159 If the character named in the "accent" position is not in fact
160 a valid accent character, the program interprets the definition
161 as a request for a digraph formed from the "character" and the
162 "accent". A digraph consisting of, say, "k" and "h" will be
163 indistinguishable from the letters "k" and "h" printed
164 consecutively, but the digraph "kh" can itself receive accents
165 like any other character: see next paragraph.
166
167 A new character (such as "amacron" or "kh") may be freely
168 used in the "character" position of a further definition (such
169 as "amacron breve" or "kh underbar"). There is no constraint
170 on the ordering of definitions within a definition file. The
171 definition of "a macron" does not have to precede that of
172 "amacron breve": requests for "impossible" characters are
173 deferred until their constituents have had a chance to come into
174 being.
175
176 "Slots" for which no new definition is given retain the
177 definition they have in the input font.
178
179 The definition file may also contain blank lines and comments
180 (introduced by "#").
181
182 -a should refer to the AFM (Adobe Font Metrics) file for the input
183 font.
184
185 -f should refer to the binary font file (PFB) for the input font.
186 (In fact the equivalent ASCII file (PFA) is also acceptable for
187 input, but the output font is always in PFB format.)
188
189 -s may optionally give the factor, expressed as a per-thousand
190 value, by which normally superscript accents (such as dieresis,
191 ring) should be shrunk when they are used as subscript accents
192 (such as underdieresis, underring). Values of around 800 may be
193 found useful.
194
195 -c may optionally give two comma-separated numerical values to
196 adjust the x and y coordinates of the dotaccent placed within a
197 breve to form the candrabindu accent.
198
199 -b may optionally be specified to block the use of predefined
200 accented characters, forcing mkt1font to define its own
201 versions. This may be useful to secure a consistent appearance
202 in cases where a font designer does not share mkt1font's views
203 on where accents should be placed.
204
205 The -h option prints this help.
206
207
208 Vpl2vpl
209 ~~~~~~~
210 Syntax: vpl2vpl -d definition-file [-s shrink-factor]
211 [-c candrabindu-adjustment] [-b] vpl-file
212
213 Vpl2vpl creates new TeX virtual fonts based on existing fonts or
214 virtual fonts ("input fonts"). A successful run will read a pl
215 (Property List) or vpl (Virtual Property List) file and a definition
216 file, and will generate a new vpl (Virtual Property List) file on
217 standard output. The input font is assumed to adhere to the standard
218 TeX encoding for text fonts unless it was created with either of the
219 programs afm2pl or afm2tfm, in which case it is assumed to conform to
220 (respectively) the Adobe Standard Encoding or the encoding specified
221 in the file dvips.enc. In either case, the name of the input font is
222 assumed to be the name of the input file without its .vpl or .pl
223 extension: it must conform to normal TeX conventions for naming fonts,
224 as vpl2vpl attempts to draw conclusions from it about the kind of font
225 it is dealing with.
226
227 A typical complete sequence of commands to create a new virtual
228 font might therefore be
229 tftopl cmr10.tfm cmr10.pl
230 vpl2vpl -d ISO-Latin1.def cmr10.pl >cmr10_isol1.vpl
231 vptovf cmr10_isol1.vpl cmr10_isol1.vf cmr10_isol1.tfm
232 for a Computer Modern font, or
233 afm2pl Times-Roman.afm rptmr.pl
234 pltotf rptmr.pl rptmr.tfm
235 vpl2vpl -d ISO-Latin1.def rptmr.pl >ptmr-isol1.vpl
236 vptovf ptmr-isol1.vpl ptmr-isol1.vf ptmr-isol1.tfm
237 for a PostScript font.
238
239 Another approach for a PostScript font is to use afm2tfm:
240 afm2tfm Times-Roman.afm -t dvips.enc -v ptmr rptmr
241 vpl2vpl -d ISO-Latin1.def ptmr.vpl >ptmr-isol1.vpl
242 vptovf ptmr-isol1.vpl ptmr-isol1.vf ptmr-isol1.tfm
243 -- but this is now deprecated, as afm2tfm generates incorrect
244 values for the heights of some characters, and this can lead to
245 bad accent placing.
246
247 In order to keep the whole upper half of the character set free for
248 the requirements of the encoding specified in the definition file,
249 certain modifications are made to input fonts following the
250 dvips.enc encoding to bring them into greater conformity with the
251 TeX norm. In particular, the characters dotaccent and hungarumlaut
252 are placed in the positions assigned by TeX ("5F, "7D), not those
253 enforced by dvips.enc ("C7, "CD). The f-ligatures, double quotes
254 and dashes are also moved from the upper half of the character set
255 to their normal TeX positions. As a result, the following characters
256 are not found in the lower half of the character set: quotesingle,
257 quotedbl, backslash, underscore, braceleft, bar, braceright. These
258 characters can, however, be assigned positions in the output font if
259 they are needed. (Indeed, they could all be explicitly restored to
260 their dvips.enc positions if this were desired.)
261
262 Options:
263
264 -d should refer to a font definition file. This file (which could
265 usefully be named, e.g., "French.def") should consist of
266 lines of character definitions, in the form
267 "number" "character"
268 or
269 "number" "character" "accent"
270 Here "number" represents the character's position in the new
271 encoding and may be expressed in decimal, octal or hex;
272 "character" names the character (e.g. "comma", "eight",
273 "A") or consists of the word ".notdef" (indicating that
274 the specified number's "slot" in the new encoding is to be
275 empty); and "accent" optionally names an accent to be placed
276 on the character. In addition to the standard accents available
277 in PostScript fonts, "underbar" and "underdot" are also
278 available, as are "under" versions of all the normal
279 superscript accents ("underdieresis", "underring", etc.).
280 The Indian accent "candrabindu" may also be specified: it
281 is formed by overprinting a breve with a dotaccent. Finally,
282 "overdot" may be used as a synonym for "dotaccent".
283
284 If the character named in the "accent" position is not in fact
285 a valid accent character, the program interprets the definition
286 as a request for a digraph formed from the "character" and the
287 "accent". A digraph consisting of, say, "k" and "h" will be
288 indistinguishable from the letters "k" and "h" printed
289 consecutively, but the digraph "kh" can itself receive accents
290 like any other character: see next paragraph.
291
292 A new character (such as "amacron" or "kh") may be freely
293 used in the "character" position of a further definition (such
294 as "amacron breve" or "kh underbar"). There is no constraint
295 on the ordering of definitions within a definition file. The
296 definition of "a macron" does not have to precede that of
297 "amacron breve": requests for "impossible" characters are
298 deferred until their constituents have had a chance to come into
299 being.
300
301 "Slots" for which no new definition is given retain the
302 definition they have in the input font.
303
304 The definition file may also contain blank lines and comments
305 (introduced by "#").
306
307 -s may optionally give the factor, expressed as a per-thousand
308 value, by which normally superscript accents (such as dieresis,
309 ring) should be shrunk when they are used as subscript accents
310 (such as underdieresis, underring). Values of around 800 may be
311 found useful.
312
313 -c may optionally give two comma-separated numerical values to
314 adjust the x and y coordinates of the dotaccent placed within a
315 breve to form the candrabindu accent. A coordinate scheme using
316 "DESIGNUNITS R 1000" is assumed.
317
318 -b may optionally be specified to block the use of predefined
319 accented characters, forcing vpl2vpl to define its own
320 versions. This may be useful to secure a consistent appearance
321 in cases where a font designer does not share vpl2vpl's views
322 on where accents should be placed.
323
324 -h prints this help.
325
326
327 Vpl2ovp
328 ~~~~~~~
329
330 Syntax: vpl2ovp -d definition-file [-s shrink-factor]
331 [-c candrabindu-adjustment] [-b] vpl-file
332
333 Vpl2ovp creates new Omega virtual fonts based on existing TeX
334 fonts or virtual fonts ("input fonts"). A successful run will
335 read a pl (Property List) or vpl (Virtual Property List) file
336 and a definition file, and will generate a new ovp (Omega
337 Virtual Property List) file on standard output. The input font
338 is assumed to adhere to the standard TeX encoding for text
339 fonts unless it was created with either of the programs afm2pl
340 or afm2tfm, in which case it is assumed to conform to
341 (respectively) the Adobe Standard Encoding or the encoding
342 specified in the file dvips.enc. In either case, the name of
343 the input font is assumed to be the name of the input file
344 without its .vpl or .pl extension: it must conform to normal
345 TeX conventions for naming fonts, as vpl2ovp attempts to draw
346 conclusions from it about the kind of font it is dealing with.
347
348 A typical complete sequence of commands to create a new virtual
349 font might therefore be
350 tftopl cmr10.tfm cmr10.pl
351 vpl2ovp -d Unicode1.def cmr10.pl >cmr10-uni1.ovp
352 ovp2ovf cmr10-uni1.ovp cmr10-uni1.ovf cmr10-uni1.ofm
353 for a Computer Modern font, or
354 afm2pl Times-Roman.afm rptmr.pl
355 pltotf rptmr.pl rptmr.tfm
356 vpl2ovp -d Unicode1.def rptmr.pl >ptmr-uni1.ovp
357 ovp2ovf ptmr-uni1.ovp ptmr-uni1.ovf ptmr-uni1.ofm
358 for a PostScript font.
359
360 Another approach for a PostScript font is to use afm2tfm:
361 afm2tfm Times-Roman.afm -t dvips.enc -v ptmr rptmr
362 vpl2ovp -d Unicode1.def ptmr.vpl >ptmr-uni1.ovp
363 ovp2ovf ptmr-uni1.ovp ptmr-uni1.ovf ptmr-uni1.ofm
364 -- but this is now deprecated, as afm2tfm generates incorrect
365 values for the heights of some characters, and this can lead to
366 bad accent placing.
367
368 In order to keep the whole of the character range "F0-"FF free for
369 the requirements of the encoding specified in the definition file,
370 certain modifications are made to input fonts following the dvips.enc
371 encoding to bring them into greater conformity with the TeX norm. In
372 particular, the characters dotaccent and hungarumlaut are placed in
373 the positions assigned by TeX ("5F, "7D), not those enforced by
374 dvips.enc ("C7, "CD). The f-ligatures, double quotes and dashes are
375 also moved from the upper half of the original 8-bit character set to
376 their normal TeX positions. As a result, the following characters are
377 not found in the lower half of the character set: quotesingle,
378 quotedbl, backslash, underscore, braceleft, bar, braceright. These
379 characters can, however, be assigned positions in the output font if
380 they are needed. (Indeed, they could all be explicitly restored to
381 their dvips.enc positions if this were desired.)
382
383 Options:
384
385 -d should refer to a font definition file. This file (which could
386 usefully be named, e.g., "Unicode1.def") should consist of
387 lines of character definitions, in the form
388 "number" "character"
389 or
390 "number" "character" "accent"
391 Here "number" represents the character's position in the new
392 encoding and may be expressed in decimal, octal or hex;
393 "character" names the character (e.g. "comma", "eight",
394 "A") or consists of the word ".notdef" (indicating that
395 the specified number's "slot" in the new encoding is to be
396 empty); and "accent" optionally names an accent to be placed
397 on the character. In addition to the standard accents available
398 in PostScript fonts, "underbar" and "underdot" are also
399 available, as are "under" versions of all the normal
400 superscript accents ("underdieresis", "underring", etc.).
401 The Indian accent "candrabindu" may also be specified: it
402 is formed by overprinting a breve with a dotaccent. Finally,
403 "overdot" may be used as a synonym for "dotaccent".
404
405 Note that all accents used in defining accented characters must
406 themselves be defined in the .def file. Those which exist in the
407 source font should simply be referenced by name in their
408 appropriate Unicode position (e.g. "0x0304 macron"); those
409 which do not should be defined as the character "space"
410 followed by the name of the accent (e.g. "0x0310 space
411 candrabindu").
412
413 If the character named in the "accent" position is not in fact
414 a valid accent character, the program interprets the definition
415 as a request for a digraph formed from the "character" and the
416 "accent". A digraph consisting of, say, "k" and "h" will be
417 indistinguishable from the letters "k" and "h" printed
418 consecutively, but the digraph "kh" can itself receive accents
419 like any other character: see next paragraph.
420
421 A new character (such as "amacron" or "kh") may be freely
422 used in the "character" position of a further definition (such
423 as "amacron breve" or "kh underbar"). There is no constraint
424 on the ordering of definitions within a definition file. The
425 definition of "a macron" does not have to precede that of
426 "amacron breve": requests for "impossible" characters are
427 deferred until their constituents have had a chance to come into
428 being.
429
430 "Slots" for which no new definition is given retain the
431 definition they have in the input font.
432
433 The definition file may also contain blank lines and comments
434 (introduced by "#").
435
436 -s may optionally give the factor, expressed as a per-thousand
437 value, by which normally superscript accents (such as dieresis,
438 ring) should be shrunk when they are used as subscript accents
439 (such as underdieresis, underring). Values of around 800 may be
440 found useful.
441
442 -c may optionally give two comma-separated numerical values to
443 adjust the x and y coordinates of the dotaccent placed within a
444 breve to form the candrabindu accent. A coordinate scheme using
445 "DESIGNUNITS R 1000" is assumed.
446
447 -b may optionally be specified to block the use of predefined
448 accented characters, forcing vpl2ovp to define its own
449 versions. This may be useful to secure a consistent appearance
450 in cases where a font designer does not share vpl2ovp's views
451 on where accents should be placed.
452
453 -h prints this help.
454
455
456 John D. Smith
457 [email protected]
458 http://bombay.indology.info