@@ -822,28 +822,30 @@ explicit gfxSingleFaceMacFontFamily(const nsACString& aName)
822
822
: gfxPlatformFontList(false ), mDefaultFont(nullptr ), mUseSizeSensitiveSystemFont(false ) {
823
823
CheckFamilyList (kBaseFonts , ArrayLength (kBaseFonts ));
824
824
825
+ // It appears to be sufficient to activate fonts in the parent process;
826
+ // they are then also usable in child processes.
827
+ // Likewise, only the parent process listens for OS font-changed notifications;
828
+ // after rebuilding its list, it will update the content processes.
829
+ if (XRE_IsParentProcess ()) {
825
830
#ifdef MOZ_BUNDLED_FONTS
826
- // We activate bundled fonts if the pref is > 0 (on) or < 0 (auto), only an
827
- // explicit value of 0 (off) will disable them.
828
- if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup () != 0 ) {
829
- ActivateBundledFonts ();
830
- }
831
+ // We activate bundled fonts if the pref is > 0 (on) or < 0 (auto), only an
832
+ // explicit value of 0 (off) will disable them.
833
+ if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup () != 0 ) {
834
+ ActivateBundledFonts ();
835
+ }
831
836
#endif
832
837
833
- for (const auto & dir : kLangFontsDirs ) {
834
- nsresult rv;
835
- nsCOMPtr<nsIFile> langFonts (do_CreateInstance (NS_LOCAL_FILE_CONTRACTID, &rv));
836
- if (NS_SUCCEEDED(rv)) {
837
- rv = langFonts->InitWithNativePath (dir);
838
+ for (const auto & dir : kLangFontsDirs ) {
839
+ nsresult rv;
840
+ nsCOMPtr<nsIFile> langFonts (do_CreateInstance (NS_LOCAL_FILE_CONTRACTID, &rv));
838
841
if (NS_SUCCEEDED(rv)) {
839
- ActivateFontsFromDir (langFonts);
842
+ rv = langFonts->InitWithNativePath (dir);
843
+ if (NS_SUCCEEDED(rv)) {
844
+ ActivateFontsFromDir (langFonts);
845
+ }
840
846
}
841
847
}
842
- }
843
848
844
- // Only the parent process listens for OS font-changed notifications;
845
- // after rebuilding its list, it will update the content processes.
846
- if (XRE_IsParentProcess ()) {
847
849
::CFNotificationCenterAddObserver (::CFNotificationCenterGetLocalCenter(), this,
848
850
RegisteredFontsChangedNotificationCallback,
849
851
kCTFontManagerRegisteredFontsChangedNotification, 0,
0 commit comments