Closed Bug 256257 Opened 20 years ago Closed 20 years ago

Font settings for western encoding apply when 'x-*' langGroup is specified (especially problematic in mail)

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: gvs, Assigned: jshin1987)

Details

(Keywords: intl, Whiteboard: fixed-aviary-1.0,fixed-1.7)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040818
Build Identifier: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040818

While I'm not sure it affects only MailNews, I noticed it there so report it as is.

I have the following preferences: fixed font for displaying mail messages,
regular style, wrap to fit a window, graphical emoticons. So, I select for
viewing some cyrillic message and notice that fixed font surely differs from
that one I see when I compose a message. I'm tryin' to modify Unicode font
settings, but that has no effect. Then I'm tryin' font settings for Western
encoding - and voila! - font changes.

Reproducible: Always
Steps to Reproduce:
0. Setup "Fixed font width" in your prefs for message display.
1. Open any cyrillic message for viewing.
2. Change the fixed font in Western encoding.
3. Reopen cyrillic message and see the change.

Actual Results:  
The font was changed. It shouldn't.

Expected Results:  
Apply cyrillic font settings for cyrillic messages and western for western,
appropriately.

It seems like Mozilla 1.7.2 tends to hang miserably, upto kill. I couldn't catch
a condition so I'm delaying a separate bugreport.

> LD_LIBRARY_PATH=/usr/X11R6/lib/mozilla/ ldd /usr/X11R6/lib/mozilla/mozilla-bin
/usr/X11R6/lib/mozilla/mozilla-bin:
        libmozjs.so => /usr/X11R6/lib/mozilla//libmozjs.so (0x280a0000)
        libplds4.so => /usr/X11R6/lib/mozilla//libplds4.so (0x2811b000)
        libplc4.so => /usr/X11R6/lib/mozilla//libplc4.so (0x2811e000)
        libnspr4.so => /usr/X11R6/lib/mozilla//libnspr4.so (0x28123000)
        libpthread.so.1 => /usr/lib/libpthread.so.1 (0x28155000)
        libgtk-x11-2.0.so.400 => /usr/X11R6/lib/libgtk-x11-2.0.so.400 (0x28179000)
        libgdk-x11-2.0.so.400 => /usr/X11R6/lib/libgdk-x11-2.0.so.400 (0x28428000)
        libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x28493000)
        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x28496000)
        libXinerama.so.1 => /usr/X11R6/lib/libXinerama.so.1 (0x2849e000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x284a1000)
        libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x284ae000)
        libfreetype.so.9 => /usr/X11R6/lib/libfreetype.so.9 (0x284c0000)
        libz.so.2 => /lib/libz.so.2 (0x2850d000)
        libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x2851a000)
        libfontconfig.so.1 => /usr/X11R6/lib/libfontconfig.so.1 (0x28521000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x28547000)
        libXcursor.so.1 => /usr/X11R6/lib/libXcursor.so.1 (0x2860c000)
        libatk-1.0.so.600 => /usr/local/lib/libatk-1.0.so.600 (0x28615000)
        libgdk_pixbuf-2.0.so.400 => /usr/X11R6/lib/libgdk_pixbuf-2.0.so.400
(0x2862e000)
        libpangoxft-1.0.so.399 => /usr/X11R6/lib/libpangoxft-1.0.so.399 (0x28643000)
        libpangox-1.0.so.399 => /usr/X11R6/lib/libpangox-1.0.so.399 (0x28648000)
        libpango-1.0.so.399 => /usr/X11R6/lib/libpango-1.0.so.399 (0x28653000)
        libgobject-2.0.so.400 => /usr/local/lib/libgobject-2.0.so.400 (0x28686000)
        libgmodule-2.0.so.400 => /usr/local/lib/libgmodule-2.0.so.400 (0x286bc000)
        libglib-2.0.so.400 => /usr/local/lib/libglib-2.0.so.400 (0x286c0000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28739000)
        libm.so.2 => /lib/libm.so.2 (0x28810000)
        libstdc++.so.4 => /usr/lib/libstdc++.so.4 (0x28829000)
        libc.so.5 => /lib/libc.so.5 (0x288de000)
        libintl.so.6 => /usr/local/lib/libintl.so.6 (0x289b7000)
        libfreetype.so.9 => /usr/local/lib/libfreetype.so.9 (0x289c0000)
        libexpat.so.4 => /usr/X11R6/lib/libexpat.so.4 (0x28a28000)
        libexpat.so.5 => /usr/local/lib/libexpat.so.5 (0x28a45000)
        libpangoft2-1.0.so.399 => /usr/X11R6/lib/libpangoft2-1.0.so.399 (0x28a64000)
