Open brianary opened 1 year ago
Redirected from webcompat/web-bugs#121314
The code chart PDF renders correctly in Chrome, Edge, and SumatraPDF.
Interestingly it works with disableFontFace=true
set, and the glyphs look reasonable in FontForge, so I wonder if this could perhaps indicate a bug in the Windows font-renderer?
@calixteman Can you reproduce this in non-Windows operating systems?
I can reproduce on windows 11 either but it's fine on mac os 13.3.1 and on Fedora 37.
And the rendering is wrong (the same as in Firefox) in Acrobat on Windows and on Mac.
On Windows, the right leg of the X in STX is wrongly rendered in Chrome viewer (it depends on the zoom level) and in the new Edge one (where SOH is correct)
I extracted the font in using the debugger and I used ttx
to convert it into an xml format.
In the glyph 0067 I removed all the instructions
and then compiled the ttx into a ttf: SOH is correctly displayed.
Those instructions are used to help to correctly rescale glyphs (https://learn.microsoft.com/en-us/typography/opentype/spec/ttch01#what-are-instructions).
If Firefox on Windows, if the pdf is rescaled with a low zoom value, then the rendering of SOH is still wrong but different.
It's working correctly in Fontforge or with disableFontFace=true
because I think only the contours are used here and not the instructions.
So my feeling is that the font itself is buggy and I don't really know what we could do.
Few glyphs (like the SOH) contains some contours with only 1 point and it doesn't really make sense. I'm a bit reluctant to just strip them out because if the instructions take them into account then the rendering will be wrong, hence my idea is just to remove the hints in such a case: the potential negative side effect could be to have some "not nice" glyphs when they're rescaled. Let's try a patch and we'll see if they're some regressions...
Attach (recommended) or Link to PDF file here:
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot) What went wrong? (add screenshot)
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):