Installing OpenType Fonts in LaTeX with the LCDF Typetools John Owens

Download: otfinst version 1.0.3

The goal of this document is to describe how to install OpenType fonts for use with LaTeX. This is described in a recent TUGboat article. To do so I used the wonderful LCDF Typetools and some scripts of my own. I should note the XeTeX typesetting system, for Mac OS X, uses OpenType fonts directly, and Marc Penninga's fontools (written in Perl) addresses many of the same issues that we address here (if you're a Perl hacker you might prefer that tool), and if you are specifically interested in Minion Pro you may prefer the very detailed and feature-rich MinionPro package (CTAN packages: CTAN://fonts/minionpro/, CTAN://fonts/minionpro/MinionPro.pdf, and CTAN://fonts/mnsymbol/MnSymbol.pdf).

My specific setup is an Apple Macintosh running OS X (tested on both 10.3 and 10.4, but now I'm on 10.4 exclusively). I use the MacPorts distribution of TeTeX, specifically release 3 (3.01 in particular), which includes a kpathsea binary not included in release 2. I've also used the fink distribution in the past. My source fonts were from the Adobe Type Classics for Learning, and from the voluminous Adobe "Kepler" font family (thanks to Thomas Phinney of Adobe); I have also tested with two families from FontFont (thanks to Jeff Sinclair of FontFont) and am working on testing a series of font families from Monotype, Linotype, and ITC (thanks to Allan Haley of Monotype). The script is designed to work on most OTF fonts/font families and any reasonably recent LaTeX distribution. I would like to continue to test and improve the script with font families from other vendors.

At this time the tools only work with PostScript-flavored OpenType fonts; TrueType-flavored fonts are partially but not wholly supported for lengthy, complex, and detailed reasons regarding TeX font handling (not otfinst or otftotfm) that I won't get into here.

I use the MacPorts version of the LCDF typetools. (To make the LCDF source package work with a TeTeX distribution, use "configure --with-kpathsea=/opt/local" [for a MacPorts installation] or "configure --with-kpathsea=/sw" [for a Fink installation].)

Below I use Adobe Caslon as an example without opticals and Adobe Minion as an example with opticals; other fonts are hopefully straightforward (Adobe Garamond also is listed at the end).

Goals

Wrapper Script around otftotfm

The first specific tool that is useful for installing OpenType fonts is "otftotfm", which comes with a nice "-a" automatic installation flag that places its output files in the proper places in the tetex tree. The second useful tool, also from LCDF, is "otfinfo", which reports attributes of OTF fonts. Version 2.38 of otfinfo is required for the script.

otftotfm takes a single set of options as an argument and also a single font file. To make a complete font family installation, however, requires the installation of many font files, each with several options. For instance, a typical font family may have multiple files (regular, italic, bold, etc.) and require several options (small caps, old-style figures, neither, etc.). Thus the script's main function is to automate the iteration over the many files and the many options.

The script (formerly known as otftex_install) can be fetched from here (CTAN directory). The interesting aspects of the script are:

 

Simply generating the font files is not enough, however. Two additional ingredients are necessary for LaTeX to properly recognize the fonts. I place all of these in a local texmf directory "tex/latex/localfonts/", although this is settable in the script. These files are automatically generated and installed by the script, assuming the directory is writeable by the script.

.fd Required Files

The first is a "fd" font description file that maps font properties to fontnames (documented in the LaTeX2e Font Selection Guide, also in Chapter 5 of Making TeX Work). One .fd file is required per font family; currently the options that generate font families are 'onum' (old-style numbers), 'lnum' (lining figures), 'swsh' (swashes), 'sinf' (inferior figures), 'sups' (superior figures), and 'pnum' (proportional figures), each of which will generate a separate font family. Assuming the LY1 encoding is used, files for old-style and lining figures are named ly1PPPx.fd and ly1PPPj.fd, where PPP is the Berry prefix, "x" indicates expert fonts but no old-style figures, and "j" indicates old-style figures. (Swashes are 'w', superior figures are '1', inferior figures are '0', and proportional figures are '2'.) The example files (note these use long filenames, not Berry filenames):

.sty Required Files

The second is a ".sty" style file that declares the font family for use in a LaTeX document. The style file has two options: "oldstyle" and "lining" (that redefine the "rm" font to the new font family with old-style or lining figures, respectively). The default is oldstyle.

All of these style files use the common style file nfssext.sty from Philipp Lehman's fontinst package. You should get this file directly from CTAN in the file "figuide-examples.tar.gz" (direct link). This file defines the commands "\textln" and "\textos" (lining style and old-style figures), which are used in the same way as the similar LaTeX commands \texttt or \textit or \textrm.

Sample use:

\usepackage[oldstyle]{minion}           % minion is now \textrm with oldstyle
 (or)
...
1234 \textln{5678}                      % 1234 is oldstyle, 5678 is lining
or
\usepackage[lining,scaled=1.1]{minion}  % minion is now \textrm with lining
                                        % figures, scaled 1.1x bigger than usual
1234 \textos{5678}                      % 1234 is lining, 5678 is oldstyle

Collected typeface examples

Tested typefaces

All of these have been tested and work well.

Notes/Questions/Issues

Acknowledgements

Thomas Phinney (Adobe), Geraldine Wade and Michael Duggan (Microsoft), Jeff Sinclair (FontFont), and Allan Haley (Monotype) provided fonts for testing. Thanks a ton to them—I am eager and willing to test fonts from other foundries!

This package would not be possible without the superb LCDF Typetools and the excellent and prompt support of their author Eddie Kohler.

Many thanks to Andreas Bachofen, Karl Berry, Ingo Beyritz, Thierry Bouche, Peter Dyballa, Eddie Kohler, Philipp Lehman, Ren Ng, Dario Teixeira, and Nicolas Vaughan for helpful comments, suggestions, and testing.

Changelog


John Owens | Last updated .