bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

bold/italic causes fallback to default font (if 'real' bold/italic font is not present)



Core Graveyard
GFX: Win32
14 years ago
7 years ago


(Reporter: Rahul Narain, Unassigned)


Windows ME

Firefox Tracking Flags

(Not tracked)



(1 attachment)



14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1
Build Identifier: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1

If a bold or italic version of the specified font is not physically present (as
a .ttf file in Windows' Fonts folder), then bold or italic text is displayed in
the default font. I have Lucida Sans Unicode, but not Lucida Sans Unicode Bold,
etc. (unlike other fonts), so text in Lucida turns into Georgia when bolded or

However, even if the required variant isn't physically present, it should still
be available.
Windows can apply 'faux' bold/italic to fonts automatically if a real variant
isn't available (it seems to simply widen the strokes and/or shear the
characters). An option for Lucida Bold is present in the Windows font selector.
I can even use it as the display font in Notepad. For all purposes, I "have"
Lucida Bold and Italic on my computer.
There's probably a built-in OS feature for this that Mozilla doesn't know of.

Reproducible: Always
Steps to Reproduce:
1. Go to your Fonts folder. Move the bold, italic, and bold italic variants of
Georgia into some other directory (so that you can put them back later).
2. Just to check, open Notepad and go to Edit -> Set Font. You should still have
options for Georgia Bold, Italic etc, though they'll look different (because
they're fake).
3. Open a page in Mozilla with text in Georgia bolded or italicised.
Actual Results:  
The bolded or italicised text appears in Mozilla's default font.

Expected Results:  
The text should appear in the 'fake' variants of Georgia.

Comment 1

14 years ago
Created attachment 152273 [details]
Test case

Test case with Georgia normal, bold, and italic.
Remove Georgia Bold and Georgia Italic etc from your Fonts folder, then compare
IE's and Mozilla's rendering.
(CSS font-family is set to fall back to sans-serif, to make the problem easier
to see.)

Comment 2

14 years ago
Mhh, hard to fix and mabe not worth the effort IMHO.
Fixing this would need to teach to "guess" what font to use if it fails to find
the one defined by the page. Look: Mozilla is set to use it default font if the
defined one can`t be found. Actually Windows hndles those  as diffenrent fonts,
it uses different files. 
So on the one hand I can confirm this, on the other hand I belive it shouldn`t
be fixed, cause Mozilla _should_ use the default font if the page-defined one
can`t be found

Comment 3

14 years ago
Okay... I know this is a somewhat obscure (non?)bug, and isn't likely to show up
at all in normal use. But I felt Mozilla's behaviour wasn't exactly the Right Thing.

I just figured Mozilla would request Windows for the required font, and would
use the default if Windows can't provide. Are you saying Mozilla actually goes
and looks at font files?

My reasoning was basically this:
1. The document specifies a certain variant (bold) of a certain typeface (Georgia).
2. Windows can give you the required font, with no extra work at your end. (This
is just conjecture, but considering Notepad gets the font, well...)
3. If Windows is willing to give you its version of Georgia Bold, why not use it?

Comment 4

14 years ago
Well, this one is a rather tricky problem.

Mozilla uses the WIN32 API (as does Notepad AFAIK). This API allows Mozilla to
request a particular font by using the full font name (i.e. Georgia Bold). If
the font doesn't exist then Mozilla reverts to the default font as defined in
Mozilla or in Windows.

Now, the WIN32 API has a CreateFont function. But it is messy, and has the
potential to cause more leaks in the GDI (which we already have too many of).

I think this issue boils down to a Mozilla Policy decision. If the font doesn't
exist should Mozilla use the default font, or use CreateFont to make the font?
And, what do other platforms do if the requested font doesn't exist?

Adding asa to cc list for his thoughts...
Assignee: nobody → win32
Component: Layout: Fonts and Text → GFX: Win32
QA Contact: core.layout.fonts-and-text → ian

Comment 5

14 years ago
Strange, it seems to be working fine now.
I uninstalled Adobe Type Manager and the bug disappeared. It's working even
after reinstalling ATM. (I also installed Firefox 0.9.2, but that's probably not
important. Some other fonts on my system were screwed up, and are now okay, so
it probably was a faulty ATM install.)
Can someone go through my testcase and close this bug?

Comment 6

14 years ago
Just ran thru the test criteria, and I can confirm WFM under WinXP.
Last Resolved: 14 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.