latex3 / luaotfload

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

OpenType Variable fonts: `mode=node` creates non-PDF/A-compliant files #256

Open drs-p opened 1 year ago

drs-p commented 1 year ago

I noticed that the Node renderer, when used with OpenType Variable fonts, leads to pdf files that are not PDF/A-compliant. A minimal example (using this font):

\DocumentMetadata{
    lang = {en-US},
    pdfstandard = A-1b,
}
\documentclass{article}
\font\testfont = [SourceSerif4Variable-Roman.ttf]:axis={wght=900}
\begin{document}
\testfont Hello, world!
\end{document}

Running the verapdf validator on the resulting pdf document gives many errors of the type

Glyph width 788 in the embedded font program is not consistent with the Widths entry of the font dictionary (value 756)

It appears as if the font dictionary contains the widths for the default value of the weight axis, rather than for the generated instance. The Harf renderer produces correct output.