commit 093426b4b7e2ac89cfc7cd1cabd404bee953f32b Author: Jonathan Kew jkew@mozilla.com Date: Mon Dec 13 20:09:36 2021 +0000
Bug 1745715 - Process app-bundled fonts before system fonts when initializing the font list, to ensure their families get the expected Base visibility level. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133667 --- gfx/thebes/gfxFcPlatformFontList.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp index 41a305c537c4..3b6029bd4353 100644 --- a/gfx/thebes/gfxFcPlatformFontList.cpp +++ b/gfx/thebes/gfxFcPlatformFontList.cpp @@ -1524,17 +1524,21 @@ nsresult gfxFcPlatformFontList::InitFontListForPlatform() { } #endif
- // iterate over available fonts - FcFontSet* systemFonts = FcConfigGetFonts(nullptr, FcSetSystem); - AddFontSetFamilies(systemFonts, policy.get(), /* aAppFonts = */ false); - #ifdef MOZ_BUNDLED_FONTS + // https://bugzilla.mozilla.org/show_bug.cgi?id=1745715: + // It's important to do this *before* processing the standard system fonts, + // so that if a family is present in both font sets, we'll treat it as app- + // bundled and therefore always visible. if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) { FcFontSet* appFonts = FcConfigGetFonts(nullptr, FcSetApplication); AddFontSetFamilies(appFonts, policy.get(), /* aAppFonts = */ true); } #endif
+ // iterate over available fonts + FcFontSet* systemFonts = FcConfigGetFonts(nullptr, FcSetSystem); + AddFontSetFamilies(systemFonts, policy.get(), /* aAppFonts = */ false); + return NS_OK; }
tor-commits@lists.torproject.org