13

I'm having unexpected problems getting the "Hoefler Text" font to work when using LuaLaTeX (under MacTeX2012, all the latest updates installed) on a Mac (MacOS X 10.7.4). The following MWE

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Hoefler Text}
\begin{document}
Hello World.
\end{document}

throws the following error message when run under LuaLaTeX:

! fontspec error: "font-not-found"
!
! The font "HoeflerText" cannot be found.

Oddly, the very same MWE when run under XeLaTeX does not throw an error. The font is present on my Mac, under /Library/Fonts/, with a filename of Hoefler Text.ttc. For what it's worth, this seems to one of very few fonts in this directory with this filename extension (which I believe Apple calls "Truetype font collection"); almost all others have extensions such as .ttf and .otf.

Is there something special about Hoefler Text on a Mac that requires a special font-loading sequence to work under LuaLaTeX?

Addendum: Since first posting this question, I've learned from the comments and answer that this problem appears to affect all fonts stored in .ttc format on a Mac system, not just Hoefler Text.

3
  • 1
    I can reproduce your problem. It is not limited to Hoefler Text. Also other system fonts like Garamond and Lucida Sans produce the fontspec error: "font-not-found" with LuaLaTeX (while XeLaTex works fin in all cases).
    – hakaze
    Commented Sep 11, 2012 at 12:33
  • 2
    After digging through ~/Library/texlive/2012/texmf-var/luatex-cache/generic/names/otfl-names.lua it seems all ttc font collection files are ignored by luaotfload.
    – hakaze
    Commented Sep 11, 2012 at 12:51
  • @hakaze - Thanks for these observations. As egreg confirmed in his answer, it is indeed a problem common to all fonts stored in .ttc format on a Mac, and not just Hoefler Text. I'll update my question to reflect this "insight".
    – Mico
    Commented Sep 11, 2012 at 14:24

1 Answer 1

11

For some reasons, the font loading mechanism of LuaLaTeX maintains a "black list" for Mac OS X fonts, where all .ttc fonts are inserted; the file is

/usr/local/texlive/2012/texmf-dist/tex/luatex/luaotfload/otfl-blacklist.cnf

and its contents is

% Tackes ages to load
LastResort.ttf % a MacOSX font, but also available for free from unicode.org 

% Mac OS X TTC fonts, this list need to be filtered out
/Library/Fonts/AmericanTypewriter.ttc
/Library/Fonts/Baskerville.ttc
/Library/Fonts/Chalkboard.ttc
/Library/Fonts/Cochin.ttc
/Library/Fonts/Copperplate.ttc
/Library/Fonts/Didot.ttc
/Library/Fonts/Futura.ttc
/Library/Fonts/GillSans.ttc
/Library/Fonts/Hoefler Text.ttc
/Library/Fonts/MarkerFelt.ttc
/Library/Fonts/Optima.ttc
/Library/Fonts/Papyrus.ttc
/Library/Fonts/STHeiti Medium.ttc
/System/Library/Fonts/AquaKana.ttc
/System/Library/Fonts/HelveticaNeue.ttc
/System/Library/Fonts/LucidaGrande.ttc
/System/Library/Fonts/Menlo.ttc
/System/Library/Fonts/STHeiti Light.ttc

You may modify the file, but there's no guarantee that the font will work.

I've found an old thread on the lualatex-dev list that deals with this problem.

Added

Thanks to Mico's for experimenting the issue. The only font that seems to give problem is "LastResort" that should be kept in the black list.

Doing

sudo nano /usr/local/texlive/2012/texmf-dist/tex/luatex/luaotfload/otfl-blacklist.cnf

and putting a % in front of each line after

% Mac OS X TTC fonts, this list need to be filtered out

followed by a call of

mkluatexfontdb

will make all .ttc fonts available for LuaLaTeX.

11
  • 3
    They used to crash luatex, so we blocked them all, the crashes should be fixed long ago now, but no one with a mac bothered to check. Commented Sep 11, 2012 at 14:12
  • Thanks for un-earthing the proximate cause of the problem I've run into. (I wish the fontspec user guide mentioned this issue explicitly.) I checked what would happen if I renamed the .cnf file: as you correctly surmised, doing so didn't solve the problem -- LuaTeX seems to get stuck completely doing something (probably looking for the font). The blacklist in the .cnf file is, if anything, severely incomplete by now: In addition to the 19 fonts that are listed in the file, there are at least a dozen more such .ttc fonts, at least on a system running MacOS X 10.7.4, in /Library/Fonts.
    – Mico
    Commented Sep 11, 2012 at 14:20
  • 1
    @Mico: Try running mkluatexfontdb -v and see where it is stuck. Commented Sep 11, 2012 at 16:53
  • 1
    Don't rename the file then :) just remove the lines you don't want to blacklist. Commented Sep 11, 2012 at 20:30
  • 1
    This was already discussed and fixed in github.com/khaledhosny/luaotfload/issues/37, but nobody has released the modified blacklist since then.
    – Philipp
    Commented Sep 12, 2012 at 20:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .