Ugly Chinese font in dialogs and menu on simplified chinese windows

VERIFIED FIXED in mozilla1.0.1

Status

()

--
major
VERIFIED FIXED
18 years ago
10 years ago

People

(Reporter: zf, Assigned: shanjian)

Tracking

({intl})

Trunk
mozilla1.0.1
x86
All
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [adt2])

Attachments

(6 attachments, 2 obsolete attachments)

(Reporter)

Description

18 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.1) Gecko/20010607
BuildID:    2001060703

The characters look ugly in the toolbar, menus and dialogs, probably because of
wrong font or font size on simplified chinese version of windows 2k.

Reproducible: Always
Steps to Reproduce:
1. On simplified chinese Windows, add a bookmark with a Chinese title.
2. Pull down the Bookmark menu and u will see the bookmark title
3.
(Reporter)

Comment 1

18 years ago
Created attachment 37637 [details]
some Chinese characters in the Bookmark menu
(Reporter)

Comment 2

18 years ago
Created attachment 37638 [details]
some normal characters in IE

Comment 3

18 years ago
It seems the size we pick is too small. 
German- where do we set the size for skin. It looks you pick a font size too 
small for CJK text. 
nhotta- please take a look at this. Is the size reasonable for Japanese these 
days? 

German- are you using size 10 and below?
I agree the text is not readable. 
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 4

18 years ago
Both modern and classic set the font using what is set as system font. Please 
talk to skin master Hewitt (cc'd), if you need anything special here.

Comment 5

18 years ago
Japanese bookmark text looks fine on JA localized windows (I will attach a
screen shot). But not good on US windows, probably it's system font related as
german's comment.

Comment 6

18 years ago
Created attachment 37927 [details]
Screen shot: bookmark with JA text, on JA windows.

Comment 7

18 years ago
Feng, is your system US version or you are using Chinese localized system?

Updated

18 years ago
QA Contact: andreasb → ylong
(Reporter)

Comment 8

18 years ago
I'm using Chinese localized windows 2000 professional.

Comment 9

18 years ago
ylong, do you have Chinese windows (I think the bug is about Traditional Chinese)?

Comment 10

18 years ago
I only have Simp. Chinese2k, I'll check it on Traditional Chinese window in lab 
later.

Comment 11

18 years ago
Actually, I just noticed the reporter was using Simp. Chinese2k.
I got very similar result - the Chinese characters(kanji) not very nice, don't 
show same as in Japanese Windows(N6.1Ja).

Updated

18 years ago
Target Milestone: --- → mozilla0.9.3

Comment 12

18 years ago
>Both modern and classic set the font using what is set as system font.

do you use the system setting for the size also ? I think the problem is not
what font you use, but also what size you use. 
can you kindly point out where is it in the css for bookmark & menu ? Thanks. 
Assignee: nhotta → german

Comment 13

18 years ago
This problem also occurs in the Linux for both traditional and simplified fonts
(mozilla 2001072008). Occurs in bookmark, message list, and the message body.

Comment 14

18 years ago
Doesn't look like this is getting fixed before the freeze tomorrow night.
Pushing out a milestone.  Please correct if I'm mistaken.
Target Milestone: mozilla0.9.3 → mozilla0.9.4

Comment 15

18 years ago
*** Bug 92211 has been marked as a duplicate of this bug. ***

Updated

18 years ago
OS: Windows 2000 → All
Hardware: PC → All

Updated

17 years ago
Target Milestone: mozilla0.9.4 → mozilla0.9.5

Comment 16

17 years ago
pushing out 1 milestone, not sure that I should own this, as I am not an expert
on chinese charsets. Somebody on this list wants to own this?

Comment 17

17 years ago
0.9.5 is out the door. bumping TM up by one.
Target Milestone: mozilla0.9.5 → mozilla0.9.6

Comment 18

17 years ago
cc'ing Shuehan, since Joe has relinquished his command.

Comment 19

17 years ago
reassigning, i don't believe this should have belonged to german (or the UE team)
Assignee: german → yokoyama
QA Contact: ylong → teruko

Updated

17 years ago
Keywords: intl
QA Contact: teruko → ylong

Comment 20

17 years ago
Let's get tao's opinion to see if we can do something here to 
look better in Chinese.
->tao
Assignee: yokoyama → tao

Comment 21

17 years ago
We need to use debugger to find out why this is happening:

  1. are we returning the correct font size to the rendering engine?
  2. if yes, is there prettier font available on the system but is not selected
     by the browser?

Knowing the answer might help us make the decision as whether to fix the browser
code or assign better font settings for UI (tweak "chrome://global/locale/intl.css"
or default prefs.)

assign to smontagu@netscape.com for (1)
Assignee: tao → smontagu
The answer to (1) in comment 21 is "Yes". I think the problem is that on a
non-localized system the default system font doesn't contain glyphs for Chinese,
so we are using glyphs from some other font, resized to the size of the system font.

Back to tao.
Assignee: smontagu → tao
Looks like this won't make it in for 0.9.6.

Comment 24

17 years ago
Bounce back to i18n group. CC l10n eng

It seems to me the text layout engine needs a bit help to choose prettier fonts on
native system. In theory, a native system should have sufficient font installed
to render reasonable looking native scripts.

Are we using the default system font size? How does Gecko determine what size to 
use? In other words, what's the order of precendence regarding font size: 
"intl.css", system font size, etc?

Also, re-targetting to 0.9.7
Assignee: tao → yokoyama
QA Contact: ylong → teruko
Target Milestone: mozilla0.9.6 → mozilla0.9.7

Comment 25

17 years ago
>In theory, a native system should have sufficient font installed
>to render reasonable looking native scripts.
I agree with tao.

>How does Gecko determine what size to use? 
I believe Gecko uses the Pref settings 
http://lxr.mozilla.org/seamonkey/source/modules/libpref/src/win/winpref.js

Having said, I thought this bug is about the chinese text being ugly in the menu
and dialogbox. Can somebody answer Franks comment (#12)?
>can you kindly point out where is it in the css for bookmark & menu ? 


Comment 26

17 years ago
I think bookmark css is 
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/themes/modern/communicator/bookmarks/bookmarks.css
However, I failed to find font facename setting and font size in the CSS
Hewitt: where do we specify the facename and size?

Comment 28

17 years ago
->smontagu
Assignee: yokoyama → smontagu

Comment 29

17 years ago
The size of menu font can be control by Control Panel:Display:Apperance:Menu

Comment 30

17 years ago
I use yokoyama's simp chinese w2k system to look at it. The problem is the 
following
1. the modern theme listen to the control panel setting (not a problem)
2. in the simp chinese w2k system, if the appearance is set to "window classic" 
the font for menu is set to "Tahoma" 8. Which do not have Chinese glyph
3. in IE, when it set to "Tahoma" 8, it use a font fallback algorithm whihc pick 
up a nice fallback
4. in Mozilla, when it set to "Tahoma" 8, we SHOULD use the locale font setting 
for font fallback, but we don't for some reason.

The real problem is the font fallback algorithm for lang group x-unicode

Comment 31

17 years ago
this is not a style sheet issue. This is a font fallback algorithm issue on 
window. Reassign to shanjian.
As you can see, if user set the "Menu" font to "Song" then we will display 
correctly. This is because the "Song" have chinese glyph but tahoma do not. The 
problem is our fallback algorithm does not pick up Song while it should.
Assignee: smontagu → shanjian

Comment 32

17 years ago
shanjian- what is the order of font fallback when a specific font do not have 
the glyph ? 
(Assignee)

Comment 33

17 years ago
First we try the font name if specified by user, and then generic font using font family 
name. If still could not find a font, all system fonts will be tried in rather random 
order, and first one contains the glyph will be returned. 

Comment 34

17 years ago
>First we try the font name if specified by user, and then 
>generic font using font family name. 
So... if the font-family is "tahoma" and the lang group is "x-unicode", and the 
system locale is "zh-CN", we should try the following 
1. "tahoma"
2. the "serif" font of "zh-CN", 
3. all other "serif" font for different langauge group
4. all other fonts, 

right ? (the reason 2 is "serif" font of "zh-CN" instead of "serif" font of 
"x-unicode" is because erik add some code in the nsLanguageAtomService to map 
"x-unicode" lang group to the locale lang group. 

However, I didn't see 2 happened. Do we pass "zh-CN" down as langgroup ? or 
"x-unicode" ? Which font we used ? Why?
(Assignee)

Comment 35

17 years ago
Give me a minute and I will give you the whole picture about what's happening. 
Can you tell me where is the control panel setting?
(Assignee)

Comment 36

17 years ago
Ok, here is what's happening. 
To be simple, it is not because we choose the wrong font, but because "we?" choose the 
wrong size. On my simplified win2k system, control panel shows default setting is 
"tahoma" with size 8, that is interpreted as height of "-11" in creating font. When 
this font is failed to display those chinese characters, global font is tried and 
"MS song" is found. But size "-11" make the font looks ugly. 

Selecting size "9" in control panel menu setting, problem will be gone. 
Selecting "Song" but keep size "8", problem is still there. 

Some additional detail,
The lang group we are using is x-wester, not x-unicode. That is reasonable because the 
whole interface is English. If user using localized chinese UI, we should use 
"zh-cn" as lang group. (If not , that will be a bug.)
Status: NEW → ASSIGNED
(Assignee)

Comment 37

17 years ago
Solution? 

Strictly speaking, this is not a problem of browser. We should honor control panel's setting, 
and we should keep all font looks the same size. It is possible to put in a hack in creating 
font. That is to use a slightly larger size for CJK font. But I believe many people may hate 
the idea and we will create more problems that solved.

(Assignee)

Comment 38

17 years ago
Created attachment 61346 [details]
screen shot: comparison of size 8 and 9 (IE)
(Assignee)

Comment 39

17 years ago
I post a screen shot of IE with size 8 and size 9. As you might notice that 
they (MS) are using same size for Chinese characters, and different size for
English. For further smaller size (6, 7), chinese character becomes sizable 
again. 

Comment 40

17 years ago
>Some additional detail,
>The lang group we are using is x-wester, not x-unicode. That is reasonable 
>because the 
>whole interface is English. If user using localized chinese UI, we should use 
>"zh-cn" as lang group. (If not , that will be a bug.)

Ok, I got it. We add the font setting for the UI locale (user locale) to the 
generic list. Should we also add the system locale to the generic list after ?

Look at nsFontMetricsWin.cpp FindGenericFont we first add the font and font-list 
of the langgroup to the list, and then we add the gUsersLocale's font and 
font-list to the list (if gUsersLocale is differ from langgroup) and then we 
call GenericFontEnumContext. Should we add the font and font-list of the 
system's locale before we call GenericFontEnumContext ?

If we do so, then we will try simplified Chinese font first before try other 
fonts. This will make the English UI build run better on Chinese system.

and also, we should try all font and font-list of other language group
before we try global font.

So... currently, the algorithm is
1. try the font user specify
2. try font and font list of the page's language group
3. try font and font list of the user's ui language group
4. try global font

and I suggest we add
3.1 try font and font list of the system's language group
3.2 try font and font list of the rest language groups

>On my simplified win2k system, control panel shows default setting is 
>"tahoma" with size 8, that is interpreted as height of "-11" in creating font. 
>When this font is failed to display those chinese characters, global font
> is tried and "MS song" is found. 
on roy's chinese system, that is not exactly what we see. It seem's it is not 
using "MS song" but some other type face. 

Comment 41

17 years ago
move this bug to m0.9.8
Target Milestone: mozilla0.9.7 → mozilla0.9.8
(Assignee)

Comment 42

17 years ago
frank, it is "Song". All the difference we saw are because of size. 
I manually change the size during my debug session and it works. 

As for your suggestion about traversing lang group in find generic font. 
That looks reasonable to me. How to make it work efficietly is my concern.
I believe it is doable.

Comment 43

17 years ago
>frank, it is "Song". All the difference we saw are because of size. 
That is not what I saw. I agree that size is one major issue. but one another 
issue is we didn't pick a reasonable font face neither. I belive we need to 
address both issues.

Comment 44

17 years ago
Created attachment 61442 [details] [diff] [review]
trial patch to take system locale and other pref before try global. 

here is a trial patch

Comment 45

17 years ago
not sure the trial patch make thing better yet. Need to test on a system which 
reproduce the problem easily.

Updated

17 years ago
QA Contact: teruko → ylong
(Assignee)

Updated

17 years ago
Target Milestone: mozilla0.9.8 → mozilla1.0

Comment 46

17 years ago
-> nsbeta1, it really ugly with Simplified Chinese windows including
WinXP-SimpChinese interface.
Severity: minor → major

Comment 47

17 years ago
Actually, the above comment was on Multi-lingual WinXP with default language
setting to Simp. Chinese.
On real localized Simp. Chinese WinXP, the font will display fine.

Updated

17 years ago
Keywords: nsbeta1

Comment 48

17 years ago
nsbeta1+ 
may be we should do this
in the system is Chinese and the font size it return is < 9, return 9
Keywords: nsbeta1 → nsbeta1+
Hardware: All → PC
(Assignee)

Comment 49

17 years ago
In IE, they only use size 9 font to display size 8 characters for Chinese, all
English strings remain 8. Similar things does not happen if size < 8. That's say
if request size is 6,7,etc, they do display those chinese characters as
requested. AND this happens for UI font only. In html body, all request size if
honored, size 8 chinese font is not allign to 9. 

I guess the problem should exist beyond localized chinese win2K. If we implement
a generic solution, (eg. align size 8 to 9 for chinese characters), we will
break something else. This is really a headache. 

Comment 50

17 years ago
nsbeta1- 
Keywords: nsbeta1+ → nsbeta1-
(Assignee)

Updated

17 years ago
Target Milestone: mozilla1.0 → mozilla1.0.1
(Assignee)

Comment 51

17 years ago
push to 1.01

Comment 52

17 years ago
ftang - don't you think this should be a nsbeta1+? If we're going to make a
Chinese product, we want it to look okay. 

Comment 53

17 years ago
FYI: (haven't check WinNT-CN and WinME-CN though)

Chinese font look good: 
WinXP-CN, Win98-CN

Font has the problem as showing in this bug: 
WinXP-Multi-Lingual UI when setting SimpChinese as default language, Win2000-CN
and other non-SimpChinese windows.

Comment 54

17 years ago
renominate as nsbeta1 - we still see it on many windows system, especially on Win2k.
Keywords: nsbeta1- → nsbeta1

Comment 55

17 years ago
Yuying, is this nominated again for Win2k? Is it okay for other Window platforms?

Comment 56

17 years ago
It's for both - win2k including win2k-SC, WinXP-multiligua UI even you setting
locale as SC, any other non-SC systems.

Comment 57

17 years ago
we should release note this. People can change their font size by changing
"Control Panel:Appearance". They can select a different font or increase the
font size. The quality of the font is not really in our control. This is really
a MS window's bug instead of an application bug. 
nsbeta1- and please release note it.
Keywords: nsbeta1 → nsbeta1-, relnote

Comment 58

17 years ago
Get together with Frank and Xianglan, Frank did some more research on seetins
between system and our prferences, we might have a solution for this.

Renominate as nsbeta1 again.
Keywords: nsbeta1- → nsbeta1

Comment 59

17 years ago
so... we decide to do the following, in the simplified chinese system, if the
control panel return 9 or smaller value, return 9 instead.

to implement that. we need to add code to
mozilla/gfx/src/windows/nsDeviceContextWin.cpp GetSysFontInfo method and right
before CopyLogFontToNSFont (or in that function) check the height and when the
size is too small (make sure we cover both the positive case and negativie case)
round up to equal to 9 if it is running on the simplified chinese system
(GetACP() == 936 )

reassign to ftang as adt 2 
Assignee: shanjian → ftang
Blocks: 141008
Status: ASSIGNED → NEW
Keywords: nsbeta1 → nsbeta1+
Whiteboard: [adt2]

Comment 60

17 years ago
I'm using win2k and the default language is traditional chinese. I did not use
chinese menu in mozilla because chinese font in the menu is very difficult to read.

Today I tried to change the font setting in mozilla. I changed all the fonts for
unicode to mingliu (a font for traditional chinese). After restart, the display
of chinese menu is much better. The font is the same as the screenshot from
http://www.csie.ntu.edu.tw/~b7506051/mozilla/screenshot.html

I'm not sure whether it only works in my computer. In my first trial, I needed
to delete Arial Unicode MS font to make things happen.

Comment 61

17 years ago
Created attachment 85338 [details] [diff] [review]
patch 

shanjian, can you r=

Comment 62

17 years ago
cc shanjian
(Assignee)

Comment 63

17 years ago
We should only replace 8 with 9, and keep rest size (7, 6, etc) unchanged. 

Comment 64

17 years ago
anything below 9 is too small and ugly.
(Assignee)

Comment 65

17 years ago
I knew. But any size below 8 must be manually selected by user. If they do it,
they must have a reason and we should respect their choice. Size 8 is special
because it is a default, and this default size is not a good choice.

Comment 66

17 years ago
shanjian, this value is control by the control pannel. And the user may not
select a specific font size to change it. If user select a differen APPEARANCE
THMEM, the font name and size may change. So what the user may do is to change
from "Window Traditional" to "Window XP" theme, and the size could be change. or
select from "Normal" to "Small" the size could be changed. 

remember, this code will only be hit when we access the info from the control
panel, this code does NOT impact the size from our preference window, nor any
direct reference in css or html.
(Assignee)

Comment 67

17 years ago
Comment on attachment 85338 [details] [diff] [review]
patch 

r=shanjian per ftang's #66.
Attachment #85338 - Flags: review+

Comment 68

17 years ago
Comment on attachment 85338 [details] [diff] [review]
patch 

is 936 stored anywhere special? i.e. is there a CP_936 or CP_CHINESE_something
#define somewhere that we could be re-using? 

if so, lets use that. otherwise, sr=alecf
Attachment #85338 - Flags: superreview+

Comment 69

17 years ago
all the documentation refer to 936 directly. There are a SNA header file define
CP_936, but it will create dependency on a wrong header file. 

Comment 70

17 years ago
check into trunk at 6/4 afternoon. Forget to mention that. mark it fixed now. 
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Updated

17 years ago
Keywords: relnote → adt1.0.1, mozilla1.0.1

Comment 71

17 years ago
Seems the checked-in didn't affect the display in trunk build on both win2k-SC
and WinXP-SC.

Updated

17 years ago
Keywords: adt1.0.1, mozilla1.0.1

Comment 72

17 years ago
Created attachment 87162 [details] [diff] [review]
right rix

the last patch is wrong. we need to back it out from the trunk and land thie
patch intead.
Attachment #85338 - Attachment is obsolete: true

Comment 73

17 years ago
shanjian: can you look at my latest patch and try on your chinese system?
(Assignee)

Comment 74

17 years ago
Frank,
I tried your patch on my SC2k. You need to make some modification before it will
work. You need to adjust the size before converting to twips. After that, all
font in menu, dialog, etc use 9 point font instead of 8 point. When we running
mozilla english version on Chinese system, do we really want all those fonts in
9 points? I am kind of hesitant to such a change. 

Comment 75

17 years ago
the fix in trunk is not good. should back it out.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 76

17 years ago
reassign to shanjian to work on. 
Assignee: ftang → shanjian
Status: REOPENED → NEW
(Assignee)

Comment 77

17 years ago
Created attachment 87308 [details] [diff] [review]
new patch
Attachment #87162 - Attachment is obsolete: true
(Assignee)

Comment 78

17 years ago
Now change is only limited to size 8. 
frank, could you r=?
Status: NEW → ASSIGNED

Comment 79

17 years ago
Comment on attachment 87308 [details] [diff] [review]
new patch

are you sure you should check and change it before the NSIntPointsToTwips?
should aFont->size be limited to 9 or pointSize be limited to 9? I remember in
my computer I got pointSizet = 11 but NSIntPointsToTwips convert it to 8. Can
you confirm that? Will it change depend on the screen res?
(Assignee)

Comment 80

17 years ago
I verified this on my box, pointSize should be limited to 9. I also tried a
different resolution, it works the same way.

Comment 81

17 years ago
Comment on attachment 87308 [details] [diff] [review]
new patch

r=ftang
Attachment #87308 - Flags: review+
(Assignee)

Comment 82

17 years ago
Alec, could you sr?

Comment 83

17 years ago
Comment on attachment 87308 [details] [diff] [review]
new patch

sr=alecf
Attachment #87308 - Flags: superreview+
(Assignee)

Comment 84

17 years ago
fix checked into trunk. 
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → FIXED

Comment 85

17 years ago
Verified fixed on 06-18 trunk build on both WinXP-SC and Win2k-SC with Chinese
personal toolbar names and bookmark names.
Status: RESOLVED → VERIFIED

Updated

17 years ago
Keywords: adt1.0.1, mozilla1.0.1

Updated

17 years ago
Attachment #87308 - Flags: approval+

Comment 86

17 years ago
please checkin to the 1.0.1 branch. once there, remove the "mozilla1.0.1+"
keyword and add the "fixed1.0.1" keyword.
Keywords: mozilla1.0.1 → mozilla1.0.1+

Comment 87

17 years ago
Marking adt1.0.1+ on behalf of the adt for checkin to the 1.0 branch.  

Keywords: adt1.0.1 → adt1.0.1+
(Assignee)

Comment 88

17 years ago
fix checked into branch. 
Keywords: mozilla1.0.1+ → fixed1.0.1

Comment 89

17 years ago
Verified fixed on 06-19 Netscape 1.0 branch build on both WinXP-SC and Win2k-SC
with Chinese personal toolbar names and bookmark names.

Keywords: fixed1.0.1 → verified1.0.1

Updated

17 years ago
Blocks: 146292
No longer blocks: 141008
You need to log in before you can comment on or make changes to this bug.