latex3 / luaotfload

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

missing quotation marks in \fontname with harfbuzz #285

Open Udi-Fogiel opened 5 days ago

Udi-Fogiel commented 5 days ago

run with luahbtex

\input luaotfload.sty

\font\foo="name:TeX Gyre Termes:mode=harf"\relax
\fontname\foo

\font\foo="name:TeX Gyre Termes"\relax
\fontname\foo

\bye

This is causing problems in LaTeX as the kernel assume \fontname can be fed up to \font back again, and since the font name has spaces and \fontname does not have any protection (no braces, nor quotation marks) this leads to errors. See https://tex.stackexchange.com/questions/721772/conflict-between-setmainfont-and-mainmatter.

Udi-Fogiel commented 5 days ago

BTW, if the quotation marks or braces are just for escaping spaces, wouldn't removing them and the spaces will be easier?

u-fischer commented 5 days ago

I guess that is a similar problem to https://github.com/latex3/fontspec/issues/486

zauguin commented 1 day ago

Fixed in dev with 80c94d69e9832900f09fb81460d6c279ee1be474, but the underlying issue is that patch_font callbacks do not run for harf fonts. I'm wondering if that might have other effects too. It's probably not safe to chsnge though since these fonts do look very different and aren't very patchable.