[tbb-commits] [tor-browser/tor-browser-38.3.0esr-5.5-1] fixup! Bug #13313: Pref 'font.system.whitelist' restricts set of permitted fonts

gk at torproject.org gk at torproject.org
Fri Sep 18 14:18:39 UTC 2015


commit 9878431b2531415aad76c717c68b5b08dec4ffc4
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date:   Sat Aug 15 15:09:40 2015 +0000

    fixup! Bug #13313: Pref 'font.system.whitelist' restricts set of permitted fonts
    
    Don't apply font whitelist in linux -- we'll use a font.conf file instead
---
 gfx/thebes/gfxFontconfigUtils.cpp |   31 -------------------------------
 gfx/thebes/gfxFontconfigUtils.h   |    3 ---
 2 files changed, 34 deletions(-)

diff --git a/gfx/thebes/gfxFontconfigUtils.cpp b/gfx/thebes/gfxFontconfigUtils.cpp
index 829a52e..f5d3e9c 100644
--- a/gfx/thebes/gfxFontconfigUtils.cpp
+++ b/gfx/thebes/gfxFontconfigUtils.cpp
@@ -587,9 +587,6 @@ gfxFontconfigUtils::UpdateFontListInternal(bool aForce)
     ActivateBundledFonts();
 #endif
 
-    ApplyWhitelist();
-    currentConfig = FcConfigGetCurrent();
-
     // These FcFontSets are owned by fontconfig
     FcFontSet *fontSets[] = {
         FcConfigGetFonts(currentConfig, FcSetSystem)
@@ -1090,32 +1087,4 @@ gfxFontconfigUtils::ActivateBundledFonts()
     }
 }
 
-void
-gfxFontconfigUtils::ApplyWhitelist()
-{
-    // Get the font family names in the font file loaded in the old configuration.
-    // If any of the font families are in our whitelist, then add that
-    // file to the new configuration. Otherwise, leave it out.
-    FcPattern *pattern = FcPatternCreate();
-    FcObjectSet *objectSet = FcObjectSetBuild(FC_FILE, FC_FAMILY, nullptr);
-    FcFontSet *fontSet = FcFontList(nullptr, pattern, objectSet);
-    FcConfig *newConfig = FcConfigCreate();
-    for (int i = 0; i < fontSet->nfont; ++i) {
-        FcPattern *font = fontSet->fonts[i];
-        FcChar8 *file, *family;
-        FcPatternGetString(font, FC_FILE, 0, &file);
-        for (int j = 0;
-             FcPatternGetString(font,
-                                FC_FAMILY, j, &family) == FcResultMatch;
-             ++j) {
-            nsAutoCString strFamily((char *) family);
-            if (gfxFontUtils::IsFontFamilyNameAllowed(NS_ConvertUTF8toUTF16(strFamily))) {
-                FcConfigAppFontAddFile(newConfig, file);
-                break;
-            }
-        }
-    }
-    FcConfigSetCurrent(newConfig);
-}
-
 #endif
diff --git a/gfx/thebes/gfxFontconfigUtils.h b/gfx/thebes/gfxFontconfigUtils.h
index 7bd0cfc..de9f27f 100644
--- a/gfx/thebes/gfxFontconfigUtils.h
+++ b/gfx/thebes/gfxFontconfigUtils.h
@@ -310,9 +310,6 @@ protected:
     nsCString mBundledFontsPath;
     bool      mBundledFontsInitialized;
 #endif
-
-private:
-    void      ApplyWhitelist();
 };
 
 #endif /* GFX_FONTCONFIG_UTILS_H */





More information about the tbb-commits mailing list