[Tex/LaTex] Confused with choosing TTF, OpenType, and Type1

fontsopentypetruetypetype1

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.

Best Answer

  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.