[Tex/LaTex] How to use an OpenType font with the LaTeX document

fontsopentypexetex

I want to use a really cool open-source OpenType font with my LaTeX document.

I was told that either I could go through a long process of converting the OpenType font to one useable by LaTeX, or I should instead switch to using XeTeX.

Is there a way for me to use an unmodified OpenType font with my LaTeX document (and existing LaTeX installation)?

Best Answer

Switch to XeTeX:

  1. Change your invocations of pdflatex to xelatex.
  2. \usepackage{xltxtra} at the beginning of your preamble (some XeTeX goodies, in particular it also loads fontspec, which is needed for font selection).
  3. \setmainfont{Name of OTF font} in the preamble.
  4. No step 4.

It’s as easy as that.

Drawback: you lose the advantages of the microtype package. Ah, and be sure to use UTF-8 as your source encoding, and remove any \usepackage{inputenc} declarations.

See also: Differences between LuaTeX, ConTeXt and XeTeX.