latex3 / luaotfload

OpenType font loader for LuaTeX
Other
56 stars 6 forks source link

Renderer=Basic sometimes munches on characters. #241

Open michaelcadilhac opened 1 year ago

michaelcadilhac commented 1 year ago

(From this stackexchange question)

MWE:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Renderer=Basic]{TeX Gyre Pagella}

\begin{document}
rrrrrrvrrrrr

a-\emph{b}
\end{document}

When rendered using lualatex, the emphasized "b" does not appear; any text put after the "b" will also be suppressed. If I change the v for an r in the first string, then the "b" appears. Same thing if Basic is changed to Node.

Context: This setmainfont appears in the default tufte-book configuration.
Versions: This is LuaHBTeX, Version 1.15.0 (TeX Live 2022/Arch Linux), fontspec 2022/01/15 2.8a

zauguin commented 1 year ago

This is caused by two LuaTeX engine bugs. I send possible fixes to the developers (https://mailman.ntg.nl/pipermail/dev-luatex/2022-November/006709.html and https://mailman.ntg.nl/pipermail/dev-luatex/2022-November/006710.html) but even if they get merged the fix will only be available with the next TeX Live version (aka. TeX Live 2023).

This shouldn't affect fonts used in math mode though and outside of math mode there are almost no good uses for Renderer=Basic, so for now the best solution is not to do that.

Context: This setmainfont appears in the default tufte-book configuration.

That's a tufte-book bug and should probably be reported. Setting Renderer=Basic for the main text font effectively disables modern font handling and will most likely break whenever non-english text is used.