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

RESOLVED FIXED in mozilla37

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jfkthame, Assigned: jfkthame)

Tracking

(Blocks 1 bug)

unspecified
mozilla37
All
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
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).
(Assignee)

Updated

4 years ago
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
(Assignee)

Comment 1

4 years ago
I think this fixes things here; will flag for review once I've tested a bit more.
(Assignee)

Updated

4 years ago
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
(Assignee)

Comment 2

4 years ago
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+
https://hg.mozilla.org/mozilla-central/rev/e5e4ceeb399a
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.