Closed Bug 642093 Opened 9 years ago Closed 9 years ago

[DWrite] map commonly-used bitmap font names to truetype equivalents

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(1 file)

DirectWrite does not support .fon-format bitmap fonts, but several old bitmap-only fonts shipped with Windows are commonly specified (without appropriate fallbacks) in CSS. This leads to pages rendering in a default (typically serif) font, when the author intended something like MS Sans Serif or Courier. Authors who are not using HW-accelerated systems don't see the problem, so it ends up affecting users, who file bugs against Firefox for using the "wrong" font.

Although this is really an authoring error (should not assume specific fonts are available on the user's platform), we can give a better user experience by mapping these bitmap font names to TrueType equivalents. This will provide more consistent behavior between accelerated and non-accelerated environments. It is worth noting that IE9 appears to perform such substitutions, so this will also give better consistency between FF and IE.
This patch implements substitution for the three bitmap fonts that I think are the most common source of problems. Currently the list of substitutions is hardcoded; if we want more flexibility, we could put it into a preference, but I'm not sure it is worth the added overhead.
Assignee: nobody → jfkthame
Attachment #519614 - Flags: review?(bas.schouten)
Blocks: 641860, 642008, 631193
Comment on attachment 519614 [details] [diff] [review]
patch, v1 - map commonly-used bitmap fonts to truetype versions

Hrm, I thought we already had the ability to do font substitutions with prefs, didn't we? This looks like it should be fine though I suppose.
Attachment #519614 - Flags: review?(bas.schouten) → review+
(In reply to comment #2)
> Comment on attachment 519614 [details] [diff] [review]
> patch, v1 - map commonly-used bitmap fonts to truetype versions
> 
> Hrm, I thought we already had the ability to do font substitutions with prefs,
> didn't we?

Not that I remember, but cc'ing John to see if he knows something I've missed. We do support the registry key "SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes", but that's not part of our prefs.

I've experimented a bit more with IE9, and it looks like they're doing a number of additional mappings for old bitmap fonts:
  "Small Fonts" -> "Arial"
  "Roman" -> "Times New Roman"
  "Script" -> "Mistral"
  "Modern" -> "Courier New"
Perhaps we should include these too, for consistency.
"Modern" -> "Courier New" ?? odd
(In reply to comment #4)
> "Modern" -> "Courier New" ?? odd

Yes, I agree that one seems odd - it's not like they look at all similar, but that's what IE9 seems to be doing. Perhaps we just shouldn't bother with that one, and if anyone actually uses it on a web page they can report a bug against IE for displaying Courier New. :)

I think "Courier", "MS Serif" and "MS Sans Serif" are probably the most important cases, though I recall a bug being filed about "Roman" in the past, too. (That was bug 512183, addressing a somewhat different issue - but it would fail under DWrite, too, just with different symptoms.)
Hi

A BIG THANKS


Bye Bye, Moreno
https://bugzilla.mozilla.org/show_bug.cgi?id=642093
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-cedar]
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.