incorrect font used for italicized Arabic text when font-family is Arial or Times New Roman

RESOLVED FIXED in Firefox 16



Layout: Text
5 years ago
5 years ago


(Reporter: jfkthame, Assigned: jfkthame)



Windows 7

Firefox Tracking Flags

(firefox16 fixed)



(2 attachments, 1 obsolete attachment)



5 years ago
Created attachment 637700 [details] [diff] [review]
patch, don't forget to check other styles of the first font in the group

The optimization of gfxFontGroup::FindFontForChar in bug 764005 regressed the behavior of italicized Arabic text in font families such as Times New Roman and Arial on Windows, where the regular face includes Arabic characters but the italic face does not.

This was previously fixed in bug 668813, but the optimization in 764005 bypassed that fix in the case where the "problem" family is the first in the font-group's list.

An example that shows the problem is attachment 594315 [details] (from bug 668813); on Windows, this should render using Arial with synthetic italicization (oblique), but in current Nightly it falls back to a different font such as Microsoft Uighur.

The patch here fixes the problem, while still allowing the vast majority of calls to take the optimized early-return path.
Attachment #637700 - Flags: review?(smontagu)


5 years ago
Keywords: regression

Comment 1

5 years ago
Created attachment 638699 [details] [diff] [review]
patch v2, don't forget to check other styles of the first font in the group

Here's a better version of the patch, factoring out a TryOtherFamilyMembers helper method.
Attachment #637700 - Attachment is obsolete: true
Attachment #637700 - Flags: review?(smontagu)
Attachment #638699 - Flags: review?

Comment 2

5 years ago
Created attachment 638700 [details] [diff] [review]

And a reftest (for OS X and Windows) to go with it.
Attachment #638700 - Flags: review?
Comment on attachment 638699 [details] [diff] [review]
patch v2, don't forget to check other styles of the first font in the group

Review of attachment 638699 [details] [diff] [review]:

Thanks to bletch on IRC for drawing this to my attention
Attachment #638699 - Flags: review? → review+
Attachment #638700 - Flags: review? → review+

Comment 4

5 years ago
Oops, it looks like I failed to attach a name to the r? request - sorry! Thanks for picking this up.
Target Milestone: --- → mozilla17

Comment 5

5 years ago
Sorry, had to back out for failures in arial-arabic.html on Windows:
Target Milestone: mozilla17 → ---

Comment 6

5 years ago
Sigh - looks like a single-pixel line height discrepancy, for some reason - probably something about how we round metrics (there's an open bug on that, iirc).

I've added an explicit line-height to the test/reference, and pushed to tryserver to see if that makes it happy.

Comment 7

5 years ago
...and that tryserver job burned on windows, apparently due to bug 776503.

I've re-pushed a try job based on a slightly earlier inbound changeset, in hopes that might avoid the build issue and let us confirm that the new test passes.

Comment 8

5 years ago
Re-landed the patch (unchanged) and test (fixed).

According to, this version passes on Windows (using an explicit line height in the test, to avoid issues with rounding metrics from the font).
Target Milestone: --- → mozilla17

Comment 9

5 years ago
Last Resolved: 5 years ago
Resolution: --- → FIXED

Comment 10

5 years ago
Comment on attachment 638699 [details] [diff] [review]
patch v2, don't forget to check other styles of the first font in the group

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 764005

User impact if declined: incorrect font selection for italic-styled Arabic text when font family is Arial or Times New Roman - we fall back to a different font family

Testing completed (on m-c, etc.): patch has been in Nightly for several weeks; also has a reftest

Risk to taking this patch (and alternatives if risky): minimal risk - just reinstates the fix from bug 668813 that was improperly bypassed by one of the optimized codepaths in 764005

String or UUID changes made by this patch: none
Attachment #638699 - Flags: approval-mozilla-aurora?
Attachment #638699 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+

Comment 11

5 years ago
status-firefox16: --- → fixed
You need to log in before you can comment on or make changes to this bug.