I have an issue in combination with the fontspec package and a ttf/otf font I am developing:
Kerning works fine in XeLaTeX (and e.g. in browsers etc.), but kerning is only partially applied in LuaLaTeX.
In accordance with option 3 in the first reply to How to report a bug in LuaTeX? I am reporting the LuaLaTeX issue here.
(According to Why does kerning work with LuaLaTex but not XeLaTex for the same font? kerning in LuaLaTeX is done completely differently than in XeLaTeX, so I am presuming the issue is not related to the fontspec package at all, nor to XeLaTeX.)
Details:
The font I am developing is based on some glyphs from Fredrick Brennan's monospaced hyperrealistic "TT2020" font, see https://ctrlcctrlv.github.io/TT2020/docs/moreinfo2.html
The trick in "TT2020" is that a GSUB table defines 9 slightly different glyphs for every type to emulate natural variations (e.g. glyphs named "a", "a.2", ..., "a.9").
TT2020 works well for me with TeXLive 2021 in both XeLaTeX and LuaLaTeX, characters are correctly rotated through the 9 glyphs.
The font I am developing in addition defines kerning between glyphs in a GPOS table (and a kern table), and works fine in fairly recent web browsers, on the Mac, as well as with TeXLive 2021 in XeLaTeX. But with TeXLive 2021 in LuaLaTeX kerning only works in some cases.
Here is a test document:
\documentclass{article}
% Commented out after comment by Davis Carlisle below
%\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{fontspec}
\begin{document}
% Replaced after comment by Marcel Krüger further below
\setmainfont{Jackwriter.ttf}
%\setmainfont{Jackwriter}[UprightFont=[Jackwriter.ttf]]
\lipsum[1]
xxxxxxxxxxxxxxxxxx
iiiiiiiiiiiiiiiiii
\end{document}
The referenced font is here:
The above source rendered:
- https://www.artecat.ch/jexler/kerning/kerning-xelatex.pdf
- https://www.artecat.ch/jexler/kerning/kerning-lualatex.pdf
The missing kerning in the LuaLaTeX output is maybe most obvious in the last line with the many "iiiiiii"s. (Since the font is based on a typewriter font, missing kerning does not show between all letters anyways. Note also that so far I only defined kerning between all lowercase glyphs but only partially for most other glyphs.)
Versions used according to console output:
- XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2021) (preloaded format=xelatex)
- LuaHBTeX, Version 1.13.0 (TeX Live 2021)
- LaTeX2e <2020-10-01> patch level 4
- L3 programming layer <2021-02-18>
Mac OS Catalina: 10.15.7 (19H524)
\usepackage[T1]{fontenc}
in a luatex/xetex document, that is forcing 8bit fonts (fortunately you have it before fontspec so it is over-ridden and does nothing)