Closed Bug 84668 Opened 23 years ago Closed 22 years ago

Ugly Chinese font in dialogs and menu on simplified chinese windows

Categories

(Core :: Internationalization, defect)

x86
All
defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla1.0.1

People

(Reporter: zf, Assigned: shanjian)

References

Details

(Keywords: intl, Whiteboard: [adt2])

Attachments

(6 files, 2 obsolete files)

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.
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
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.
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.
Feng, is your system US version or you are using Chinese localized system?
QA Contact: andreasb → ylong
I'm using Chinese localized windows 2000 professional.
ylong, do you have Chinese windows (I think the bug is about Traditional Chinese)?
I only have Simp. Chinese2k, I'll check it on Traditional Chinese window in lab 
later.
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).
Target Milestone: --- → mozilla0.9.3
>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
This problem also occurs in the Linux for both traditional and simplified fonts
(mozilla 2001072008). Occurs in bookmark, message list, and the message body.
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
*** Bug 92211 has been marked as a duplicate of this bug. ***
OS: Windows 2000 → All
Hardware: PC → All
Target Milestone: mozilla0.9.4 → mozilla0.9.5
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?
0.9.5 is out the door. bumping TM up by one.
Target Milestone: mozilla0.9.5 → mozilla0.9.6
cc'ing Shuehan, since Joe has relinquished his command.
reassigning, i don't believe this should have belonged to german (or the UE team)
Assignee: german → yokoyama
QA Contact: ylong → teruko
Keywords: intl
QA Contact: teruko → ylong
Let's get tao's opinion to see if we can do something here to 
look better in Chinese.
->tao
Assignee: yokoyama → tao
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.
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
>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 ? 


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?
->smontagu
Assignee: yokoyama → smontagu
The size of menu font can be control by Control Panel:Display:Apperance:Menu

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
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
shanjian- what is the order of font fallback when a specific font do not have 
the glyph ? 
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. 
>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?
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?
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
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.

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. 
>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. 
move this bug to m0.9.8
Target Milestone: mozilla0.9.7 → mozilla0.9.8
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.
>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.
not sure the trial patch make thing better yet. Need to test on a system which 
reproduce the problem easily.
QA Contact: teruko → ylong
Target Milestone: mozilla0.9.8 → mozilla1.0
-> nsbeta1, it really ugly with Simplified Chinese windows including
WinXP-SimpChinese interface.
Severity: minor → major
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.
Keywords: nsbeta1
nsbeta1+ 
may be we should do this
in the system is Chinese and the font size it return is < 9, return 9
Keywords: nsbeta1nsbeta1+
Hardware: All → PC
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. 
nsbeta1- 
Keywords: nsbeta1+nsbeta1-
Target Milestone: mozilla1.0 → mozilla1.0.1
push to 1.01
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. 
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.
renominate as nsbeta1 - we still see it on many windows system, especially on Win2k.
Keywords: nsbeta1-nsbeta1
Yuying, is this nominated again for Win2k? Is it okay for other Window platforms?
It's for both - win2k including win2k-SC, WinXP-multiligua UI even you setting
locale as SC, any other non-SC systems.
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: nsbeta1nsbeta1-, relnote
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
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: nsbeta1nsbeta1+
Whiteboard: [adt2]
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.
Attached patch patch (obsolete) — Splinter Review
shanjian, can you r=
cc shanjian
We should only replace 8 with 9, and keep rest size (7, 6, etc) unchanged. 
anything below 9 is too small and ugly.
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.
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.
Comment on attachment 85338 [details] [diff] [review]
patch 

r=shanjian per ftang's #66.
Attachment #85338 - Flags: review+
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+
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. 
check into trunk at 6/4 afternoon. Forget to mention that. mark it fixed now. 
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Seems the checked-in didn't affect the display in trunk build on both win2k-SC
and WinXP-SC.
Attached patch right rix (obsolete) — Splinter Review
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
shanjian: can you look at my latest patch and try on your chinese system?
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. 
the fix in trunk is not good. should back it out.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
reassign to shanjian to work on. 
Assignee: ftang → shanjian
Status: REOPENED → NEW
Attached patch new patchSplinter Review
Attachment #87162 - Attachment is obsolete: true
Now change is only limited to size 8. 
frank, could you r=?
Status: NEW → ASSIGNED
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?
I verified this on my box, pointSize should be limited to 9. I also tried a
different resolution, it works the same way.

Comment on attachment 87308 [details] [diff] [review]
new patch

r=ftang
Attachment #87308 - Flags: review+
Alec, could you sr?
Comment on attachment 87308 [details] [diff] [review]
new patch

sr=alecf
Attachment #87308 - Flags: superreview+
fix checked into trunk. 
Status: ASSIGNED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
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
Attachment #87308 - Flags: approval+
please checkin to the 1.0.1 branch. once there, remove the "mozilla1.0.1+"
keyword and add the "fixed1.0.1" keyword.
Marking adt1.0.1+ on behalf of the adt for checkin to the 1.0 branch.  

Keywords: adt1.0.1adt1.0.1+
fix checked into branch. 
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.

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

Attachment

General

Creator:
Created:
Updated:
Size: