Closed Bug 297031 Opened 19 years ago Closed 19 years ago

The default font setting on xft enabled firefox is not correct.

Categories

(Firefox :: Settings UI, defect)

Sun
Solaris
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: leon.sha, Assigned: leon.sha)

Details

Attachments

(1 file)

In linux/unix platform, the current default font setting is

pref("font.name.serif.x-western", "adobe-times-iso8859-1");
pref("font.name.sans-serif.x-western", "adobe-helvetica-iso8859-1");
pref("font.name.monospace.x-western", "adobe-courier-iso8859-1");

This is not correct for xft enabled build.
So on some linux platform, the preference->content->fonts & color entry turns to
be generic font. On solaris platform, this entry is blank.
Attached patch PatchSplinter Review
Assignee: nobody → leon.sha
Status: NEW → ASSIGNED
Attachment #185646 - Flags: review?(acarder)
Attachment #185646 - Flags: review?(acarder) → review?(roc)
Comment on attachment 185646 [details] [diff] [review]
Patch

>Index: gfx/src/gtk/nsFontMetricsXft.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp,v
>retrieving revision 1.66
>diff -u -p -8 -r1.66 nsFontMetricsXft.cpp
>--- gfx/src/gtk/nsFontMetricsXft.cpp	16 Feb 2005 17:07:30 -0000	1.66
>+++ gfx/src/gtk/nsFontMetricsXft.cpp	8 Jun 2005 07:39:15 -0000
>@@ -2212,21 +2212,16 @@ EnumFontsXft(nsIAtom* aLangGroup, const 
>         NS_AddLangGroup(pat, aLangGroup);
> 
>     // get the font list
>     fs = FcFontList(0, pat, os);
> 
>     if (!fs)
>         goto end;
> 
>-    if (!fs->nfont) {
>-        rv = NS_OK;
>-        goto end;
>-    }
>-
>     // Fontconfig supports 3 generic fonts, "serif", "sans-serif", and
>     // "monospace", slightly different from CSS's 5.
>     if (!aGeneric)
>         serif = sansSerif = monospace = 1;
>     else if (!strcmp(aGeneric, "serif"))
>         serif = 1;
>     else if (!strcmp(aGeneric, "sans-serif"))
>         sansSerif = 1;

At least the generic font should include in the list even fs->nfont is null.
Can you tell me why the Xft build doesn't need specific font names?
(In reply to comment #3)
> Can you tell me why the Xft build doesn't need specific font names?

There are two reasons.

1. XFT use pattern to find the font. But the specific font names for gtk are not
the real font names. For example, "adobe-courier-iso8859-1" means the font is
"-adobe-courier-*-*-*--0-0-0-0-*-0-iso8859-1". But if you use
"adobe-courier-iso8859-1" as a pattern to find the font, you will not get this
font. This string is too complex. If you use "adobe courier" as a pattern, you
may find the correct font.

2. XFT build use family name as the font list.
http://lxr.mozilla.org/seamonkey/source/gfx/src/gtk/nsFontMetricsXft.cpp#2223
To make it the same, I use the family name here.
Comment on attachment 185646 [details] [diff] [review]
Patch

OK. I want blizzard to give the OK too.
Attachment #185646 - Flags: superreview+
Attachment #185646 - Flags: review?(roc)
Attachment #185646 - Flags: review?(blizzard)
Comment on attachment 185646 [details] [diff] [review]
Patch

Without testing this I _think_ it's OK.  But fontconfig should give you
reasonable defaults in any case.
Attachment #185646 - Flags: review?(blizzard) → review+
Flags: blocking1.8b3?
Attachment #185646 - Flags: approval-aviary1.1a2?
Attachment #185646 - Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
Checking in modules/libpref/src/init/all.js;
/cvsroot/mozilla/modules/libpref/src/init/all.js,v  <--  all.js
new revision: 3.578; previous revision: 3.577
done
Checking in gfx/src/gtk/nsFontMetricsXft.cpp;
/cvsroot/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp,v  <--  nsFontMetricsXft.cpp
new revision: 1.69; previous revision: 1.68
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Flags: blocking1.8b3?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: