Closed Bug 83250 Opened 24 years ago Closed 24 years ago

gfx/gtk TryFamily() can pick up wrong fonts on Mozilla Mail

Categories

(Core :: Internationalization, defect)

Sun
Solaris
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: masaki.katakai, Assigned: masaki.katakai)

Details

Attachments

(2 files)

I have mentioned about this problem before, I didn't find the exact reproduce case at that time. But I found the exact reprodue case that 1. specify -sun-gothic- font for japanese 2. open Mozilla mail 3. View japanese message -> daewoo-gothic-ksc5601.1987-0 is used The daewoo-gothic-ksc5601.1987-0 font is for korean, not for japanese. It seems that TryFamily("gothic") is called on Mozilla mail and TryFamily() does not care font language (we haven't put fixes into TryFamily()). I'm not sure why TryFamily("gothic") is called only on Mozilla Mail. Not sure it is correct behavior or not. Second, should we consider language also in TryFamily()? FindFont(a/0x0061), nsFontMetricsGTK.cpp 3630 FindStyleSheetSpecificFont, nsFontMetricsGTK.cpp 3212 familyName = gothic, nsFontMetricsGTK.cpp 3223 TryFamily daewoo-gothic-ksc5601.1987-0, nsFontMetricsGTK.cpp 3170 load font daewoo-gothic-ksc5601.1987-0, nsFontMetricsGTK.cpp 2675 TryFamily dt-gothic-jisx0208.1983-0, nsFontMetricsGTK.cpp 3170 load font dt-gothic-jisx0208.1983-0, nsFontMetricsGTK.cpp 2675 TryFamily dt-gothic-jisx0201.1976-0, nsFontMetricsGTK.cpp 3170 load font dt-gothic-jisx0201.1976-0, nsFontMetricsGTK.cpp 2675
Technically the CSS spec does not mention encoding but clearly this is an important element to consider. It seems reasonable to have TryFamily consider font lang groups. Katakai, could you work on this?
OK, I'll take this.
Assignee: bstell → katakai
Changing QA contact to katakai@japan.sun.com for now.
QA Contact: andreasb → katakai
Attached patch proposed patchSplinter Review
I've attached the patch. Brian, can you check? In TryFamily(), I just call TryLangGroug() with "*-familyname-*-*" pattern, which will be expanted to "-*-familyname-<langgroup's registry> -<langgroup's encoding>". gFamilies is still needed in nsFontMetricsGTK::FamilyExists(), which is called by upper side and it's static. There is no way to get language group here, so I did't make any changes here. nsFontMetricsGTK::FamilyExists() still searches as "*-familyname-*-*" pattern (without language registry and encoding) but it would be OK because nsFontMetricsGTK::FamilyExists() returning TRUE means the family may exist for the language group. In nsFontMetricsGTK::TryFamily(), the followng check would not be necessary. What do you think? nsFontFamily* family = FindFamily(aName); if (family) {
Status: NEW → ASSIGNED
the current code calls TryFamily() which a name like "times new roman" (FindStyleSheetSpecificFont) so it does not have any info that would help determine a lang group. Using the doc's/elements's lang group, mLangGroup, is good. If this search fails should the code search for a font of this name regardless of lang group?
Thanks for comments, Brian. Yes, I think we should do that because family name can be specified by user and user expect different font of charset encoding. 1. try family name with doc's/elements's lang group 2. if fails, search the family name without lang group I've attached the patch. Can you check?
Blizzard, Requesting sr= for trunk. Please refer the last my comment of 2001-06-19 20:26 how we change the TryFamily() with considering language group as top priority.
sr=blizzard
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified on 2002011614 trunk build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: