diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /gfx/thebes/gfxFcPlatformFontList.cpp | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/thebes/gfxFcPlatformFontList.cpp')
-rw-r--r-- | gfx/thebes/gfxFcPlatformFontList.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp index 60a8f9894e..30c202d6ee 100644 --- a/gfx/thebes/gfxFcPlatformFontList.cpp +++ b/gfx/thebes/gfxFcPlatformFontList.cpp @@ -2048,6 +2048,49 @@ FontVisibility gfxFcPlatformFontList::GetVisibilityForFamily( } } +nsTArray<std::pair<const char**, uint32_t>> +gfxFcPlatformFontList::GetFilteredPlatformFontLists() { + AssignFontVisibilityDevice(); + + nsTArray<std::pair<const char**, uint32_t>> fontLists; + + switch (sFontVisibilityDevice) { + case Device::Linux_Ubuntu_any: + case Device::Linux_Ubuntu_22: + fontLists.AppendElement(std::make_pair( + kBaseFonts_Ubuntu_22_04, ArrayLength(kBaseFonts_Ubuntu_22_04))); + fontLists.AppendElement(std::make_pair( + kLangFonts_Ubuntu_22_04, ArrayLength(kLangFonts_Ubuntu_22_04))); + // For Ubuntu_any, we fall through to also check the 20_04 lists. + [[fallthrough]]; + + case Device::Linux_Ubuntu_20: + fontLists.AppendElement(std::make_pair( + kBaseFonts_Ubuntu_20_04, ArrayLength(kBaseFonts_Ubuntu_20_04))); + fontLists.AppendElement(std::make_pair( + kLangFonts_Ubuntu_20_04, ArrayLength(kLangFonts_Ubuntu_20_04))); + break; + + case Device::Linux_Fedora_any: + case Device::Linux_Fedora_39: + fontLists.AppendElement(std::make_pair( + kBaseFonts_Fedora_39, ArrayLength(kBaseFonts_Fedora_39))); + // For Fedora_any, fall through to also check Fedora 38 list. + [[fallthrough]]; + + case Device::Linux_Fedora_38: + fontLists.AppendElement(std::make_pair( + kBaseFonts_Fedora_38, ArrayLength(kBaseFonts_Fedora_38))); + break; + + default: + // We don't know how to categorize fonts on this system + break; + } + + return fontLists; +} + gfxFontEntry* gfxFcPlatformFontList::CreateFontEntry( fontlist::Face* aFace, const fontlist::Family* aFamily) { nsAutoCString desc(aFace->mDescriptor.AsString(SharedFontList())); |