Closed Bug 1794295 Opened 3 years ago Closed 3 years ago

Glitch in COLRv1 glyph rendering

Categories

(Core :: Graphics: Text, defect)

Firefox 107
x86_64
macOS
defect

Tracking

()

RESOLVED INVALID
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.

Attached file Test file
Attached file Test font

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.

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.

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.

Severity: -- → S3

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.

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?

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID

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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: