diff --git a/gfx/thebes/StandardFonts-linux.inc b/gfx/thebes/StandardFonts-linux.inc index cfaf7e37be31..bf5c285b0d7c 100644 --- a/gfx/thebes/StandardFonts-linux.inc +++ b/gfx/thebes/StandardFonts-linux.inc @@ -1005,3 +1005,61 @@ static const char* kBaseFonts_Fedora_39[] = { "ആർഐടി രചന", "രചന", }; + +// List of standard font families installed on Fedora 38 Workstation. +static const char* kBaseFonts_Fedora_38[] = { + "Cantarell", + "Jomolhari", + "Liberation Mono", + "Liberation Sans", + "Liberation Serif", + "Lohit Assamese", + "Lohit Bengali", + "Lohit Devanagari", + "Lohit Gujarati", + "Lohit Kannada", + "Lohit Marathi", + "Lohit Odia", + "Lohit Tamil", + "Lohit Telugu", + "Mingzat", + "Noto Color Emoji", + "Noto Naskh Arabic", + "Noto Sans", + "Noto Sans Arabic", + "Noto Sans Armenian", + "Noto Sans Canadian Aboriginal", + "Noto Sans Cherokee", + "Noto Sans CJK HK", + "Noto Sans CJK JP", + "Noto Sans CJK KR", + "Noto Sans CJK SC", + "Noto Sans CJK TC", + "Noto Sans Ethiopic", + "Noto Sans Georgian", + "Noto Sans Gurmukhi", + "Noto Sans Hebrew", + "Noto Sans Khmer", + "Noto Sans Lao", + "Noto Sans Math", + "Noto Sans Mono", + "Noto Sans Mono CJK HK", + "Noto Sans Mono CJK JP", + "Noto Sans Mono CJK KR", + "Noto Sans Mono CJK SC", + "Noto Sans Mono CJK TC", + "Noto Sans Sinhala", + "Noto Sans Thaana", + "Noto Sans Thai", + "Noto Serif", + "Nuosu SIL", + "Padauk", + "PakType Naskh Basic", + "RIT Meera New", + "STIX", + "STIX Two Math", + "STIX Two Text", + "STIX Two Text Medium", + "STIX Two Text SemiBold", + "Vazirmatn", +}; diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp index 14b4afb4c637..17b4dc21564f 100644 --- a/gfx/thebes/gfxFcPlatformFontList.cpp +++ b/gfx/thebes/gfxFcPlatformFontList.cpp @@ -1359,6 +1359,7 @@ gfxFcPlatformFontList::gfxFcPlatformFontList() CheckFamilyList(kBaseFonts_Ubuntu_20_04); CheckFamilyList(kLangFonts_Ubuntu_20_04); CheckFamilyList(kBaseFonts_Fedora_39); + CheckFamilyList(kBaseFonts_Fedora_38); mLastConfig = FcConfigGetCurrent(); if (XRE_IsParentProcess()) { // if the rescan interval is set, start the timer @@ -1999,7 +2000,7 @@ gfxFcPlatformFontList::DistroID gfxFcPlatformFontList::GetDistroID() const { if (strncmp(buf + 3, "ubuntu", 6) == 0) { result = DistroID::Ubuntu_any; } else if (strncmp(buf + 3, "fedora", 6) == 0) { - result = DistroID::Fedora; + result = DistroID::Fedora_any; } if (versionMajor) { break; @@ -2014,6 +2015,12 @@ gfxFcPlatformFontList::DistroID gfxFcPlatformFontList::GetDistroID() const { } else if (versionMajor == 22) { result = DistroID::Ubuntu_22; } + } else if (result == DistroID::Fedora_any) { + if (versionMajor == 38) { + result = DistroID::Fedora_38; + } else if (versionMajor == 39) { + result = DistroID::Fedora_39; + } } return result; }; @@ -2048,10 +2055,21 @@ FontVisibility gfxFcPlatformFontList::GetVisibilityForFamily( } return FontVisibility::User; - case DistroID::Fedora: + case DistroID::Fedora_any: + case DistroID::Fedora_39: if (FamilyInList(aName, kBaseFonts_Fedora_39)) { return FontVisibility::Base; } + if (distro == DistroID::Fedora_39) { + return FontVisibility::User; + } + // For Fedora_any, fall through to also check Fedora 38 list. + [[fallthrough]]; + + case DistroID::Fedora_38: + if (FamilyInList(aName, kBaseFonts_Fedora_38)) { + return FontVisibility::Base; + } return FontVisibility::User; default: diff --git a/gfx/thebes/gfxFcPlatformFontList.h b/gfx/thebes/gfxFcPlatformFontList.h index c3a0546b2e30..93ea34d52053 100644 --- a/gfx/thebes/gfxFcPlatformFontList.h +++ b/gfx/thebes/gfxFcPlatformFontList.h @@ -356,7 +356,9 @@ class gfxFcPlatformFontList final : public gfxPlatformFontList { Ubuntu_any, Ubuntu_20, Ubuntu_22, - Fedora, + Fedora_any, + Fedora_38, + Fedora_39, // To be extended with any distros that ship a useful base set of fonts // that we want to explicitly support. };