Verified Commit ecc6de5c authored by Jonathan Kew's avatar Jonathan Kew Committed by Pier Angelo Vendrame
Browse files

Bug 1792157 - Ensure correct font-visibility for bundled fonts on Linux when...

Bug 1792157 - Ensure correct font-visibility for bundled fonts on Linux when they 'shadow' system-installed families. r=gfx-reviewers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D175350
parent be05d7b9
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1869,17 +1869,19 @@ void gfxFcPlatformFontList::InitSharedFontListForPlatform() {
    }
  };

  // iterate over available fonts
  FcFontSet* systemFonts = FcConfigGetFonts(nullptr, FcSetSystem);
  addFontSetFamilies(systemFonts, policy.get(), /* aAppFonts = */ false);

#ifdef MOZ_BUNDLED_FONTS
  // Add bundled fonts before system fonts, to set correct visibility status
  // for any families that appear in both.
  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);

  mozilla::fontlist::FontList* list = SharedFontList();
  list->SetFamilyNames(families);