25

This posting is a follow-up to the postings Can't generate ligatures with LuaLaTeX under MacTeX2014 and MacTeX2015 when using certain fonts and LuaLaTeX, fontspec, .ttc fonts and kerning (Optima on Mac OS).

I have a 13" MacBookPro that runs MacOSX 10.9.4. The issue is that with with the release of MacTeX2104, LuaLaTeX -- but not XeLaTeX -- has apparently ceased to perform kerning and ligaturing for certain fonts with file extension .ttc. Consider the following MWE:

% !TEX TS-program = LuaLaTeX
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Hoefler Text}
\setsansfont{Optima}
\listfiles
\begin{document}
WA AV Test Type off fit fly office baffle

\textsf{WA AV Test Type}
\end{document}

Running this MWE under LuaTeX 0.79.1 (part of MacTeX2014), I get

enter image description here

whereas running it under LuaTeX 0.76 (provided by MacTeX2013), I get

enter image description here

In the LuaTeX 0.76 output, note the sophisticated kerning and the presence of various f-ligatures. Unfortunately, both kerning and ligaturing appear to have vanished under LuaTeX 0.79.1, at least for the two particular fonts used in this MWE (Hoefler Text and Optima). In fact, it's not just these two fonts that are experiencing problems; quite a few fonts with file extension .ttc contained in /Library/Fonts experience this deterioration as well. Among the ones I've tested and have have found to exhibit the problem described above are Baskerville, Didot, and Futura Medium.

In contrast, I have not (yet!) found a single font with extension .otf that experiences these problems when run with MacTeX2014-version of Lua(La)TeX.

Questions:

  • Is there something that can/should be done to re-enable kerning and ligaturing under MacTeX2014/LuaLaTeX 0.79.1 with these .ttc fonts?

  • Barring an affirmative answer to the preceding question, what are the step-by-step instructions for converting one or more of the affected fonts into a format (.otf?) that lets LuaLaTeX 0.79.1 performing kerning and ligaturing correctly? By "correctly", I mean the way that LuaLaTeX 0.76 as well as the older and current vintages of XeLaTeX manage to get these jobs done. Any software used to perform the font format conversion or adaptation should be open-source and (obviously...) be capable of being run under MacOSX.

I'm willing (and able!) to provide a 200 point "bonus" for every good answer to these two questions.


Addendum, August 2015: I've posted a partial solution to the problem, viz., how to manually set up one or more OpenType feature files that provide instructions for LuaLaTeX to generate the ligature substitutions, as an answer to my earlier posting on this subject, Can't generate ligatures with LuaLaTeX under MacTeX2014 and MacTeX2015 when using certain fonts.


For completeness, here are the file lists produced when running the MWE under the two different TeX distributions.

When running MacTeX2014:

This is LuaTeX, Version beta-0.79.1 (TeX Live 2014) (rev 4971)  
   (format=lualatex 2014.7.9)  26 AUG 2014 21:07

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
fontspec.sty    2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTeX
   expl3.sty    2014/07/20 v5241 L3 programming layer (loader) 
expl3-code.tex  2014/07/20 v5241 L3 programming layer 
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
l3unicode-data.def    2014/06/30 v5166 L3 Unicode data
l3pdfmode.def   2014/07/18 v5232 L3 Experimental driver: PDF mode
  xparse.sty    2014/07/20 v5241 L3 Experimental document command parser
luaotfload.sty  2014/08/10 v2.5-4 OpenType layout system
luatexbase.sty  2013/05/11 v0.6 Resource management for the LuaTeX macro programmer
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
  luatex.sty    2010/03/09 v0.4 LuaTeX basic definition package (HO)
infwarerr.sty   2010/04/08 v1.3 Providing info/warning/error messages (HO)
luatex-loader.sty    2010/03/09 v0.4 Lua module loader (HO)
luatexbase-compat.sty    2011/05/24 v0.4 Compatibility tools for LuaTeX
luatexbase-modutils.sty  2013/05/11 v0.6 Module utilities for LuaTeX
luatexbase-loader.sty    2013/05/11 v0.6 Lua module loader for LuaTeX
luatexbase-regs.sty    2011/05/24 v0.4 Registers allocation for LuaTeX
luatexbase-attr.sty    2013/05/11 v0.6 Attributes allocation for LuaTeX
luatexbase-cctb.sty    2013/05/11 v0.6 Catcodetable allocation for LuaTeX
luatexbase-mcb.sty     2013/05/11 v0.6 Callback management for LuaTeX
fontspec-patches.sty   2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTeX
fontspec-luatex.sty    2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTeX
 fontenc.sty
  eu2enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
  eu2lmr.fd     2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty    2011/09/09 v0.981 provides access to latin accents and many other characters in Unicode lower plane
 eu2lmss.fd     2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty    2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/05/08 v1.15 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
