Closed Bug 1137588 Opened 5 years ago Closed 5 years ago

Text in vertical writing mode is lower than its containing inline box

Categories

(Core :: Layout: Text and Fonts, defect)

ARM
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: xidorn, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Attached file testcase
See attachment. On Android and B2G, the position of the text in vertical writing mode is a little lower than the inline box containing it. It seems to happen only for upright characters.
Attachment #8570326 - Attachment filename: ruby-vertical.html → span-vertical.html
Attached image screenshot
I suspect that this bug probably causes bug 1136067.
Blocks: 1136067
Yes, that looks likely.

I wonder if this may also be related to the incorrect sizing described in bug 1137582. I'll try to look into this next week, when I'm back from PTO.
Though bug 1137582 has been fixed, it seems this bug still exists.
This appears to be an issue with particular fonts. I can reproduce a it on OS X desktop by explicitly using the Droid Sans Fallback font, for example, or MotoyaLMaru; but TakaoPGothic, in contrast, renders fine.
Turns out there are two bugs here. First, gfxHarfBuzzShaper doesn't read 'vmtx' tables correctly -- it ignores the second (sidebearing-only) array, if present. Fixing this gives us correct results with fonts like MotoyaLMaru, which make use of the monospaced optimization.
Attachment #8582512 - Flags: review?(jdaggett)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Second problem is that when no 'vmtx' table is present, we return a vertical origin based on the 'hhea' ascent, which is often too large because we're using the em height as the default advance. Adjusting this gives us a better result with fonts like Droid Sans Fallback that lack any 'vmtx' table.
Attachment #8582514 - Flags: review?(jdaggett)
Attachment #8582512 - Flags: review?(jdaggett) → review+
Attachment #8582514 - Flags: review?(jdaggett) → review+
https://hg.mozilla.org/mozilla-central/rev/44625300e010
https://hg.mozilla.org/mozilla-central/rev/986f5faf4655
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.