Open Bug 698809 Opened 8 years ago Updated 5 years ago

The GDI font enumerator should not list Courier as a supported font

Categories

(Core :: Graphics, defect)

x86
Windows XP
defect
Not set

Tracking

()

People

(Reporter: rain1, Unassigned)

References

Details

Bug 454532 caused Courier to always be substituted with Courier New. If this happens then it's as if Courier doesn't exist for us, and the GDI font enumerator's EnumerateFonts and EnumerateAllFonts functions shouldn't be listing it at all, I think.
Blocks: 698238
No longer blocks: 698328
Hmm, not sure I agree with this.  The font enumerator lists fonts on the system.  The font 'Courier' on XP systems is an old junky .FON font while 'Courier New' is a TrueType font.  Bug 454532 added 'Courier' to the list of fonts for which we do substitutions.  I don't see why this means we need to exclude it from the font list.
Here's an STR for something that breaks:
1. Make sure Firefox is in GDI mode (i.e. d2d/dwrite is disabled).
2. Open the advanced font dialog in Tools/Options/Content.
3. Choose Courier in the dialog.
4. Close both pref windows and open them up again.

Note that Courier New is selected instead. (This is precisely what we hit in bug 698238.) It seems contrary to expectations to be able to select Courier then have that yanked out and a different font selected.

I guess an alternative is to have another API which does filter out substituted fonts, but I couldn't find an easy one when I looked. The best it seems one could do is enumerate all the fonts then use getStandardFamilyName + a dictionary to filter out fonts that aren't used.
What happens if the user installs a font named, say, "Times" or "Helvetica" (for which there are by default substitutions defined in the registry) - will those fonts be inaccessible, always replaced by the substitutes? My expectation as a user would be that Windows font substitutions are a fallback, to be used if the specified font is not available, rather that taking priority over it.

Which suggests to me that the Courier -> Courier New substitution, for the purpose of fixing a printing problem, is being done in the wrong place; and also that font substitution in general (based on the registry entries) may also be happening at the wrong level, though this would rarely be noticed as a problem in practice.
Yeah, I'm pretty sure font substitution only happens if the font isn't present. The Courier -> Courier New replacement is an override, not a substitution.
You need to log in before you can comment on or make changes to this bug.