# Confused with choosing TTF, OpenType, and Type1

Actually I don't know much about font formats such as TTF, OpenType, and Type1.

1. What are the differences between TTF, OpenType, and Type1?
2. Which one should I use in PDF produced by LaTeX?
3. How to explicitly specify in LaTeX input file if I want to use one of them? For example: I want to use Helvetica in TTF or OpenType rather than Type1.
4. Is it possible to use the same font but with 3 different types. For example: in my PDF document, paragraph A uses Arial fonts in TTF, paragraph B uses Arial fonts in OpenType and paragraph C uses Arial fonts in Type1.
-
All are OK. Professional fonts are usually Type 1 (old ones) and OpenType (new ones). TrueType fonts have fewer advanced features, but the result can be as well as other formats. –  Leo Liu Jul 7 '11 at 16:19
@Martin: pdfTeX needs TFM files to get metrics. But pdfTeX can use TrueType and OpenType fonts through font mapping, as Type 1 fonts. –  Leo Liu Jul 7 '11 at 16:24
+1 Thanks @xport, your last edit really improved the question. I cleaned-up the comments a little. –  Martin Scharrer Jul 7 '11 at 16:35
Your first question would be answered instantly by reading the corresponding Wikipedia articles. –  Thorsten Donig Jul 7 '11 at 17:26
@Leo: pdftex can use OpenType fonts but only partly: subsetting is not possible. (See documenation, section "Map files") –  Ulrike Fischer Jul 7 '11 at 17:30

## 2 Answers

1. The basic difference between TrueType and Type1 fonts is that the former use quadratic splines, while the latter use cubic Bézier curves. OpenType is a wrapper format that can contain both Type1 and TrueType fonts, which also defines many other features of which the original formats are incapable. So an OpenType font can be one or the other; it's customary to use the .otf extension for Type1 based and .ttf for TrueType based OpenType.

2. The font that renders better. There are good and bad fonts of both kinds.

3. The actual choice is done via the Map file (ordinarily pdftex.map). A typical entry is

ec-lmr10 LMRoman10-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmr10.pfb


The first field is the TFM file name, the second field the PostScript name of the font; then come some instructions: the font must be reencoded through the vector enclmec that's provided by lm-ec.enc; then comes the name of the .pfb file (this is a Type1 font).

4. You can use the font you like. Here's an example (plain TeX)

\pdfmapline{+xec-lmr10 LMRoman10-Regular "enclmec ReEncodeFont" <lm-ec.enc <<lmroman10-regular.otf}
\font\x=ec-lmr10
\font\y=xec-lmr10

\x
Lorem ipsum dolor sit amet

\y
Lorem ipsum dolor sit amet

\bye


I define a "copy" of Latin Modern Roman in the Map file; the file xec-lmr10.tfm is just a copy of ec-lmr10.tfm sitting in the same directory as the TeX file. For technical reasons, the .otf and .ttf font must be entirely embedded in the PDF file, which is the meaning of <<.

The first paragraph is rendered with lmr10.pfb, the second with the OpenType font.

-
1. It's a large topic, I think it is better to visit Wikipedia, Apple, Microsoft and Adobe's web sites.

PostScript Type 1 font format is the oldest one, and OpenType is the newest one:

• PostScript Type 1: Adobe
• TrueType: Apple and Microsoft (against Adobe) => Apple AAT
• OpenType: Adobe and Microsoft (against Apple)
2. OpenType can be thought as the successor of PostScript Type 1 format. Thus it is usually better to use OpenType than Type 1 for the same font. But the result may be the same.

Type 1 use cubic Bezier curves, TrueType use quadratic Bezier curves, and OpenType can use both. It is usually preferred to use cubic curves for better result. But it is not absolute.

Most times we have no choice.

3. You'd better read the sections of font mapping in manuals of pdfTeX and DVIPDFMx. Installing a font is rather difficult for newbies. Since XeTeX and LuaTeX can be used today, it is much easier to use fontspec package.

And I hope the information about traditional TeX font installation (like in fontinstallationguide) will be left for history only.

4. Yes, you can. I'm sorry I don't have much time to show an full example to install fonts for different formats and different output drivers. Using fontspec in XeLaTeX or LuaLaTeX, it is quite easy.

Example:

% XeLaTeX
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\usefont{T1}{lmr}{m}{n}Latin Modern in Type 1 format.

\usefont{EU1}{lmr}{m}{n}Latin Modern in OpenType format.
\end{document}
`
-