[Tex/LaTex] How to use the Optima font delivered with the Mac in LuaLaTeX

fontspecluatex

I am trying the following on my Mac:

\documentclass{minimal}

\usepackage{fontspec}

\begin{document}

\setsansfont{Optima}

\textsf{Test}
\end{document}

But I get the following:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "Optima" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................

I was under the impression this would work. What have I missed?

Best Answer

There is a file called otfl-blacklist.cnf in the directory /usr/local/texlive/2011/texmf-dist/tex/luatex/luaotfload.

One line of it is

/Library/Fonts/Optima.ttc

mkluatexfontdb block most TTC fonts by default because they broken in previous version of LuaTeX. But with MacTeX 2011, they are usable.

There are several solutions to this

  1. Try to edit the file mentioned above, so it will not block optima. (But this is not recommended, what if someday luaotfload was updated? Edit it again?)
  2. Copy the optima fonts to a new directory such that muluatexfontdb will be able to find it, for example, ~/Library/Fonts or one of fonts directory in texmf tree.

As long as you get the idea why fontspec cannot find it, as I explained above, you will certainly work around it. Good luck.