Closed
Bug 983985
Opened 10 years ago
Closed 10 years ago
Italic text is not displayed correctly if the text contains hexbox and if the italic style is synthesized
Categories
(Core :: Graphics: Text, defect)
Core
Graphics: Text
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: emk, Assigned: jfkthame)
References
(Depends on 1 open bug)
Details
(Keywords: regression)
Attachments
(4 files)
15.00 KB,
image/png
|
Details | |
7.49 KB,
image/png
|
Details | |
2.49 KB,
patch
|
bas.schouten
:
review+
Sylvestre
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
3.69 KB,
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
Steps to reproduce: 1. Set the default sans-serif font to MS PGothic and default family to sans-serif (it is the default of Japanese localization.) 2. Open http://glyphwiki.org/wiki/Special:Recentchanges?view=50&hidebots=1&hideauto=1&listtype=document&offset=1262040 and see the text "(resolved
Reporter | ||
Comment 1•10 years ago
|
||
Oops, I forgot bugzilla dislikes non-BMP characters. 2. Open http://glyphwiki.org/wiki/Special:Recentchanges?view=50&hidebots=1&hideauto=1&listtype=document&offset=1262040 and see the text "(resolved [0F7AB4] vs [0F7823])" and "(resolved [0F7AB0] vs [0F781C])" (Actually [0F7xxx] is a hexbox) Actual result: Text display is incorrect. Expected result: Text display should be correct. If I set the default sans-serif font to Meiryo, it displayed correctly (Meiryo has an italic variant).
Assignee | ||
Comment 2•10 years ago
|
||
Could you please attach a screenshot of the problem? Thanks.
Reporter | ||
Comment 3•10 years ago
|
||
Reporter | ||
Comment 4•10 years ago
|
||
Reporter | ||
Comment 5•10 years ago
|
||
Although I took this capture on a 192dpi monitor, it is also reproducible on a normal 96dpi monitor.
Assignee | ||
Comment 7•10 years ago
|
||
Also reported on OS X, see bug 1060749. => platform:all. Marking as a regression, as I believe this didn't happen until we enabled Azure content.
Assignee | ||
Comment 8•10 years ago
|
||
Reduced testcase that shows the bug on OS X, using an unassigned codepoint to try and ensure we get a hexbox even if extra fonts are installed: data:text/html,<span style="font: italic 24px monaco">Note: `&%23x0530;` is U+0530 The Monaco font is specified because it does *not* have a separate italic face, and so a synthetic-italic skew transform will be applied. That, together with rendering a hexbox, appears to be what triggers the bug.
Assignee | ||
Comment 9•10 years ago
|
||
The main problem here occurs because gfxFontMissingGlyphs::DrawMissingGlyph calls aContext->Save(); ... aContext->Restore(); on the gfxContext, and this (even with no code in between) modifies the matrix of the DrawTarget. This interferes with the font code's use of a skew matrix on the DrawTarget to implement fake-italics for fonts that don't have a real italic face. I don't really know anything about how the interaction between gfxContext and DrawTarget is supposed to work, but it seems intuitively wrong that a simple Save/Restore pair should have this side-effect. I'll file a separate Graphics bug about this. In any case, however, I think we want to remove the skew transform from the DrawTarget when rendering missing-glyph hexboxes, as they will not stand up to skewing well (and we don't skew them when they occur within a run of true italic text). We can do this by saving, modifying and restoring the matrix around the call to DrawMissingGlyph in the case where we're using a fake-italic skew for the current run.
Assignee | ||
Comment 10•10 years ago
|
||
Filed bug 1060762 for the gfxContext::Save/Restore problem. Marking it as blocking this to indicate the relationship, as it is the immediate cause of the garbled rendering, although I'm actually intending to work around the issue here by removing the fake-italic skew before calling DrawMissingGlyph.
Depends on: 1060762
Assignee | ||
Comment 11•10 years ago
|
||
This appears to resolve the problem on OS X; not yet tested on Windows. I still think the behavior of Save/Restore is broken (see separate bug), but with this patch, at least it no longer breaks text rendering in this situation.
Attachment #8481776 -
Flags: review?(bas)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Assignee | ||
Comment 12•10 years ago
|
||
Try builds with this patch: https://tbpl.mozilla.org/?tree=Try&rev=130b10075785. Kimura-san, could you confirm whether this fixes the problems you were seeing on Windows? Thanks.
Flags: needinfo?(VYV03354)
Reporter | ||
Comment 13•10 years ago
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #12) > Try builds with this patch: > https://tbpl.mozilla.org/?tree=Try&rev=130b10075785. Kimura-san, could you > confirm whether this fixes the problems you were seeing on Windows? Thanks. Yes, this patch fixed the problems for me.
Flags: needinfo?(VYV03354)
Comment 14•10 years ago
|
||
Comment on attachment 8481776 [details] [diff] [review] remove fake-italic skew from the drawTarget's matrix before rendering a hexbox. Review of attachment 8481776 [details] [diff] [review]: ----------------------------------------------------------------- Makes sense to me.
Attachment #8481776 -
Flags: review?(bas) → review+
Assignee | ||
Comment 15•10 years ago
|
||
Here are a couple of reftests that would have detected the problem here.
Attachment #8481793 -
Flags: review?(bas)
Comment 16•10 years ago
|
||
Awesome! Patch looks innocuous enough so once this lands & sticks, this can be uplifted to 33, I think. I guess the issue does not warrant uplifting for a possible 32.0.1 (or 32.0RC2 if there'll be one) or 31ESR … would be nice, though. (In reply to Jonathan Kew (:jfkthame) from comment #12) > Try builds with this patch: > https://tbpl.mozilla.org/?tree=Try&rev=130b10075785. Kimura-san, could you > confirm whether this fixes the problems you were seeing on Windows? Thanks. Fixes the issue from Bug 1060749 for me as well!
Assignee | ||
Comment 17•10 years ago
|
||
Landed the patch: https://hg.mozilla.org/integration/mozilla-inbound/rev/68e542dad3c1 Reftests not yet landed, pending review.
Target Milestone: --- → mozilla34
Assignee | ||
Comment 18•10 years ago
|
||
Comment on attachment 8481776 [details] [diff] [review] remove fake-italic skew from the drawTarget's matrix before rendering a hexbox. Requesting uplift to Aurora (mozilla-33), but if this isn't processed before the next merge, then please consider this as a request for Beta instead. Approval Request Comment [Feature/regressing bug #]: Azure content rendering (enabled by a variety of separate bugs on different platforms). [User impact if declined]: Garbled text in certain (fairly rare) cases: when a synthetic-italic font is used and the text contains unsupported characters. [Describe test coverage new/current, TBPL]: Patch has landed safely on inbound, passes all current text-rendering tests. Reftests specific to this issue checked locally and on tryserver, will land when reviewed. [Risks and why]: Low risk - only affects the missing-character hexbox codepath; restores the transform it has modified immediately after drawing. [String/UUID change made/needed]: n/a
Attachment #8481776 -
Flags: approval-mozilla-aurora?
Comment 19•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/68e542dad3c1
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Updated•10 years ago
|
Attachment #8481776 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 20•10 years ago
|
||
Rebased and pushed to aurora: https://hg.mozilla.org/releases/mozilla-aurora/rev/b5b25981de3d
Updated•10 years ago
|
Assignee | ||
Comment 21•10 years ago
|
||
Bas: review ping? (reftest patch)
Comment 22•10 years ago
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #21) > Bas: review ping? (reftest patch)
Flags: needinfo?(bas)
Comment 23•10 years ago
|
||
Comment on attachment 8481793 [details] [diff] [review] reftests for hexbox in fake-italic text. Review of attachment 8481793 [details] [diff] [review]: ----------------------------------------------------------------- Sorry for missing this!
Attachment #8481793 -
Flags: review?(bas) → review+
Updated•10 years ago
|
Flags: needinfo?(bas)
Updated•10 years ago
|
Attachment #8481793 -
Flags: checkin?
Updated•10 years ago
|
Keywords: checkin-needed
Comment 24•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3be186980023
Flags: in-testsuite+
Keywords: checkin-needed
Updated•10 years ago
|
Attachment #8481793 -
Flags: checkin?
You need to log in
before you can comment on or make changes to this bug.
Description
•