Closed Bug 1118943 Opened 10 years ago Closed 10 years ago

freetype font backend does not necessarily set mFUnitsConvFactor for vertical fonts, leading to broken rendering

Categories

(Core :: Graphics: Text, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

If a font is used only for vertical metrics/layout, the FT2 backend fails to ensure mFUnitsPerDevUnit is set appropriately, and this can lead to totally broken shaping -- glyph advances return zero, for example, so everything overprints. I can reproduce the brokenness with a trunk build on Linux by loading a page such as http://mongolfont.com/test/firefox/div.html and then pressing Ctrl-+ to zoom in. The initial rendering of the page looks fine, but after it zooms, the Chinese rendering is borked, although the Japanese looks fine (I think this has something to do with the fact that the Chinese text ends up using several font faces on my configuration). Also, in a debug build, the assertion "mFUnitsConvFactor not valid" fires (lots).
Summary: freetype font backend does not necessarily set mFUnitsPerDevUnit for vertical fonts, leading to broken rendering → freetype font backend does not necessarily set mFUnitsConvFactor for vertical fonts, leading to broken rendering
I think this fixes things here; will flag for review once I've tested a bit more.
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Comment on attachment 8545517 [details] [diff] [review] Ensure mFUnitsConvFactor is set up properly for vertical fonts in the FT2 backend This also fixes a couple of weird reftest failures I've been seeing on B2G tests, which were presumably due to the messed-up metrics.
Attachment #8545517 - Flags: review?(smontagu)
Comment on attachment 8545517 [details] [diff] [review] Ensure mFUnitsConvFactor is set up properly for vertical fonts in the FT2 backend Review of attachment 8545517 [details] [diff] [review]: ----------------------------------------------------------------- (In reply to Jonathan Kew (:jfkthame) from comment #0)> > I can reproduce the brokenness with a trunk build on Linux by loading a page > such as http://mongolfont.com/test/firefox/div.html and then pressing Ctrl-+ > to zoom in. The initial rendering of the page looks fine, but after it > zooms, the Chinese rendering is borked, although the Japanese looks fine (I > think this has something to do with the fact that the Chinese text ends up > using several font faces on my configuration). Also, in a debug build, the > assertion "mFUnitsConvFactor not valid" fires (lots). FTR, on my system both the Chinese and the Japanese are borked before the patch and fine after it.
Attachment #8545517 - Flags: review?(smontagu) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: