summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxFcPlatformFontList.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /gfx/thebes/gfxFcPlatformFontList.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.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.cpp43
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()));