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

NEW
Unassigned

Status

()

Core
Graphics
--
enhancement
10 years ago
6 years ago

People

(Reporter: Jjgod Jiang, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

10 years ago
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.
(Reporter)

Comment 1

10 years ago
Created attachment 309805 [details] [diff] [review]
Use AppleLanguages preference to do CJK language fallback

Here is a patch to fix this problem.
Attachment #309805 - Flags: review?(pavlov)
Attachment #309805 - Flags: review?(jdaggett)
(Reporter)

Comment 2

10 years ago
Created attachment 309806 [details] [diff] [review]
Use AppleLanguages preference to do CJK language fallback

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)

Comment 3

10 years ago
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
You need to log in before you can comment on or make changes to this bug.