On 05.02.2025 06:18, Tilman Hausherr wrote:
On 04.02.2025 22:13, luca boncompagni wrote:
I think that in that way I have a double copy of the Montserrat-Regular.
Is it possible to fill the charwidth array with the correct size or
read the char width from the fullEmbed font?
No, for several reasons: The one downloaded is not the same font.
Yours is smaller and is also missing the TrueType "post" table so I
can't open your font with PDType0Font.load(). I could of course open
the downloaded font that way and move the widths table but I expect
more troubles because it's a different amount of glyphs. I believe
your font is actually a subset, but poorly done by the creator of that
PDF ("This is LuaHBTeX, Version 1.18.0 (TeX Live 2025/dev/Debian)").
The font in the page content stream shouldn't be the same as the one
in the acroform default resources. The font is not only missing the
widths, it is also missing entries in the /ToUnicode stream which
means that this would have to be fixed as well.
I had another idea, replace the page font as well. However that didn't
work, the page now looks like this:
That's because the two fonts aren't identical.
Tilman