Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Appendix A: Installation

Section 4: Installing new fonts

In this section…

  1. TrueType and OpenType fonts

Fonts come in a variety of formats. The earlier PostScript Type 3 (METAFONT) and Type 1 (PS) fonts are now being superseded by fonts in TrueType (.ttf) and OpenType (.otf) formats. How you install them and where they go depends on how and where you installed LATEX: all I can deal with here are the standard locations within your TEX Directory Structure (TDS).

If you are installing fonts on a multi-user system for everyone to use, they should go in the local shared tree, usually /usr/local/share/texmf/...

TrueType and OpenType typefaces

These are a single .ttf or .otf file per font (so there may be many files for a whole typeface or font family). There may also be some .fontspec files that go with them;

PostScript Type 1 typefaces

These are normally used only with pdflatex and are no longer covered in this document. In most cases they have been superseded by their Truetype or OpenType equivalents.

They come as a pair of files per font (so there may be many for a whole typeface): a .pfb (PostScript Font Binary) outline, and an .afm (Adobe Font Metric) file.

METAFONT typefaces

These are very old fonts which are not yet available in OpenType or TrueType format (and in some cases may never be) and are no longer covered in this document.

They have a number of .mf source (outline) files and possibly also some .fd (font definition) files. There may be .tfm (TEX Font Metric) files but these are not needed at installation, as they get generated from the outlines automatically the first time you use the font.

A style package (.sty file, if present with the fonts) SHOULD be used in a \usepackage command instead of loading the fonts manually. There is often a PDF showing examples and describing how to use the font or family.

A.4.1 TrueType and OpenType fonts

These are the fonts you will normally be using. A good selection comes with a full installation of TEX Live (see the list above and those following it). There are more available, shown in the LATEX Font Catalogue with links to their directory on CTAN; and you can of course buy or download TrueType and OpenType fonts from their foundries (makers) or from online font collections.

Warning

Whichever method you use, DO NOT install additional fonts in your system’s TEX Live installation directories, because when you upgrade to a new version, they may be overwritten or lost.

A.4.1.1 Installing TEX Live or TT/OT fonts from CTAN

There are two ways to do this, depending on what distribution of TEX you have installed:

Either way, no further action should be required apart from running the fc-cache utility as described in the sidebar ‘The FontConfig font cache’ below.

A.4.1.2 Installing TT/OT fonts downloaded from elsewhere

There are two ways to do this, too:

  • using the font installer program provided by your computer system, usually something like a click or right-click on the font file and select FontsInstall from the menu.

    (This method is simple, easy, and quick, but will bundle them in along with all your other system fonts, or perhaps in a hidden directory like ~/.local/share/fonts. This makes it harder to backup or copy fonts that you later need for moving to a new computer)

  • installing them in your Personal TEX Directory (PTD) with all your other TEX extras.

    (This method needs a little thought and planning, but has the advantage that the fonts then live along with all your additional classes and packages, so you can easily backup or copy the whole lot to a new system without having to worry about where the files go)

A.4.1.3 Font installation in your Personal TEX Directory

To install fonts in your Personal TEX Directory (PTD), create a directory for them in the form defined by the TEX Directory Structure (TDS):

  • TrueType: texmf/fonts/truetype/foundry/typeface;

  • OpenType: texmf/fonts/opentype/foundry/typeface.

where foundry is the name of the font maker or supplier, and typeface is the name of the typeface.

Choose suitable, obvious names to make them easy to recognize, and put the font files in the new directory. For example, the Aller typeface TrueType font files from Dalton Maag could go in texmf/fonts/truetype/daltonmaag/aller and the Iwona typeface OpenType font files by Janusz M. Nowacki could go in texmf/fonts/opentype/nowacki/iwona.

On GNU/Linux systems, to get the FontConfig cache to index fonts in your PTD, you need to tell it where they are. There are already .conf font configuration files in /etc/fonts/conf.avail/ for the fonts that come with the installation (eg 65-fonts-texgyre.conf). Create one for your PTD, eg 09-texlive.conf, eg:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <dir>/home/peter/texmf/fonts/opentype</dir>
  <dir>/home/peter/texmf/fonts/truetype</dir>
</fontconfig>
<!-- use sudo fc-cache -f -vv to rebuild font cache -->

(substituting your username for mine). The format is XML, so make sure you don’t miss any of the pointy brackets or mess with the element type names. Then when you run fc-cache after installing new fonts, it will find them.

Some examples of font indexing are shown in § 6.2.1.1 above.