summaryrefslogtreecommitdiff
path: root/thirdparty/harfbuzz/src/hb-ot-name-table.hh
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-ot-name-table.hh')
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-name-table.hh14
1 files changed, 5 insertions, 9 deletions
diff --git a/thirdparty/harfbuzz/src/hb-ot-name-table.hh b/thirdparty/harfbuzz/src/hb-ot-name-table.hh
index 01107aad67..1f2131ffcc 100644
--- a/thirdparty/harfbuzz/src/hb-ot-name-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-name-table.hh
@@ -175,15 +175,11 @@ _hb_ot_name_entry_cmp_key (const void *pa, const void *pb, bool exact)
signed c = strcmp (astr, bstr);
- if (!exact && c)
- {
- unsigned la = strlen (astr);
- unsigned lb = strlen (bstr);
- // 'a' is the user request, and 'b' is string in the font.
- // If eg. user asks for "en-us" and font has "en", approve.
- if (la > lb && astr[lb] == '-' && !strncmp (astr, bstr, lb))
- return 0;
- }
+ // 'a' is the user request, and 'b' is string in the font.
+ // If eg. user asks for "en-us" and font has "en", approve.
+ if (!exact && c &&
+ hb_language_matches (b->language, a->language))
+ return 0;
return c;
}