The No BS Guide To TeTeX Font Installation

Installing type1 and true type fonts in tetex-latex

Converting True Type Fonts to Type1 for TeTeX / LaTeX

This document is not intended to explain how things work. For that, you should read the fontinst documentation with your tetex system. See /usr/share/texmf/doc/fontinst/base ( replace /usr/share/texmf with the root directory of your tetex installation ). If you don't have the tex docs on your system, you can download from CTAN. This document explains all about what the .vpl, .pl, .vf and .tfm files are, the finer points of the font naming convention and all the details ommitted from here.

The purpose of this document is to summarise as cleanly as possible what one has to do to get their true type and type 1 fonts available under tetex/latex.

1. Install ttf2pt1
2. Run the ttf2pt1 utility on each of your true type fonts. If you are using the fonts for tex, you need to rename them. For example, if I am renaming the arial fonts for tex, I rename as follows:

arial	farr8a
arialbd	farb8a
ariali	farri8a
arialbi	farbi8a
Arialn	farr8an



The first letter, f is the foundry. ( You can use f for all the fonts you add yourself. ) The second two are an abbreviation for the font name ( ar ). This is followed by the font weight ( r or b in this case ), then optionally a variant. In the case of true type fonts, the only variant you will encounter is i for italic. This is followed by the encoding scheme ( 8a ) and optionally an n to specify the font width.

So to generate the appropriate Type1 fonts from the arial fonts, you would issue the following commands:


ttf2pfa arial.ttf	farr8a
ttf2pfa arialbd.ttf	farb8a
ttf2pfa ariali.ttf	farri8a
ttf2pfa arialbi.ttf	farbi8a
ttf2pfa Arialn.ttf	farr8an



This should spit out a lot of .pfa and .afm files. The .pfa files are the fonts, the .afm files are the font metrics.

Getting the Type1 fonts into TeX

1. Run fontinst

Assuming you have the type1 fonts named correctly ( this is important ), you can prepare yourself to install them. To do this, use the fontinst utility:
 latex kpsewhich fontinst.sty  Then you need to tell fontinst to build a font by the name of your font family ( the first three letters of the font ) in the following manner:
 \latinfamily{far}{}\bye 
fontinst should spit out several .pl and .vpl files , as well as some font definition ( .fd ) files.
2. Convert the .pl and .vpl files to binary format

To do this, you simply run the following commands:
 for X in *.pl; do pltotf $X; done for X in *.vpl; do vptovf$X; done 
This should generate one .tfm file for ever .pl file and one .vf file for every .vpl file.

The vpl, pl, and mtx files generated by fontinst can be deleted now.
rm *.vpl *.pl *.mtx

3. Configure dvips

You need to edit your psfonts.map file to tell dvips about the new font. To find this file, issue the command
 kpsewhich psfonts.map 
Add lines to it that look something like this:


farr8r 		ArialMT <8r.enc <farr8a.pfa
farbi8r 	Arial_BoldItalicMT <8r.enc <farbi8a.pfa
farb8r 		Arial_BoldMT <8r.enc <farb8a.pfa
farri8r 	Arial_ItalicMT <8r.enc <farri8a.pfa
farr8rn 	Arial_Narrow <8r.enc <farr8an.pfa



You will need to add one line to it for each pfa file ( ie each type1 font in your font family ). The first row is same as the full name of the font, but with 8a replaced by 8r. The second column is the name of the font. It is essential to get this right !!! To find out the name of the font, look in the corresponding .afm file.
4. Test it


\documentclass{article}
\begin{document}
\usefont{T1}{far}{m}{n}\selectfont
\huge
Testing a new font \dots the quick red fox jumped over the lazy brown dogs

\end{document}



There are a number of possibilities that you can try in the usefont command depending on what variants are available. {m}{n} is a plain vanilla font weight/shape. To see what other shapes/weights are available, look in the .fd file.

In my experience, a lot of the backyard'' public domain Type1 fonts don't work. Don't waste your time with things that don't work. I recommend that you start out with true type fonts from relatively respectable sources ( Adobe, Bitstream, Monotype and Microsoft ). These shouldn't give you any trouble. For example, the Arial font worked like charm for me. Start with something that has a good chance of working, this is difficult enough to do right without you having to worry about whether the font will work or not.

5. Install it System Wide

Now you can install it system wide. Your best bet is to look around your tex installation to find out where your fonts are installed. On my tetex installation, I have this setup:
/usr/share/texmf/fonts/type1 : type1 fonts ( ie pfa files )
/usr/share/texmf/fonts/tfm : tfm files
/usr/share/texmf/fonts/vf : vf files
/usr/share/texmf/tex/latex/psnfss : .fd files and .sty files

The tex root directory may vary ( replace /usr/share/texmf with your tex root directory ). You should make appropriate subdirectories under these directories, and place the files in them.

Update A reader brought it to my attention that you need to run texconfig after placing the files in the system directories. This is necessary so that the application can find your new font files. Thanks to Mauricio Klein for feedback on this matter.

You may also wish to make some of your own .sty files to act as a more user friendly'' front end to font selection. Look at some of the existing *.sty files in your psnfss directory for inspiration