Closed Bug 1562733 Opened 4 months ago Closed 4 months ago

Incorrect positioning of glyphs that have positional offsets in vertical writing modes when WebRender is enabled

Categories

(Core :: Graphics: Text, defect, P2)

Unspecified
All
defect

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(4 files)

Attached file hoefler.html

See testcase on macOS with webrender enabled and coretext disabled. The "o" of "World" is misplaced in the vertical elements.

Further testing shows this isn't related to HarfBuzz vs Core Text shaping; it appears to be an issue with any glyphs that have positional offsets applied in the textrun DetailedGlyph record. It happened to show up under HarfBuzz shaping of fonts like Hoefler Text because of how HB implements the kerning: it applies positional offsets to the glyph, in addition to adjusting its advance. I presume Core Text, OTOH, did the kerning purely through manipulating glyph advances.

But similar -- and worse -- issues can be seen with complex fonts that have a lot of glyph positioning going on, such as Urdu Nastaliq faces; see next testcase, which expects the Awami Nastaliq[1] and Noto Nastaliq Urdu[2] fonts to be installed.

[1] https://software.sil.org/awami/download/
[2] https://noto-website-2.storage.googleapis.com/pkgs/NotoNastaliqUrdu-unhinted.zip

Summary: Incorrect kerning in AAT fonts when shaped with HarfBuzz for vertical writing modes when WebRender is enabled → Incorrect positioning of glyphs that have positional offsets in vertical writing modes when WebRender is enabled

With WebRender disabled, the vertical-writing-mode elements render fine. But with WR enabled, both Awami Nastaliq (shaped via Graphite) and Noto Nastaliq Urdu (shaped by HarfBuzz) are badly scrambled, because glyph position offsets are applied incorrectly.

OS: macOS → All
Component: Layout: Text and Fonts → Graphics: Text

The sideways-rl test is fuzzy (even without webrender) because we get a 1px discrepancy
in baseline positioning for the rotated text; presumably the rotation done by sideways-rl
and that done by CSS transform end up rounding the center of rotation differently. That's
probably a bug we should fix, although offhand I'm not sure which is more correct; anyhow,
it's a separate issue from the bug here.

When WebRender is enabled, the test/reference difference is much greater because many of
the glyphs are wildly misplaced, not just shifted by 1px, so it still fails despite the
fuzzy() annotation.

Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/390026b06bf3
Add reftests using Noto Nastaliq in vertical (sideways) writing mode. r=lsalzman
https://hg.mozilla.org/integration/autoland/rev/54484717fcf9
Properly transform DetailedGlyph offsets when rendering vertical (rotated) text through webrender. r=lsalzman
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Assignee: nobody → jfkthame
You need to log in before you can comment on or make changes to this bug.