| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
AFM2TFM(1) (9 August 1990) AFM2TFM(1) |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
NAME |
| 9 |
afm2tfm - convert Adobe font metrics to TeX font metrics |
| 10 |
|
| 11 |
SYNOPSIS |
| 12 |
afm2tfm foo1[.afm] [ -e ratio ] [ -s slant ] [ -t foo2[.tfm] |
| 13 |
] [ -v bar[.vpl] | -V bar[.vpl] ] [ foo3[.tfm] ] |
| 14 |
|
| 15 |
DESCRIPTION |
| 16 |
PostScript fonts are (or should be) accompanied by font metric |
| 17 |
files such as Times-Roman.afm, which describes the |
| 18 |
characteristics of the font called Times-Roman. To use such |
| 19 |
fonts with TeX, we need TFM files that contain similar |
| 20 |
information. The command |
| 21 |
|
| 22 |
afm2tfm Times-Roman.afm Times-Roman.tfm |
| 23 |
|
| 24 |
(which can be reduced to simply |
| 25 |
|
| 26 |
afm2tfm Times-Roman |
| 27 |
|
| 28 |
by taking default shortcuts) will create the necessary file |
| 29 |
Times-Roman.tfm, which can then be moved to the directory where |
| 30 |
TeX normally looks for font metric information. The PostScript |
| 31 |
conversion program dvips will also treat Times-Roman as a |
| 32 |
resident PostScript font if you include the line |
| 33 |
|
| 34 |
Times-Roman |
| 35 |
|
| 36 |
in the file psfonts.map. |
| 37 |
|
| 38 |
The file names used in this manual page are not consistent with |
| 39 |
the new font naming scheme implemented by Karl Berry; please |
| 40 |
refer to the main dvips.tex documentation for the correct names |
| 41 |
to use. |
| 42 |
|
| 43 |
PostScript fonts have a different encoding scheme from that of |
| 44 |
plain TeX. Although both schemes are based on ASCII, special |
| 45 |
characters such as ligatures and accents are handled quite |
| 46 |
differently. Therefore we obtain best results by using a |
| 47 |
"virtual font" interface, which makes TeX act as if the |
| 48 |
PostScript font had a standard TeX encoding. Such a virtual |
| 49 |
font can be obtained, for example, by the command |
| 50 |
|
| 51 |
afm2tfm Times-Roman -v times |
| 52 |
|
| 53 |
or, more fully, by: |
| 54 |
|
| 55 |
afm2tfm Times-Roman.afm -v times.vpl Times-Roman.tfm |
| 56 |
|
| 57 |
This produces two outputs, namely the "virtual property list" |
| 58 |
file times.vpl and the TeX font metric file Times-Roman.tfm. |
| 59 |
The latter file describes an "actual font" on |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
Page 1 (printed 2/26/92) |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
AFM2TFM(1) (9 August 1990) AFM2TFM(1) |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
which the virtual font is based. |
| 75 |
|
| 76 |
If you wish to specify a different TFM file name than the |
| 77 |
default, you can use the -t option; this will override any |
| 78 |
default TFM file name that would be calculated from the input |
| 79 |
file name. |
| 80 |
|
| 81 |
To use the font in TeX, you should first run |
| 82 |
|
| 83 |
vptovf times.vpl times.vf times.tfm |
| 84 |
|
| 85 |
then install the file times.vf in the directory for virtual |
| 86 |
fonts and install times.tfm in the directory for TeX font |
| 87 |
metrics. (You can also make more complex virtual fonts by |
| 88 |
editing times.vpl first.) Once this has been done, you're all |
| 89 |
set. You can use code like this in TeX henceforth: |
| 90 |
|
| 91 |
\font\myfont=times at 10pt |
| 92 |
\myfont |
| 93 |
Hello, I am being typeset in Times-Roman. |
| 94 |
|
| 95 |
|
| 96 |
Note that there are two fonts, one actual (`Times-Roman', which |
| 97 |
is analogous to a raw piece of hardware) and one virtual |
| 98 |
(`times', which has typesetting knowhow added). You could also |
| 99 |
say `\font\TR=Times-Roman at 10pt' and typeset directly with |
| 100 |
that, but then you would have no ligatures or kerning, and you |
| 101 |
would have to use Adobe character positions for special letters |
| 102 |
like \ae. The virtual font called times not only has ligatures |
| 103 |
and kerning, and most of the standard accent conventions of |
| 104 |
TeX, it also has a few additional features not present in the |
| 105 |
Computer Modern fonts. For example, it includes all the Adobe |
| 106 |
characters (such as the Polish ogonek and the French |
| 107 |
guillemots). It also allows you to type 58 accented letters |
| 108 |
from `Aacute' to `zcaron' as if they were ligatures --- namely |
| 109 |
as `acute' followed by `A', etc., where you can get `acute' |
| 110 |
(\char 19) by defining a suitable control sequence. (The 58 |
| 111 |
constructed characters are found in the AFM file, and |
| 112 |
constructed as specified by Adobe; you may wish to adjust the |
| 113 |
spacing and/or add additional accent combinations by editing |
| 114 |
the VPL file.) The only things you lose from ordinary TeX text |
| 115 |
fonts are the dotless j (which can be hacked into the VPL file |
| 116 |
with literal PostScript specials if you have the patience) and |
| 117 |
uppercase Greek letters (which just don't exist unless you buy |
| 118 |
them separately). |
| 119 |
|
| 120 |
These fonts can be scaled to any size. Go wild! Note however, |
| 121 |
that using PostScript fonts does use up the printer's virtual |
| 122 |
memory and it does take time. You may find downloading the |
| 123 |
Computer Modern fonts to be faster than using the built-in |
| 124 |
PostScript fonts! |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
Page 2 (printed 2/26/92) |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
AFM2TFM(1) (9 August 1990) AFM2TFM(1) |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
OPTIONS |
| 140 |
Special effects are also obtainable, with commands such as |
| 141 |
|
| 142 |
afm2tfm Times-Roman -s .167 -v timessl Times-Slanted |
| 143 |
|
| 144 |
which create timessl.vpl and Times-Slanted.tfm. To use this, |
| 145 |
proceed as above but put the line |
| 146 |
|
| 147 |
Times-Slanted "/Times-Roman .167 SlantFont" |
| 148 |
|
| 149 |
into psfonts.map. Then Times-Slanted will act as if it were a |
| 150 |
resident font, although it is actually constructed from |
| 151 |
Times-Roman by PostScript hackery. (It's an oblique version of |
| 152 |
Times-Roman, obtained by slanting everything 1/6 to the right.) |
| 153 |
Similarly, you can get an extended font by |
| 154 |
|
| 155 |
afm2tfm Times-Extended -e 1.2 -v timesx Times-Extended |
| 156 |
|
| 157 |
and by recording the pseudo-resident font |
| 158 |
|
| 159 |
Times-Extended "/Times-Roman 1.2 ExtendFont" |
| 160 |
|
| 161 |
The command line switches are: |
| 162 |
|
| 163 |
-e ratio |
| 164 |
All characters are stretched horizontally by the stated |
| 165 |
ratio; if it is less than 1.0, you get a condensed font. |
| 166 |
|
| 167 |
-s slant |
| 168 |
All characters are slanted to the right by the stated |
| 169 |
slant; if it is negative, the letters slope to the left |
| 170 |
(or they might be upright if you start with an italic |
| 171 |
font). |
| 172 |
|
| 173 |
-v file[.vpl] |
| 174 |
Generate a virtual property list (VPL) file as well as a |
| 175 |
TFM file. |
| 176 |
|
| 177 |
-V file[.vpl] |
| 178 |
Same as -v, but the virtual font generated is a caps |
| 179 |
and-small-caps font obtained by scaling uppercase letters |
| 180 |
by .8 to typeset lowercase. This font handles accented |
| 181 |
letters and retains proper kerning. |
| 182 |
|
| 183 |
|
| 184 |
NON-RESIDENT POSTSCRIPT FONTS |
| 185 |
If you want to use a non-printer-resident PostScript font for |
| 186 |
which you have a .pfb file (an Adobe Type 1 font program), you |
| 187 |
can make it act like a resident font by putting a `<' sign and |
| 188 |
the name of the .pfb file just after the font name in the |
| 189 |
psfonts.map file entry. For example, |
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
Page 3 (printed 2/26/92) |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
AFM2TFM(1) (9 August 1990) AFM2TFM(1) |
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
StoneInformal <StoneInformal.pfb |
| 205 |
|
| 206 |
will cause dvips to include StoneInformal.pfb in your document |
| 207 |
as if it were a header file, whenever the pseudo-resident font |
| 208 |
StoneInformal is used in a document. Similarly, you can |
| 209 |
generate transformed fonts and include lines like |
| 210 |
|
| 211 |
StoneInformal-Condensed <StoneInformal.pfb "/StoneInformal .8 ExtendF |
| 212 |
|
| 213 |
in psfonts.map, in which case StoneInformal.pfb will be loaded |
| 214 |
whenever StoneInformal-Condensed is used. (Each header file is |
| 215 |
loaded at most once per document. The .pfb files should be |
| 216 |
installed in the config directory with the other header files.) |
| 217 |
|
| 218 |
|
| 219 |
FONT ALIASES |
| 220 |
Some systems don't handle files with long names well---MSDOS |
| 221 |
and TWENEX are two notable examples. For this reason, dvips |
| 222 |
will accept an alias for such fonts. Such an alias shoul be |
| 223 |
the first word on the psfonts.map line. For instance, if we |
| 224 |
wanted the name ptmr to be used for Times-Roman since our |
| 225 |
computer can't handle long names, we would use the following |
| 226 |
line in our psfonts.map file: |
| 227 |
|
| 228 |
ptmr Times-Roman |
| 229 |
|
| 230 |
The TFM file must have the name ptmr.tfm. |
| 231 |
|
| 232 |
The parsing of the psfonts.map file should be explained to |
| 233 |
eliminate all confusion. Each line is separated into words, |
| 234 |
where words are separated by spaces or tabs. If a word begins |
| 235 |
with a double quote, however, it extends until the next double |
| 236 |
quote or the end of the line. If a word starts with a less |
| 237 |
than character, it is treated as a font head file (or |
| 238 |
downloaded PostScript font). If a word starts with a double |
| 239 |
quote, it is special instructions on how to generate that font. |
| 240 |
Otherwise it is a name. The first such name is always the name |
| 241 |
TeX uses for the font and is also the name of the TFM file. If |
| 242 |
there is another name word, that name is used as the PostScript |
| 243 |
name; if there is only one name word, it is used for both the |
| 244 |
TeX name and the PostScript name. |
| 245 |
|
| 246 |
Note that the aliases also register the full PostScript name, |
| 247 |
so the single line |
| 248 |
|
| 249 |
ptmr Times-Roman |
| 250 |
|
| 251 |
would allow dvips to `find' the ptmr font as well as the |
| 252 |
Times-Roman font. |
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
Page 4 (printed 2/26/92) |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
AFM2TFM(1) (9 August 1990) AFM2TFM(1) |
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
Incidentally, many font files (e.g., in the Adobe Type Library) |
| 268 |
include more characters internally than you can access directly |
| 269 |
without making a few changes. These characters typically have |
| 270 |
code -1 in the afm file and no corresponding "constructed |
| 271 |
character" (CC) specification. For example, in Adobe Garamond |
| 272 |
there are Eth and eth, Thorn and thorn, plus things like |
| 273 |
copyright and onehalf, plus 58 accented letters Aacute thru |
| 274 |
zcaron (with accents over caps much better looking than you can |
| 275 |
get from constructed accents). To use these characters, give |
| 276 |
them character codes between 0 and 255 in the afm file, and |
| 277 |
build the corresponding EncodingVector (instead of |
| 278 |
StandardEncoding) in the pfb file. Then afm2tfm will generate |
| 279 |
a vpl file that includes accented characters as ligatures, as |
| 280 |
explained above; for example, `Aacute' will be accessible as |
| 281 |
`acute' followed by `A' (as well as by its character code in |
| 282 |
the virtual font). |
| 283 |
|
| 284 |
FILES |
| 285 |
psfonts.map in the config directory used by dvips (update |
| 286 |
this). ../afm/Makefile in the dvips sources (look at this for |
| 287 |
examples). |
| 288 |
|
| 289 |
SEE ALSO |
| 290 |
dvips(1), tex(1), vptovf(1) |
| 291 |
|
| 292 |
BUGS |
| 293 |
An option to add letterspacing to the virtual font was rejected |
| 294 |
by Knuth because it would make the fi and f ligatures break the |
| 295 |
normal rhythmic pattern. |
| 296 |
|
| 297 |
AUTHORS |
| 298 |
Tomas Rokicki <[email protected]> and Don Knuth |
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
Page 5 (printed 2/26/92) |
| 321 |
|
| 322 |
|
| 323 |
|