Closed Bug 765906 Opened 8 years ago Closed 8 years ago

synthetic bold should be used where appropriate with system fallback fonts


(Core :: Graphics: Text, defect)

Not set





(Reporter: jfkthame, Assigned: jfkthame)



(2 files, 1 obsolete file)

Currently, we don't apply synthetic bold to fonts that are found during system fallback. I think this is wrong: it means that elements with "bold" styling are not rendered as expected when fallback is in effect.

For example, on OS X with default fonts installed, view There are several <b> elements within the first couple of paragraphs, but because OS X ships with only a regular face of the Plantagenet Cherokee font, the <b> elements are not visually differentiated from the surrounding text.

Similarly, has a number of <b> elements, but because the Tibetan fonts on OS X only have a regular face, the visual distinction is lost.

This will become a more widespread issue on Android, where it is likely that more scripts will have only a single weight available as devices do not typically ship with anywhere near as rich a collection of fonts as a desktop OS.
Note that this also fixes the existing reftest failure on Android for defaultjapanese-bold.html.
Attachment #634173 - Flags: review?(jdaggett)
A couple of testcases that check we're applying synthetic bold when necessary with a fallback font. These examples are designed to test the issue on OS X, where the scripts being used have only a single-weight family.
Attachment #634324 - Flags: review?(jdaggett)
Attachment #634173 - Flags: review?(jdaggett) → review+
Comment on attachment 634324 [details] [diff] [review]
reftests for synthetic bold with system-fallback fonts

Why do the reftests fail on WinXP/Android?  If it's because of a lack
of fonts that support those scripts, I don't think you should be using
fail-if here but instead random-if(!target).  That way you won't cause
reftest failures on machines that happen to lack fonts for those

Since this patch affects all platforms, I think you should be
including tests for Windows/Android, not just ones targeted at OSX.
Attachment #634324 - Flags: review?(jdaggett) → review-
OK, after entirely too many tryserver runs, here's a revised version of the tests. These cover OS X (all current versions) and Win7 (unaccelerated, using GDI) using a Cherokee script example, as both systems ship the same regular-face-only Cherokee font, and Android using chess symbols.

I don't see an obvious way to test WinXP, due to lack of suitable fonts that we can reliably expect to reach via the system fallback path.

The tests are skipped on Linux because (a) the whole system-fallback codepath is completely different (and largely out of our direct control) in the fontconfig world anyway, so it's not clear what we should test, and (b) my tryserver runs kept hitting bug 769659 on Linux64. That looks like a separate issue we should try to investigate, but shouldn't block this fix.
Assignee: nobody → jfkthame
Attachment #638284 - Flags: review?(jdaggett)
Attachment #638284 - Flags: review?(jdaggett) → review+
Attachment #634324 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.