Closed Bug 538730 Opened 15 years ago Closed 15 years ago

synthetic bolding on windows broken

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: jtd, Assigned: jfkthame)

References

()

Details

Attachments

(2 files, 2 obsolete files)

After font system changes were checked in for 493280, synthetic bolding is broken (i.e. no bolding occurs for fonts that lack a bold face).  Synthetic italics are fine.

Steps:

Open URL in 2010-01-08-04-mozilla-central version of FF

Result: bolding does not show for the last three rows where fonts without bold faces are specified (or implied in the case of Japanese).
Severity: normal → major
I think the root of the problem is that the new font-list implementation does not create "fake" font entries for bold/italic versions where there are no actual faces in the family. This means that we have to set up GDI to do the synthetic bolding later, when the font is instantiated, and it's not passing this on correctly.

I don't want to revert to the old practice of creating fake font entries (besides the fact that it seems rather kludgey, that's probably one of the places where the new code has reduced RAM footprint significantly). So I'll trace how style information is handled and try to fix it properly in the font instantiation.

I'm surprised we didn't have a reftest that would catch this; obviously, we need to add one.
Things like synthetic rendering are hard to test because it requires some sort of consistency across testing platforms, from Win 2K to misc Linux flavors.  It might make sense to have a required set of testing fonts installed or load those fonts from a folder specified in a pref.
Shouldn't normal rendering always be different bold rendering, regardless of the platform, even if the requested font family is unavailable?
(In reply to comment #3)
> Shouldn't normal rendering always be different bold rendering, regardless of
> the platform, even if the requested font family is unavailable?

Yes, but most of the time you're seeing a normal bold face *not* synthetic bold/italics.  So you need to explicitly pick families that have just a regular face which varies across platforms and versions (i.e. W2K, XP, Vista, Win7).  That said, it should be possible to construct reftests that at least catch a problem in synthetic rendering for common environments.  It won't catch all situations but at least it will catch a majority of them.
Right, you'll need a couple of tests, each with a no-bold-face candidate for some platform.
This also affects certain system fonts such as Microsoft Sans Serif.

Is it permissible to synthesize a bold version of a downloaded font?
This patch should fix the issue on Windows. Includes reftests that should have detected the regression for us.

For some reason, the second reftest failed on Mac OS X when I pushed this to the tryserver; currently investigating this.
The reftests pass for me locally on OS X; I don't know why #2 failed on tryserver. John, can you check if it works for you? If there's a real issue there, we should file it as a separate bug.
Attachment #420941 - Flags: review?(jdaggett)
I've modified the second reftest to prefer Apple Chancery on OS X, and this time it passed as expected on tryserver.
Attachment #420941 - Attachment is obsolete: true
Attachment #420965 - Flags: review?(jdaggett)
Attachment #420941 - Flags: review?(jdaggett)
Comment on attachment 420965 [details] [diff] [review]
patch v1.1 - revised second reftest to use Apple Chancery on OS X

Won't this patch prevent you from actually getting real 800 and 900 weights properly?
(In reply to comment #10)
> (From update of attachment 420965 [details] [diff] [review])
> Won't this patch prevent you from actually getting real 800 and 900 weights
> properly?

Errr.... yes, it would. :( Updated version attached that should handle this - WFM to access all weights of M+ fonts. Just pushed this to tryserver to re-check reftests.
Attachment #420965 - Attachment is obsolete: true
Attachment #420982 - Flags: review?(jdaggett)
Attachment #420965 - Flags: review?(jdaggett)
Attached patch additional reftests (deleted) — Splinter Review
Compare variations of bold, italic for different fonts to be able to catch busted synthetic bold/italic rendering.
Comment on attachment 420982 [details] [diff] [review]
patch v1.2 - fixed to allow faces with weight 800/900 to work

Looks fine.  I think reftests/font-matching would be a better place for the reftests than reftests/text.
Attachment #420982 - Flags: review?(jdaggett) → review+
Blocks: 502906
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: