diff options
Diffstat (limited to 'gfx/thebes/gfxPlatformFontList.cpp')
-rw-r--r-- | gfx/thebes/gfxPlatformFontList.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index bc0e123f85..6c1d641509 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -435,12 +435,6 @@ void gfxPlatformFontList::ApplyWhitelist() { AutoTArray<RefPtr<gfxFontFamily>, 128> accepted; bool whitelistedFontFound = false; for (const auto& entry : mFontFamilies) { - if (entry.GetData()->IsHidden()) { - // Hidden system fonts are exempt from whitelisting, but don't count - // towards determining whether we "kept" any (user-visible) fonts - accepted.AppendElement(entry.GetData()); - continue; - } nsAutoCString fontFamilyName(entry.GetKey()); ToLowerCase(fontFamilyName); if (familyNamesWhitelist.Contains(fontFamilyName)) { @@ -476,8 +470,7 @@ void gfxPlatformFontList::ApplyWhitelist( AutoTArray<fontlist::Family::InitData, 128> accepted; bool keptNonHidden = false; for (auto& f : aFamilies) { - if (f.mVisibility == FontVisibility::Hidden || - familyNamesWhitelist.Contains(f.mKey)) { + if (familyNamesWhitelist.Contains(f.mKey)) { accepted.AppendElement(f); if (f.mVisibility != FontVisibility::Hidden) { keptNonHidden = true; @@ -2209,6 +2202,12 @@ eFontPrefLang gfxPlatformFontList::GetFontPrefLangFor(const char* aLang) { if (!nsCRT::strcasecmp(gPrefLangNames[i], aLang)) { return eFontPrefLang(i); } + // If the pref-lang is a two-character lang tag, try ignoring any trailing + // subtags in aLang and see if the base lang matches. + if (strlen(gPrefLangNames[i]) == 2 && strlen(aLang) > 3 && + aLang[2] == '-' && !nsCRT::strncasecmp(gPrefLangNames[i], aLang, 2)) { + return eFontPrefLang(i); + } } return eFontPrefLang_Others; } |