#### Reencoding with Afm2tfm

The Afm2tfm program creates the TFM and VF files for the virtual font corresponding to a PostScript font by reencoding the PostScript font. Afm2tfm generates these files from two encodings: one for TeX and one for PostScript. The TeX encoding is used to map character numbers to character names while the PostScript encoding is used to map each character name to a possibly different number. In combination, you can get access to any character of a PostScript font at any position for TeX typesetting.

In the default case, when you specify none of the -t, -p, or -T options, Afm2tfm uses a default TeX encoding (which mostly corresponds to the Computer Modern text fonts) and the PostScript encoding found in the AFM file being read. The reencoding is also sometimes called a remapping.

For example, the default encodings reencode the acute accent in two steps: first the default TeX encoding maps the number 19 to the character name acute'; then the default PostScript encoding, as found in the AFM file for an ordinary PostScript font, maps the character name acute' to the number 194. (The PostScript encoding works in reverse, by looking in the encoding vector for the name and then yielding the corresponding number.) The combined mapping of 19 to 194 shows up explicitly in the VF file and also implicitly in the fact that the properties of PostScript character 194 appear in position 19 of the TFM file for the virtual font.

The default encoding of the distributed fonts (e.g., ptmr.tfm') mostly follows plain TeX conventions for accents. The exceptions: the Hungarian umlaut (which is at position 0x7D in cmr10', but position 0xCD in ptmr'); the dot accent (at positions 0x5F and 0xC7, respectively); and the Scandinavian A ring \AA, whose definition needs different tweaking. In order to use these accents with PostScript fonts or in math mode when \textfont0 is a PostScript font, you will need to use the following definitions. These definitions will not work with the Computer Modern fonts for the relevant accents. They are already part of the distributed psfonts.sty' for use with LaTeX.

\def\H#1{{\accent"CD #1}}
\def\.#1{{\accent"C7 #1}}
\def\dot{\mathaccent"70C7 }
\hbox to \wd0{\hss\char'27\hss}}A}


As a kind of summary, here are the CODINGSCHEME's that result from the various possible choices for reencoding.

default encoding
(CODINGSCHEME TeX text + AdobeStandardEncoding)

-p dc.enc'
(CODINGSCHEME TeX text + DCEncoding)

-t dc.enc'
(CODINGSCHEME DCEncoding + AdobeStandardEncoding)

-T dc.enc'
(CODINGSCHEME DCEncoding + DCEncoding)


The `CODINGSCHEME' line appears in the VPL file but is ignored by Dvips.