Go to the first, previous, next, last section, table of contents.

Making a PostScript font available

To make a PostScript font available in a TeX document, you need to install the font on your system and then define it within the document. Once you have installed the font, of course, it is available for any document thereafter and you don't need to reinstall it. You must have an AFM file for any font you install. Unless the font is built into your printer, you must also have a PFA or PFB file.

In the following examples, we use the font `Times-Roman' to illustrate the process. But you should use the prebuilt fonts for Times and the other standard fonts, rather than rebuilding them. The prebuilt fonts are made using a more complicated process than that described here, to make them work as well as possible with TeX. So following the steps in this manual will not generate files identical to the distributed ones. See section PostScript font installation, for pointers to the prebuilt fonts.

Installation of a PostScript font proceeds in three steps. See section Font concepts, for descriptions of the various files involved.

  1. Run afm2tfm to create a TFM file for the original font, and the VPL form of the virtual font:
    afm2tfm Times-Roman -v ptmr rptmr
    
  2. Run vptovf to generate a VF and TFM file for the virtual font from the VPL file:
    vptovf ptmr.vpl ptmr.vf ptmr.tfm
    
  3. Insert an entry for the font in `psfonts.map' (See section `psfonts.map': PostScript font catalog):
    rptmr      Times-Roman                 <ptmr8a.pfa
    
  4. Install the files in the standard locations, as in:
    cp ptmr.vf fontdir/vf/...
    cp *ptmr.tfm fontdir/tfm/...
    cp ptmr.afm fontdir/afm/...
    cp ptmr.pf? fontdir/type1/...
    

The simplest invocation of Afm2tfm to make virtual fonts goes something like this:

afm2tfm Times-Roman -v ptmr rptmr

This reads the file `Times-Roman.afm', and produces two files as output, namely the virtual property list'file `ptmr.vpl', and the "raw" font metric file `rptmr.tfm'. To use the font in TeX, you first run

vptovf ptmr.vpl ptmr.vf ptmr.tfm

You should then install the virtual font file `ptmr.vf' where Dvips will see it and install `ptmr.tfm' and `rptmr.tfm' where TeX and Dvips will see them.

Using these raw fonts is not recommended; there are no raw fonts in the prebuilt PostScript fonts distributed along with Dvips. But nevertheless, that's how Afm2tfm presently operates, so that's what we document here. The `r' prefix convention is likewise historical accident.

You can also make more complex virtual fonts by editing `ptmr.vpl' before running `vptovf'; such editing might add the uppercase Greek characters in the standard TeX positions, for instance. (This has already been done for the prebuilt fonts.)

Once the files have been installed, you're all set. You can now do things like this in TeX:

\font\myfont = ptmr at 12pt
\myfont Hello, I am being typeset in 12-point Times-Roman.

Thus, we have two fonts, one actual (`rptmr', which is analogous to the font in the printer) and one virtual (`ptmr', which has been remapped to the standard TeX encoding (almost)), and has typesetting know-how added. You could also say

\font\raw = rptmr at 10pt

and typeset directly with that, but then you would have no ligatures or kerning, and you would have to use Adobe character positions for special letters like The virtual font `ptmr' not only has ligatures and kerning, and most of the standard accent conventions of TeX, it also has a few additional features not present in the Computer Modern fonts. For example, it includes all the Adobe characters (such as the Polish ogonek and the French guillemots). The only things you lose from ordinary TeX text fonts are the dotless `j' (which can be hacked into the VPL file with literal PostScript specials if you have the patience) and uppercase Greek letters (which just don't exist unless you buy them separately). See section Reencoding with Afm2tfm.

As a final step you need to record information about both the virtual font and the original font (if you ever might want to use it) in the `psfonts.map' file (see section `psfonts.map': PostScript font catalog). For our example, you'd insert the following into `psfonts.map':

rptmr      Times-Roman                 <ptmr8a.pfa

Of course, Times-Roman is already built in to most every printer, so there's no need to download any Type 1 file for it. But if you are actually following these instructions for new fonts, most likely they are not built in to the printer.

These PostScript fonts can be scaled to any size. Go wild! Using PostScript fonts, however, does use up a great deal of the printer's memory and it does take time. You may find downloading bitmap fonts (possibly compressed, with the `Z' option) to be faster than using the built-in PostScript fonts.


Go to the first, previous, next, last section, table of contents.