gdi32: Use Microsoft and Unicode encodings in priority for font names.
This commit is contained in:
parent
537d809189
commit
87c2581c54
|
@ -1306,10 +1306,12 @@ static inline WORD get_mac_code_page( const FT_SfntName *name )
|
|||
static int match_name_table_language( const FT_SfntName *name, LANGID lang )
|
||||
{
|
||||
LANGID name_lang;
|
||||
int res = 0;
|
||||
|
||||
switch (name->platform_id)
|
||||
{
|
||||
case TT_PLATFORM_MICROSOFT:
|
||||
res += 5; /* prefer the Microsoft name */
|
||||
switch (name->encoding_id)
|
||||
{
|
||||
case TT_MS_ID_UNICODE_CS:
|
||||
|
@ -1326,6 +1328,7 @@ static int match_name_table_language( const FT_SfntName *name, LANGID lang )
|
|||
name_lang = mac_langid_table[name->language_id];
|
||||
break;
|
||||
case TT_PLATFORM_APPLE_UNICODE:
|
||||
res += 2; /* prefer Unicode encodings */
|
||||
switch (name->encoding_id)
|
||||
{
|
||||
case TT_APPLE_ID_DEFAULT:
|
||||
|
@ -1341,10 +1344,10 @@ static int match_name_table_language( const FT_SfntName *name, LANGID lang )
|
|||
default:
|
||||
return 0;
|
||||
}
|
||||
if (name_lang == lang) return 3;
|
||||
if (PRIMARYLANGID( name_lang ) == PRIMARYLANGID( lang )) return 2;
|
||||
if (name_lang == MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT )) return 1;
|
||||
return 0;
|
||||
if (name_lang == lang) res += 30;
|
||||
else if (PRIMARYLANGID( name_lang ) == PRIMARYLANGID( lang )) res += 20;
|
||||
else if (name_lang == MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT )) res += 10;
|
||||
return res;
|
||||
}
|
||||
|
||||
static WCHAR *copy_name_table_string( const FT_SfntName *name )
|
||||
|
|
Loading…
Reference in New Issue