Closed Bug 519149 Opened 15 years ago Closed 15 years ago

font pref menus do not display correctly in Japanese

Categories

(Core :: Graphics, defect, P2)

x86
macOS
defect

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: jtd, Assigned: jfkthame)

References

Details

Attachments

(5 files, 1 obsolete file)

The changes for bug 493280 appear to have broken localized font name handling, fonts do not display correctly in the Japanese localization.

Pre-steps for those not running with Japanese locale defaults:

1. Create a new user acct with the name 'jptest'
2. Log into that acct and run System Prefs
3. Under International, drag 日本語 to the top of the language list to make it the default
4. Log in again with the new 'jptest' acct

Steps:

1. Download Japanese-locale latest trunk build 
2. Start with -ProfileManager and create a new profile
3. Under the Firefox menu select prefs (labeled 環境設定 in Japanese)
4. Click on the Contents panel (labeled コンテンツ)

Problem 1: the font menu is blank

5. Click on the Advanced button (labeled 詳細設定)

Problem 2: Japanese fonts appear with English names

Expected result: The default font appears as xxx and Japanese fonts are listed in the font menu using their Japanese names (see Firefox 3.5).
Flags: blocking1.9.2?
Default font appears as ヒラギノ角ゴ Pro under Japanese
On trunk default font appears blank
Japanese font names are listed in FF 3.5
Pref font settings are incorrect and Japanese fonts are listed with English names
Yes, looks like a regression as a result of over-zealous removal of platform-specific code.... the fix should be to restore a Mac-specific override of gfxFontFamily::LocalizedName.

The attached patch ought to do this; it displays the Japanese font names correctly for me when running a standard (en_US) build with Japanese set as the system's preferred language. (I haven't tried to make a truly localized Japanese build.)
Attachment #403212 - Flags: review?(jdaggett)
This looks like it almost fixes the problem but Osaka-Mono is not correct, it should show up using the Japanese name of the face, Osaka−等幅.  I think you also need to restore the SingleFaceFamily which overrides the localized family method to pull out the full name of the face:

http://mxr.mozilla.org/mozilla1.9.1/source/gfx/thebes/src/gfxQuartzFontCache.mm#646

It might be easier to build the family manually as the old code did but I'll leave that up to you.  The code as it stands now forces all single face families to be considered normal weight, which means synthetic bolding will be used when it shouldn't be.  But we only use this code for dealing with Osaka-Mono right now so it's not critical to get right but it would be nice to have it work as it did before.
Flags: blocking1.9.2? → blocking1.9.2+
Restoring special treatment for "SingleFace" families (Osaka-Mono) in gfxMacPlatformFontList.

AFAICT, this provides the expected localized font names, including the Osaka-Mono case. Tested behavior with various combinations of Japanese and/or Chinese language ahead of English in the system preferences, and the appropriate localized names are displayed.
Assignee: nobody → jfkthame
Attachment #403212 - Attachment is obsolete: true
Attachment #403871 - Flags: review?(jdaggett)
Attachment #403212 - Flags: review?(jdaggett)
Comment on attachment 403871 [details] [diff] [review]
fix localized family names, including SingleFace families

Looks good and I confirmed that Japanese fonts show up correctly in the font lists.
Attachment #403871 - Flags: review?(jdaggett) → review+
Pushed to mozilla-central:
http://hg.mozilla.org/mozilla-central/rev/3756cdca8b54
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: