Fix lang matching logic
Previous code was broken logically, but harmless.
This commit is contained in:
parent
ee5350d667
commit
f381e320df
@ -845,7 +845,7 @@ hb_ot_tag_from_language (hb_language_t language)
|
||||
{
|
||||
const LangTagLong *lang_tag;
|
||||
lang_tag = &ot_languages_zh[i];
|
||||
if (lang_matches (lang_tag->language, lang_str))
|
||||
if (lang_matches (lang_str, lang_tag->language))
|
||||
return lang_tag->tag;
|
||||
}
|
||||
|
||||
|
@ -195,6 +195,7 @@ test_ot_tag_language (void)
|
||||
|
||||
test_language_two_way ("ZHH", "zh-hk"); /* Chinese (Hong Kong) */
|
||||
|
||||
test_tag_from_language ("ZHS", "zh"); /* Chinese */
|
||||
test_tag_from_language ("ZHS", "zh-cn"); /* Chinese (China) */
|
||||
test_tag_from_language ("ZHS", "zh-sg"); /* Chinese (Singapore) */
|
||||
test_tag_from_language ("ZHT", "zh-mo"); /* Chinese (Macao) */
|
||||
|
Loading…
Reference in New Issue
Block a user