Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
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 Sep 11 '12 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 Sep 11 '12 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 Sep 11 '12 at 14:24
add comment

1 Answer

up vote 11 down vote accepted

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.

share|improve this answer
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. –  Khaled Hosny Sep 11 '12 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 Sep 11 '12 at 14:20
1  
@Mico: Try running mkluatexfontdb -v and see where it is stuck. –  Khaled Hosny Sep 11 '12 at 16:53
1  
Don't rename the file then :) just remove the lines you don't want to blacklist. –  Khaled Hosny Sep 11 '12 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 Sep 12 '12 at 20:46
show 6 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.