pdftexcmds.sty  2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
fontspec.cfg
   t3cmr.fd      2001/12/31 TIPA font definitions
supp-pdf.mkii
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty     2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty 2011/04/07 v1.3 Define keys (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty     2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********

When running MacTeX2013:

This is LuaTeX, Version beta-0.76.0-2013061817 (rev 4627)  
    (format=lualatex 2014.3.31)  26 AUG 2014 21:09

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
fontspec.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX
   expl3.sty    2014/01/07 v4646 L3 Experimental code bundle wrapper
 l3names.sty    2014/01/04 v4640 L3 Namespace for primitives
l3bootstrap.sty 2014/01/04 v4640 L3 Experimental bootstrap code
  luatex.sty    2010/03/09 v0.4 LuaTeX basic definition package (HO)
infwarerr.sty   2010/04/08 v1.3 Providing info/warning/error messages (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
luatex-loader.sty 2010/03/09 v0.4 Lua module loader (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
l3basics.sty    2014/01/04 v4642 L3 Basic definitions
 l3expan.sty    2014/01/04 v4642 L3 Argument expansion
    l3tl.sty    2013/12/27 v4625 L3 Token lists
   l3seq.sty    2013/12/14 v4623 L3 Sequences and stacks
   l3int.sty    2013/08/02 v4583 L3 Integers
 l3quark.sty    2013/12/14 v4623 L3 Quarks
   l3prg.sty    2014/01/04 v4642 L3 Control structures
 l3clist.sty    2013/07/28 v4581 L3 Comma separated lists
 l3token.sty    2013/08/25 v4587 L3 Experimental token manipulation
  l3prop.sty    2013/12/14 v4623 L3 Property lists
   l3msg.sty    2013/07/28 v4581 L3 Messages
  l3file.sty    2013/10/13 v4596 L3 File and I/O operations
  l3skip.sty    2013/07/28 v4581 L3 Dimensions and skips
  l3keys.sty    2013/12/08 v4614 L3 Experimental key-value interfaces
    l3fp.sty    2014/01/04 v4642 L3 Floating points
   l3box.sty    2013/07/28 v4581 L3 Experimental boxes
l3coffins.sty   2013/12/14 v4624 L3 Coffin code layer
 l3color.sty    2012/08/29 v4156 L3 Experimental color support
l3luatex.sty    2013/07/28 v4581 L3 Experimental LuaTeX-specific functions
l3candidates.sty   2014/01/06 v4643 L3 Experimental additions to l3kernel
  xparse.sty    2013/12/31 v4634 L3 Experimental document command parser
luaotfload.sty  2014/02/05 v2.4-3 OpenType layout system
luatexbase.sty  2013/05/11 v0.6 Resource management for the LuaTeX macro programmer
luatexbase-compat.sty    2011/05/24 v0.4 Compatibility tools for LuaTeX
luatexbase-modutils.sty  2013/05/11 v0.6 Module utilities for LuaTeX
luatexbase-loader.sty    2013/05/11 v0.6 Lua module loader for LuaTeX
luatexbase-regs.sty    2011/05/24 v0.4 Registers allocation for LuaTeX
luatexbase-attr.sty    2013/05/11 v0.6 Attributes allocation for LuaTeX
luatexbase-cctb.sty    2013/05/11 v0.6 Catcodetable allocation for LuaTeX
luatexbase-mcb.sty     2013/05/11 v0.6 Callback management for LuaTeX
fontspec-patches.sty   2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX
fixltx2e.sty     2006/09/13 v1.1m fixes to LaTeX
fontspec-luatex.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX
 fontenc.sty
  eu2enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
  eu2lmr.fd     2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty    2011/09/09 v0.981 provides access to latin accents and many other characters in Unicode lower plane
 eu2lmss.fd     2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
fontspec.cfg
   t3cmr.fd     2001/12/31 TIPA font definitions
supp-pdf.mkii
epstopdf-base.sty 2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty      2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty  2011/04/07 v1.3 Define keys (HO)
kvoptions.sty     2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty     2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty      2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg  2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********
  • 1
    @KhaledHosny: Could this be related to the removal of the AAT parser? – Martin Schröder Aug 28 '14 at 14:24
  • 1
    @MartinSchröder, I believe the @-ping only works if the person being pinged has written, edited, or commented on the post. I might be wrong though. – Paul Gessler Aug 28 '14 at 18:24
  • 1
    @PaulGessler -- I, for one, have been successfully pinged by people writing my userid in a comment. :-) Hopefully, this will apply to Khaled as well. – Mico Aug 28 '14 at 18:31
  • 1
    OK, you’re right. I had forgotten that LuaTeX using Fontforge code did map some AAT features to OT features. But that support was never complete and as it seems quite buggy, which seems to be the reason why they dropped it. Reading comments about the AAT support makes it look like it was rather accidental. – georgd Aug 30 '14 at 12:32
  • 1
    BTW isn’t Taco Hoekwater the one to contact about LuaTeX rather than Khaled who is the maintainer of XeTeX? – georgd Aug 30 '14 at 19:27
15

Whether the font is packaged as TTC or not is irrelevant to the issue here.

Most (all?) Latin fonts shipped by Apple use AAT layout tables, not OpenType. Older versions of LuaTeX partially supported AAT rather accidentally; as egreg pointed out in his comment above, FontForge that is used as base for the LuaTeX font loader maps some AAT features to equivalent OpenType ones, and that is why simple features like kerning or ligaturing appear to work. However, that code was hardly tested, caused crashes with many Mac OS X system fonts (that packages like luaotfload had to blacklist) and furthermore it outright broke fonts that include both AAT and OpenType layout table (many fonts from SIL, like Charis, do) as the mapped AAT features were duplicating the real OpenType ones, which confused the OpenType processor.

Supporting AAT layout table for third parties is rather hard (due to incomplete or outright missing documentation) and I’m not aware if any working implementation other than Apple’s, but LuaTeX can’t use it as it wants to remain system independent. XeTeX of course uses Apple API to get AAT support, but at the price of producing different output when an AAT font is used between Mac OS X and other platforms (and it also meant we had to do quite some changes to port XeTeX to 64-bit Mac OS X systems when Apple deprecated the API that XeTeX was originally using and did not port it to its 64-bit architecture).

So the solution is to avoid AAT fonts and use OpenType ones, or write your own feature files to emulate the missing OpenType support.

  • 2
    Thanks so much for this detailed write-up of the problems the AAT technology poses for Lua(La)TeX. Real quick: Could you offer some basic advice on how to write a feature file that provides kerning instructions? Presumably, the optimal kerning values for various character pairs are embedded in the font file(s). How does one access the kerning table reasonably easily? – Mico Oct 30 '14 at 11:47
  • 1
    The simplest solution would to load the font in FontForge and export a feature file from it, this would (more or less) give you the same level of support that LuaTeX had before (sans the crashes) and you can even fix any issues in the AAT → OpenType mapping. – Khaled Hosny Oct 30 '14 at 15:06
  • 1
    I've just come across a new wrinkle. With the recent release of MacOSX 10.10 "Yosemite", Apple seems to have provided some updates to its font files. (On my system, the date of all system font files is now 10 Sept 2014.) Interestingly, kerning now works "out of the box" with LuaTeX 0.79.1 (MacTeX2014) with Hoefler Text; ligaturing still doesn't work, though, and neither kerning nor ligaturing works with Optima. Using FontForge, I've exported OpenType-style feature files for these fonts, but I haven't been able to get them to work yet, i.e., loading them seems to have not effect on output. – Mico Oct 31 '14 at 6:32
  • You mentioned writing a 'feature file' that provides the missing ligaturing information. For anyone who may be interested in doing this, you may be interested in my answer to the posting Can't generate ligatures with LuaLaTeX under MacTeX2014 and MacTeX2015 when using certain fonts. – Mico Aug 4 '15 at 23:01

Your Answer

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

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