I see this symptom with TB0.7, Moz 1.7 and Moz 1.8a3-0820, Windows 2000, for a 
message encoded with iso-8859-2; I would have expected this to abide by font 
selections for Central European.

Seva Gluschenko, what character encoding(s) is/are used for the Cyrillic 
messages?
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: FreeBSD → All
Attached file html test file
This demonstrates the problem.	Note the difference between the 3rd and the 4th
entries on the one hand and the 5th and the 6th entries on the other hand. The
former uses 'lang=ru' while the latter uses 'lang=x-cyrillic'. Both should
work, but somehow the latter doesn't work.
Assignee: sspitzer → jshin
Status: NEW → ASSIGNED
See bug 102623 for the way mail 'charset'  is mapped to 'langGroup'.

I'll have to debug what 'langGroup' Gfx receives from upstream. This is not
mailnews specific as the test case showed.
Component: Mail Window Front End → Layout: Fonts and Text
Product: MailNews → Browser
Hardware: PC → All
Keywords: intl
Summary: Font settings for western encoding apply to cyrillic mails → Font settings for western encoding apply when 'x-*' langGroup is specified (especially problematic in mail)
Attached patch patch Splinter Review
Layout converts the value of 'lang' to mozilla's internal langGroup before
handing it over to Gfx [1]. When mapping 'lang' to langGroup, it refers to
intl/locale/src/langGroup.properties. Because 'x-*' langGroups are not listed
as keys in the file, they're mapped to 'x-western' [2] when 'x-*' is specifed
as the value of 'lang' as in Mozilla-mail rendering, 'x-*' .  This can be
'fixed' by adding 'self-map' to the file (that maps 'x-*' to themselves) as is
done in the patch.

[1] I think we need to either make layout hand down the original 'lang' value
to Gfx and let Gfx handle the mapping or make layout pass both the original
'lang' and the resolved 'langGroup' down to Gfx.  Some ports of Gfx (currently
Gfx:Xft alone, but I guess Gfx:Cairo has the same ability) have their own
'lang-based font selection/filtering' mechanism. By mapping 'lang' to
'langGroup', we're losing the 'resolution' (because 'langGroup' is more
coarse-grained than 'lang').  

[2] I think it's better to map unknown langs to 'x-unicode' so that users of
languages/scripts (currently not listed in langGroup.properties file) can have
a separate (from x-western) control of fonts to use for rendeirng pages in
those scripts/languages
Comment on attachment 156655 [details] [diff] [review]
patch 

asking for r/sr
Attachment #156655 - Flags: superreview?(dbaron)
Attachment #156655 - Flags: review?(smontagu)
FYI, I filed bug 256383 for mapping unknown langs to 'x-unicode'..

Mike, thanks for bringing this issue to my attention. It helped me to pin down
the cause to know that both x-central-euro and x-cyrillic have this problem. 
Attachment #156655 - Flags: superreview?(dbaron) → superreview+
Attachment #156655 - Flags: review?(smontagu) → review+
Comment on attachment 156655 [details] [diff] [review]
patch 

thanks for r/sr. 
asking for a1.7.3 and avivary-1.0.
This is a trivial fix, but will help mozilla-mail and thunderbird users select
fonts for emails in Central European, Cyrillic, Baltic
Attachment #156655 - Flags: approval1.7.3?
Attachment #156655 - Flags: approval-aviary?
Even though this is a properties file, it doesn't get changed for localization,
correct?
Comment on attachment 156655 [details] [diff] [review]
patch 

a=mkaply

answered my own question
Attachment #156655 - Flags: approval1.7.3?
Attachment #156655 - Flags: approval1.7.3+
Attachment #156655 - Flags: approval-aviary?
Attachment #156655 - Flags: approval-aviary+
thansk for r/sr/a. fixed on trunk, aviary-1.0, and 1.7 branches
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Whiteboard: fixed-aviary-1.0,fixed-1.7
verified fixed (for the ISO-8849-2 case) with
  Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a3) Gecko/20040824
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: