Glitch in COLRv1 glyph rendering
Categories
(Core :: Graphics: Text, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox107 | --- | affected |
People
(Reporter: khaled, Unassigned)
Details
Attachments
(6 files)
There is a glitch in rendering a glyph of a COLRv1 font, comopared to Google Chrome and FontGoggles.
| Reporter | ||
Comment 1•3 years ago
|
||
| Reporter | ||
Comment 2•3 years ago
|
||
| Reporter | ||
Comment 3•3 years ago
|
||
Comment 4•3 years ago
|
||
This seems to be an issue with how Core Text handles the glyph outlines in the font -- maybe to do with Winding vs Even-Odd fill rules, or something like that. I modified the font to map character codes to the individual glyph elements, and notice that in both Safari and Firefox (which uses Core Text), the meem-ar.fina.0 and meem-ar.fina.1.1 glyphs render with the left-hand "tip" as a disjoint fragment, separated by a gap from the loop instead of joined by a continuous line. This is different from how Chrome (presumably using FreeType) renders it.
Comment 5•3 years ago
|
||
Comment 6•3 years ago
|
||
So Khaled, I'm guessing (without having analyzed the actual glyph paths properly) that you may need to do a "correct path directions" operation or something like that to ensure consistent rendering.
Comment 7•3 years ago
•
|
||
Using -webkit-text-stroke, we can see that the glyph is composed of several subpaths, and apparently Core Text fails to render one of them when it fills the glyph. So that's the one to particularly check.
Updated•3 years ago
|
| Reporter | ||
Comment 8•3 years ago
|
||
Thanks Jonathan for the analysis, that was very helpful.
It wasn’t the path direction per se (or may be not only the path direction), but the fact that one of the subpaths was redundant as it was a subset of the other subpath is overlaid, so removing it fixed the rendering.
It is a CoreText not Firefox issue and there is an easy way to fix the font, so I think this issue should be closed.
Comment 9•3 years ago
|
||
Ah, that explains it. Glad you were able to identify and fix the issue. Closing this as Invalid, as there's not a bug here for us to address in Firefox.
Incidentally, while I haven't confirmed what the OpenType/CFF spec has to say about this (I'm not sure if the Core Text rendering is a bug, or if the spec is unclear....?), I notice that the issue also appears even in Chrome Canary in the Print preview panel, and in saved PDF output. Maybe their print codepath also uses Core Text rendering rather than the bundled FreeType?
| Reporter | ||
Comment 10•3 years ago
|
||
It seems Chrome uses FreeType for COLRv1, and if I remove the color tables and try to show meem-ar.fina.0, I get the same issue as here.
Description
•