Closed Bug 550931 Opened 15 years ago Closed 14 years ago

Chinese glyphs in chrome rendered incorrectly (using preference for Japanese font)

Categories

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

x86
Windows 7
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
blocking2.0 --- final+

People

(Reporter: wiiwaker, Unassigned)

Details

Attachments

(8 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20100109 Firefox/3.7a1pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a3pre) Gecko/20100308 Minefield/3.7a3pre

Chinese glyphs in recent m-c nightly builds don't render correctly in chrome( including bookmark titles, location bar drop-down list,etc )

Reproducible: Always
Attached image font setting window
Version: unspecified → Trunk
blocking2.0: --- → ?
Steps to Reproduce:
1.Create a new profile.
2.set the Sans-serif font to "Microsoft YaHei" for Simplified Chinese.

Actual Results:
the chrome font displays in some wired font in recent trunk builds

Expected Results:
the chrome font should be "Microsoft YaHei" in Firefox
I think this may be the same as bug 550772, which has just been fixed on trunk this morning - please let us know if the problem persists with builds which include that fix.
(In reply to comment #5)
> I think this may be the same as bug 550772, which has just been fixed on trunk
> this morning - please let us know if the problem persists with builds which
> include that fix.

Bug 550772 is for Mac builds only? Sorry I have no computer running Mac OS X...
Whatever I tried the latest windows hourly build, this problem still exists. The Build ID and changeset is "20100308142524 02dbaba64e8b".
Someone in a Chinese Firefox forum confirmed this problem has been fixed in Mac
OS X builds due to bug 550772.
Now just windows builds have this problem.
(In reply to comment #7)
> Someone in a Chinese Firefox forum confirmed this problem has been fixed in Mac
> OS X builds due to bug 550772.
> Now just windows builds have this problem.

The changes for 550772 were not made in platform-specific code, the same logic was broken on both Mac/Windows.

The initial description lists "Gecko/20100109" as an instance of a build that doesn't work.  Is that correct?  The change that caused 550772 was checked in last week, so if builds in Jan/Feb have a problem it's a different problem than bug 550772, although likely in the same code.
(In reply to comment #8)
> (In reply to comment #7)
> > Someone in a Chinese Firefox forum confirmed this problem has been fixed in Mac
> > OS X builds due to bug 550772.
> > Now just windows builds have this problem.
> 
> The changes for 550772 were not made in platform-specific code, the same logic
> was broken on both Mac/Windows.
> 
> The initial description lists "Gecko/20100109" as an instance of a build that
> doesn't work.  Is that correct?  The change that caused 550772 was checked in
> last week, so if builds in Jan/Feb have a problem it's a different problem than
> bug 550772, although likely in the same code.

Sorry for the useragent. I overrided it for spoofing some terrible site. The original useragent is "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US;
rv:1.9.3a3pre) Gecko/20100308 Minefield/3.7a3pre"
Perhaps this bug is related to directwrite/d2d stuff. If I toggle "gfx.font_rendering.directwrite.enabled" to ture in about:config, the Chinese glyphs are rendered correctly.
IIRC, this problem occured at the same day when dw/d2d landed on trunk.
Steps:

1. Open Tools > Options
2. Click on the Content tab
3. Click on the Advanced button next to the default font
4. Under "Fonts for", select "Simplified Chinese"
5. Under "Proportional" select "Sans-serif"
6. Under "Sans-serif" select "Microsoft YaHei"
7. Click OK to close font dialog
8. Back in Content tab, under "Languages" click "Choose"
9. Add "Chinese/China" and move it to the top
10. Open the testcase URL

Result: fonts used are different

Expected result: same font used for all three lines of Chinese text
Shouldn't the language code be zh-Hans?  Or is the point to test a broken language code?
Argh, asleep at the wheel.  Yes, it should be zh-Hans.
Attachment #431300 - Attachment is obsolete: true
The first line of text shows in a different font (it shouldn't).  But between 2/24 and 2/25, a change occurred that somehow mixes in a serif face.

First line is all sans-serif:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a2pre) Gecko/20100224 Minefield/3.7a2pre

First line is mostly sans-serif with some serif glyphs:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a2pre) Gecko/20100225 Minefield/3.7a2pre

Guessing this is related to changes for bug 524107 or bug 548608.
wiiwaker, could you post a screenshot of what you see with the testcase, following the steps outlined in comment 11.  These settings should be pretty close to what you have already but the CJK font pref code looks at both accept lang codes and at the local system locale.  I'm running on a Japanese system so part of the funkiness of the output maybe a mixture of Japanese/Chinese fonts, my hunch is you'll see something incorrect but different.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image screenshot of testcase
This testcase looks fine for me. BTW my os in win7 English version, only changing system local to "Chinese(Simplified, PRC) in control panel, maybe this is the reason only tab and bookmark title and other chrome glyphs are broken on my system.
the same problem for me.
but i find a indirect way to solve it:
setting the "Sans-serif" font for japanese to any kind of chinese font, then all chinese character in firefox UI render correctly.
may be the developers Deal with the Chinese as Japanese ?
Attached image the bad
The problem is that our code for dealing with CJK text that doesn't have a language associated with it, either through an explicit lang attribute or implied by the encoding, tries to choose a Japanese, Chinese, Korean font based on the accept language or the current system locale.  My guess is something in that code has been broken, causing a Japanese font to be preferred to a Chinese one.
I guess that you changed only one system setting which is user locale or system locale.

http://support.microsoft.com/?scid=kb%3Ben-us%3B246007&x=17&y=9

looks like gfxWindowsFontGroup::GetCJKPrefFonts() refers only system locale.
gfxPlatform::AppendCJKPrefLangs() refers only user locale.

I think that both methods should refer both settings.
(In reply to comment #21)
> I guess that you changed only one system setting which is user locale or system
> locale.
> 
> http://support.microsoft.com/?scid=kb%3Ben-us%3B246007&x=17&y=9
> 
> looks like gfxWindowsFontGroup::GetCJKPrefFonts() refers only system locale.
> gfxPlatform::AppendCJKPrefLangs() refers only user locale.
> 
> I think that both methods should refer both settings.

Nope, both of them has chaged to "Chinese(Simplified, PRC)".
(In reply to comment #17)
> the same problem for me.
> but i find a indirect way to solve it:
> setting the "Sans-serif" font for japanese to any kind of chinese font, then
> all chinese character in firefox UI render correctly.
> may be the developers Deal with the Chinese as Japanese ?

I second this. Restart Firefox after changing Japanese Sans-serif font to any Chinese font, then all Chinese glyphs in chrome are rendered correctly.
Summary: Chinese glyphs in chrome rendered incorrectly → Chinese glyphs in chrome rendered incorrectly (using preference for Japanese font)
After updating to today's nightly build, all Chinese characters are rendered correctly.
But I can't figure out which landed bug fixes this.

Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US;
rv:1.9.3a4pre) Gecko/20100317 Minefield/3.7a4pre
Can this be resolved WORKSFORME now?
(In reply to comment #25)
> Can this be resolved WORKSFORME now?

Yeah, did it.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
blocking2.0: ? → final+
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: