Bug 1881993 - Allow use of important fonts through FontVisibilityLangPack. r=tjr

Differential Revision: https://phabricator.services.mozilla.com/D209589
This commit is contained in:
Fatih
2024-05-16 19:43:13 +00:00
parent 4e77f4c796
commit 57ced7b44f
2 changed files with 14 additions and 0 deletions

View File

@@ -194,3 +194,9 @@ static const char* kBaseFonts_Android12_Higher[] = {
"Source Sans Pro",
"Source Sans Pro SemiBold"
};
// Additional manufacturer font families that are important for usability.
// Set as langpack to allow use through FontVisibilityLangPack
static const char* kLangPack_MFR_Android12_Higher[] = {
"One UI Sans KR VF"
};

View File

@@ -978,6 +978,7 @@ gfxFT2FontList::gfxFT2FontList() : mJarModifiedTime(0) {
CheckFamilyList(kBaseFonts_Android9_Higher);
CheckFamilyList(kBaseFonts_Android9_11);
CheckFamilyList(kBaseFonts_Android12_Higher);
CheckFamilyList(kLangPack_MFR_Android12_Higher);
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
if (obs) {
@@ -1315,6 +1316,10 @@ FontVisibility gfxFT2FontList::GetVisibilityForFamily(
if (FamilyInList(aName, kBaseFonts_Android12_Higher)) {
return FontVisibility::Base;
}
if (FamilyInList(aName, kLangPack_MFR_Android12_Higher)) {
return FontVisibility::LangPack;
}
}
}
@@ -1364,6 +1369,9 @@ gfxFT2FontList::GetFilteredPlatformFontLists() {
fontLists.AppendElement(
std::make_pair(kBaseFonts_Android12_Higher,
ArrayLength(kBaseFonts_Android12_Higher)));
fontLists.AppendElement(
std::make_pair(kLangPack_MFR_Android12_Higher,
ArrayLength(kLangPack_MFR_Android12_Higher)));
}
}