4

I'm probably missing something obvious. I'm using MacTeX 2014. I want to use the font Optima that ships with the Mac OS (10.8.5) -- it is a .ttc font. If I typeset the following TeX file I get no kerning between the Te and the Ty.

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = LuaLaTeX

\documentclass{minimal}
\usepackage{fontspec}

\setsansfont{Optima}
% \setsansfont[Kerning=On]{Optima} Mac

\begin{document}

\fontsize{36}{48}\selectfont
\textsf{Test Type}

\end{document}

As you can see, I also tried explicitly turning on the kern feature, but to no effect. I tried the same sample text in Adobe InDesign and the kerning does show up. I have not, so far, found any mentions anywhere of this phenomenon.

Mico
  • 506,678
sgmoye
  • 8,586
  • It seems a problem in the LuaTeX font loader, because XeLaTeX applies the kerning. – egreg Aug 25 '14 at 16:48
  • @egreg Oops -- I should have pointed out that originally I did that test and discovered that XeLaTeX does indeed do the right thing. – sgmoye Aug 25 '14 at 18:48
  • Made interesting discovery. If you say \setmainfont[Kerning=On]{Optima}, the log file contains fontspec warnings "icu-feature-not-exist-in-font": OpenType feature 'Kerning=On' (+kern) not available for font 'Optima' with * script '' and language ''. – sgmoye Aug 25 '14 at 19:00
  • Ack, @egreg seems right; here’s a test file: https://bitbucket.org/phg/lua-la-tex-tests/src/885634cba2d2d7a49e5286a081dfc18cf6df643c/pln-subfont-3-kern.tex?at=default – Philipp Gesang Aug 25 '14 at 21:41
  • See also Can't generate ligatures with LuaLaTeX under TeXLive 2014 when using certain fonts. The lack of support for kerning, ligaturing, and similar features seems to be a general problem with versions 0.78 and later of LuaTeX (the version included in TeXLive2014 and MacTeX2014 is 0.79.1): they all have dropped support for AAT (Apple Advanced Font Technology), and luaotfload has not yet been extended to make up for this loss of functionality. By the way, if you still have MacTeX2013 on your system, you'll find that kerning still works with it. – Mico Aug 26 '14 at 13:20
  • Current TeXLive and Lualatex works fine, with XeLaTeX the kerning is missing. –  Aug 26 '14 at 14:14
  • @Herbert - Does "works fine" apply to MacTeX2014 and .ttc fonts? – Mico Aug 26 '14 at 14:22
  • no, I use otf fonts. With fontforge it is easy to convert the ttc fonts to open type. –  Aug 26 '14 at 14:25
  • 1
    @Herbert Odd. I am using TL2014: kerning works in XeLaTeX but not in LuaLaTeX. I can confirm that kerning is present in LuaLaTeX in TL2013 and 2012. – sgmoye Aug 26 '14 at 14:26
  • @Herbert - Please provide more information - a link to a website would be fine -- on how on should go about using fontforge to change a .ttc font file to an .otf file. – Mico Aug 26 '14 at 14:42
  • @Mico Dropping AAT support is a feature and most likely unrelated to the issue at hand. The test file I posted earlier reproduces the bug 1) without Luaotfload and 2) with a regular non-AAT font (Cambria). – Philipp Gesang Aug 26 '14 at 16:25
  • @phg - I believe the abandonment of AAT support between MacTeX2013 (LuaTeX 0.76) and MacTeX2014 (LuaTeX 0.79.1) is very much related to the issue at hand. When I installed MacTeX2014 earlier this summer, I on purpose did not delete MacTeX2013. I can reproduce the OP's problems exactly with MacTeX2014 -- but not if I rerun the MWE under MacTeX2013. The problem seems to be restricted to font files with extension .ttc; they do not seem to occur with .otf font files. Incidentally, I am aware that abandonment of AAT support was deliberate; but that doesn't make it a wise decision, does it? – Mico Aug 26 '14 at 18:22
  • @Mico I’m not following you here. How could the removal of AAT support from the engine affect TTC subfont handling in the fontloader? Was the bug introduced with the branch on which Khaled prepared the removal? – Philipp Gesang Aug 26 '14 at 19:04
  • @Mico I just reproduced the issue with the engine from TL 2013 (version 0.76.0). That rules out an issue with Luatex, including the removal of AAT support. Try it out. As you say, you still have the binaries. – Philipp Gesang Aug 26 '14 at 19:21
  • @phg - Did you see my earlier posting, in which I reported problems with ligaturing with Hoefler Text when running MacTeX2014 but not when running MacTeX2013? Although I didn't mention it as such at the time, kerning is also affected. Let me create a new posting, in which I can lay out the issues in more detail. Hopefully, this will bring about some clarity. – Mico Aug 26 '14 at 19:25
  • @phg - I've created a new posting. Incidentally, I cannot figure out what programs you ran to create the screenshot you've posted, let alone reproduce it on my system. – Mico Aug 26 '14 at 20:10
  • @Mico I cannot figure out what programs you ran to create the screenshot you've posted, let alone reproduce it on my system. -- I used the Luatex binary from TL 2013 with the most recent fontloader from the Context distribution (the one that’s also in current Luaotfload). The output is the same as with the TL 2014 binary or more recent ones. That refutes your hypothesis that the problem in on the Luatex side. Your other question is an exact duplicate of this one, btw. – Philipp Gesang Aug 27 '14 at 05:29
  • @phg - As the OP and I have noted, we find no difference in output if we run XeLaTeX from either MacTeX2013 or MacTeX2014. The difference only shows up with LuaLaTeX across the two vintages. I usually use TeXworks as the front end for my work, but the problem also shows up if I use TeXshop instead of TeXworks. The full paths to the binaries is /usr/local/texlive/2014/bin/x86_64-darwin/lualatex and /usr/local/texlive/2013/bin/x86_64-darwin/lualatex, resp. I've listed all files used in the other posting, by the way. – Mico Aug 27 '14 at 07:19
  • @Mico Have you actually run the test file? – Philipp Gesang Aug 27 '14 at 17:28
  • @phg - OK, I just figured out how to run your test file. (Hey, I haven't run a "pure TeX" file, as opposed to a LaTeX file, in more than 20 years...) When I ran your test file through /usr/local/texlive/2014/bin/x86_64-darwin/luatex, it bombed with a complaint about cambria.ttc not being available. After I changed the font file to Hoefler Text.ttc, the program ran; however, sure enough, still no kerning. In contrast, if I run the test file through /usr/local/texlive/2013/bin/x86_64-darwin/luatex, the kerning works fine. Same result, by the way, if I run it with Baskerville.ttc. – Mico Aug 27 '14 at 18:22
  • @Mico Good! However, I just figured out why it was that no kerns showed up, at least for Cambria anyways: I forgot to explicitly request the “latin” script. Sorry for the noise! Here’s an updated test file. Please run it with Optima and/or Hoefler substituted for Cambria in TL 2013 and 2014. If there’s a difference, then we have a reproducible case. – Philipp Gesang Aug 27 '14 at 18:31
  • @phg - Many thanks for providing a new test script. With Hoefler Text, Optima, Didot, and Baskerville, there's no kerning in those lines where there should be some, if I run the test file under luatex 0.79.1. No kerning problems with these fonts when using luatex 0.76. – Mico Aug 27 '14 at 18:56
  • 2
    @mico: LuaTeX never really supported AAT features, what there was something that worked by coincidence; the FontForge code used in LuaTeX translates a subset of AAT features to equivalent OpenType ones, but apart from being incomplete, that code was buggy and crashy and broke hyprid OpenType/AAT fonts, so we decided to remove it. I'm not aware of any working AAT implementation apart from Apple’s, so it is not unreasonable for LuaTeX (that wants to remain OS independent) to not support it. – خالد حسني Sep 07 '14 at 21:04
  • @KhaledHosny - Many thanks for providing these insights. I'll grant you that the previous support (i.e., up to LuaTeX 0.76 or so) of AAT features wasn't perfect. However, the loss of kerning and ligaturing with some of MacOSX's system fonts -- affecting some, but not all, fonts files with extension .ttc -- under LuaTeX 0.79.1 is just so noticeable and so bad. Speaking for myself, if a choice has to be made between (a) buggy support for these features and (b) no support at all, I prefer option (a). Is there any chance that at least the kerning and ligaturing features might be brought back? – Mico Sep 07 '14 at 21:16

0 Answers0