# How to install a font on MacTeX 2013

I don't understand why fonts that work perfectly fine on Windows with TeXLive 2013 don't work on my Mac with MacTeX-2013, but whatever. I need to install "Linux Libertine O," but do not know how to do it. The instructions I find online all seem to be for older versions of MacTeX and OS X. I need the font to work with XeLaTeX. If there is a large font distribution/package of some sort that I can use that would be ideal so that I don't keep having to install fonts one by one.

-
@texenthusiast I found that but the directions were not helpful for me. –  Daи Aug 8 '13 at 2:43
I don't have the libertine package, and I don't know how to install packages - so I'm dead in the water for that also. I figured I'd start by trying to just install a simple font before learning that stuff. –  Daи Aug 8 '13 at 2:45
@texenthusiast fontspec error: The font "Linux Libertine O" cannot be found. –  Daи Aug 8 '13 at 2:59
@Dan: A reason why your document compiles under Windows but not under MacOSX is that the fonts may be activated on your Windows machine but not (yet) on your Mac. If that's the case, you'll need to use the method described in Joseph Wright's answer, viz., use each font's exact file name. –  Mico Aug 8 '13 at 6:25

Do you have Linux Libertine installed as an OTF in your Mac? If so, using fontspec + XeLaTeX should "just work".

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Linux Libertine O}
\begin{document}
Testing, 1, 2, 3.
\end{document}


\$ pdffonts ~/tmp/TeX/libertine.pdf

name type encoding emb sub uni object ID

OKMUQH+LinLibertineO-Identity-H CID Type 0C Identity-H yes yes yes 5 0

edit: As per Joseph Wright's request for clarification: I have installed the Linux Libertine OTF package as a system-wide font (i.e. accessible to any application on my Mac)

-

XeTeX uses system-dependent code to load fonts, hence it's quite possible to see differences between how Windows and Mac installations find fonts. What will always work is looking not for the 'friendly' name of the font but the font file name:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{LinLibertine_R.otf}
\begin{document}
Testing, 1, 2, 3.
\end{document}


I'm using the files inside /usr/local/texlive/2013/texmf-dist/fonts/opentype/public/libertine, i.e. without a 'stand alone' installation of Linux Libertine for use by non-TeX programs. Again, this can be important! (See also mvarela's answer)

-