Closed Bug 423301 Opened 16 years ago Closed 1 year ago

Use AppleLanguages for CJK Pref Langs, remove deprecated Script Manager API usage

Categories

(Core :: Graphics: Text, enhancement)

All
macOS
enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: gzjjgod, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) AppleWebKit/523.15.1 (KHTML, like Gecko) Version/3.0.4 Safari/523.15
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b5pre) Gecko/2008031604 Minefield/3.0b5pre

GFX/Thebes on Mac should consider the language order in System Preferences for CJK font matching. At present it only consider the first language. Besides, the API it used (GetScriptManagerVariable()) is already deprecated in Mac OS X 10.5.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Here is a patch to fix this problem.
Attachment #309805 - Flags: review?(pavlov)
Attachment #309805 - Flags: review?(jdaggett)
minor update, fix a memory leak
Attachment #309805 - Attachment is obsolete: true
Attachment #309806 - Flags: review?(pavlov)
Attachment #309806 - Flags: review?(jdaggett)
Attachment #309805 - Flags: review?(pavlov)
Attachment #309805 - Flags: review?(jdaggett)
This looks like the right approach basically.  I don't think we need the entries related to x-western, since they aren't used, right?  Beyond the scope of CJK, it definitely might make sense to use these prefs to set the font style lang field when the lang isn't known clearly, right now it's always set to x-western.
Status: UNCONFIRMED → NEW
Ever confirmed: true
One thing to watch is that on systems that were upgrades from 10.3 or earlier to 10.4 and above, I believe the old zh-CN and zh-TW language codes will still be in use unless the user deletes and then re-adds those languages in the list in System Prefs.

I don't have any such system to check, but that's my recollection from when we dealt with that changeover in Camino (which uses that list for accept-lang).
Does this still need doing? We don't seem to use GetScriptManagerVariable() any more.
(In reply to Joe Drew (:JOEDREW!) from comment #5)
> Does this still need doing? We don't seem to use GetScriptManagerVariable()
> any more.

I guess we can use [NSLocale preferredLanguages:] instead.
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSLocale_Class/Reference/Reference.html#//apple_ref/occ/cl/NSLocale
Severity: normal → S3
Component: Graphics → Graphics: Text

I believe this is handled by gfxPlatformFontList these days, using intl/locale/OSPreferences for the system locale list.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: