20

I periodically maintain a long document (by ‘maintaining’ I mean: adding new parts, deleting some old stuff, etc. without revolutionizing the whole thing). I’m using XeLaTeX, provided by a standard MacTex installation. The document uses the standard Times font provided on macOS. This font has been used for years without issues.

Yesterday, I woke up and discovered that italic was broken in my document, seemingly without reason. All Italic parts are now typeset as Bold Italic. After investigating I discovered it’s not specific to this file. For instance, I could reproduce the issue with this small example.

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Times}

\begin{document}

Normal is OK.

\textbf{Bold is OK.}

\textbf{\textit{Bold Italic is OK.}}

\textit{Italic is broken :-(}

\end{document}

That’s what I get!

Here are the things I know:

  • It’s a recent problem. I am 100 % sure Italic used to be fine. I am fussy enough to notice these things instantly.

  • This is likely font-specific. If I use Helvetica instead, for instance, the problem does not occur.

  • This is not specific to the command textit. Any other command/title/occurrence that results in italic text will be broken as well.

  • The font file is not missing or broken. That’s the first thing I checked. All styles are fine, Italic included. I can use Times as usual in any app without issues.

  • I did not add any TeX package recently nor did I modify system fonts in any way, at least not manually. I did not touch my TeX install.

  • I recently updated to High Sierra, a minor update that did not affect my TeX install as far as I can tell.

  • My mind is completely blown by this strange bug and I’m looking for advice!

  • 1
    What do you mean with "in any app"? If you mean an office suite it's likely that it fakes this feature anyway (if not available). Did you check, if you have something like Times-Italic.ttf (maybe other font type, didn't check) anywhere? – TeXnician Oct 11 '17 at 13:30
  • Font Book (system font manager) lists: Times Normal, Times Bold, Times Italic, Times Bold Italic. I checked the glyphs, they are fine (it’s no fake italic, I can see the real italic characters). By ‘any app’ I really mean any app. Basically, open any app with a font selector, select Times Italic, and it will look just fine. Only TeX is broken. I know it’s hard to believe, which is why I posted this question. – user96829 Oct 11 '17 at 13:38
  • 4
    I tried on Sierra and High Sierra: the problem appears with the latter and not the former. So it wasn't really a “minor update”. What happened is that up to Sierra a DFONT was used, now it's a TTC font file. – egreg Oct 11 '17 at 13:41
  • Interesting! So apparently High Sierra changed the Times font file in a way that is not properly understood by the TeX install? Is it a bug or a feature? Because I mean, other fonts are TTC as well and they work fine. – user96829 Oct 11 '17 at 13:45
  • 1
    @zozor I'm yet to read a better-asked question. It's so complete! – deshmukh Oct 12 '17 at 1:11
25

With the recent introduction of MacOSX 10.13 "High Sierra", a number of font families whose "family members" used to be distributed as individual font files are now grouped together in .ttc files.

For some, but certainly not all, font families affected by this change, the luaotfload utility (which is invoked by fontspec under LuaLaTeX) appears to need some explicit help in determining which "family members" to select from a given font family. One such family is Times [Roman], with family memers Times, Times Bold, Times Italic, and Times Bold Italic.

Aside: I did a quick-and-dirty check of which .ttc fonts located in /Libruary/Fonts and /System/Library/Fonts are affected by this issue. (See the code below for how to run this check.) Among the affected fonts are Avenir, Futura, Gill Sans, Helvetica, Helvetica Neue, Hoefler Text, Optima, and Times. Some of the unaffected ones are Avenir Next, Baskerville, Charter, Didot, Menlo, Palatino, PT Sans, and PT Serif. Obviously, this list is far from complete. I am as yet unable to tell what's going on inside the ttc files that lets luaotfload succeed in some cases and fail in others.

When that happens, it's necessary to change

\setmainfont{Times}

to

\setmainfont{Times}[ItalicFont    ={* Italic},
                    BoldFont      ={* Bold},
                    BoldItalicFont={* Bold Italic}]

In the case of Hoefler Text, it's necessary to change

\setmainfont{Hoefler Text}

to

\setmainfont{Hoefler Text}[ItalicFont    = {* Italic},
                           BoldFont      = {* Black}, 
                           BoldItalicFont= {* Black Italic}]

This is because with Hoefler Text, the bold family members are named "Black" and "Black Italic" rather than "Bold" and "Bold Italic".


A full MWE:

\documentclass{article}
\usepackage{fontspec}
\newcommand{\test}[1]{\setmainfont{#1}#1\par
  Normal \textbf{Bold} \textit{Italic} \textbf{\textit{Bold Italic}}%
  \par\smallskip}
\begin{document}

\begin{document}

\verb+fonts in /System/Library/Fonts+

\smallskip
\test{Avenir}
\test{Avenir Next}
\test{Helvetica}
\test{Helvetica Neue}
\test{Menlo}
\test{Optima}
\test{Palatino}
\test{Times}

\medskip
\verb+fonts in /Library/Fonts+

\smallskip
\test{Baskerville}
\test{Bodoni 72}
\test{Charter}
\test{Didot}
\test{Futura}
\test{Gill Sans}
\test{Hoefler Text}
\test{PT Sans}
\test{PT Serif}

\end{document}

\end{document}
  • This solved the problem, thank you! It’s still strange that only this specific font file (Times) cannot be parsed automatically though, while all other fonts can – user96829 Oct 11 '17 at 14:14
  • 2
    @Zozor - I don't think the issue is limited to Times. I think the issue arises with all font families which, under "High Sierra", are now grouped in .ttc files. Some examples would be Charter, Didot, Futura, GillSans, and Hoefler Text. Don't ask me what Apple was thinking in making this change... – Mico Oct 11 '17 at 14:21
  • 2
    @Mico I tried Palatino (also in .ttc format) and it doesn't show the issue; also, as I wrote in another comment, luaotfload is not able to split Times.ttc apart, whereas it can do it with other .ttc fonts. I'll investigate again when I'll be in front of the High Sierra machine. – egreg Oct 11 '17 at 16:08
  • 1
    @egreg - Thanks. I've amended the answer to include a partial lists of ttc-fonts that are either affected or unaffected by the inability of luaotfload to determine which fonts belong to a given font family. – Mico Oct 11 '17 at 22:58
  • 2
    @Mico Nice, I'll check on my machine to confirm (but I'm sure the list is right). As far as I know, the project of dismissing DFONT files was established some time ago. – egreg Oct 11 '17 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy