Backed out 10 changesets (bug 1056479) for bustage on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 12 May 2015 08:25:19 +0200
changeset 243465 6127b1d28cb57d32cd9c8836032b4bf1657b48b7
parent 243464 2321901d8d220b9e2f8e4f0e34803b04fe3b7282
child 243466 e439532cdc8211a5e2c321780c995bff8590d9cf
push id28738
push usercbook@mozilla.com
push dateTue, 12 May 2015 14:11:31 +0000
treeherdermozilla-central@bedce1b405a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1056479
milestone40.0a1
backs outd5b1f2b7891552474afd7b1a2b9c34d129498b04
bcc65b714dd694ccf8d016be7f2cc48698532c9b
0b35e8a463d2bef4a311ed4847571cda7123ddbe
0933391809c952884b1d65b0b7bcd2044a2ea7c8
93bd67204fac4d9a157f02d2aa53a2dd14577795
5260b93eb0b9b8c61bdb39a3c75f174e735f3876
130bea3f862320d01eea4b4b9f308133851f8eea
408e078cc18d02c55a2b0a0190ec8f60d6d4ba06
a651c240979dff66780875ad0752ec89c8d8312d
d74ae8fcaac94d37c6c07036bd0afd80dcfcfc8b
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 10 changesets (bug 1056479) for bustage on a CLOSED TREE Backed out changeset d5b1f2b78915 (bug 1056479) Backed out changeset bcc65b714dd6 (bug 1056479) Backed out changeset 0b35e8a463d2 (bug 1056479) Backed out changeset 0933391809c9 (bug 1056479) Backed out changeset 93bd67204fac (bug 1056479) Backed out changeset 5260b93eb0b9 (bug 1056479) Backed out changeset 130bea3f8623 (bug 1056479) Backed out changeset 408e078cc18d (bug 1056479) Backed out changeset a651c240979d (bug 1056479) Backed out changeset d74ae8fcaac9 (bug 1056479)
accessible/base/TextAttrs.cpp
dom/ipc/ContentParent.cpp
gfx/tests/crashtests/crashtests.list
gfx/thebes/gfxAndroidPlatform.cpp
gfx/thebes/gfxAndroidPlatform.h
gfx/thebes/gfxDWriteFontList.cpp
gfx/thebes/gfxDWriteFontList.h
gfx/thebes/gfxFT2FontList.cpp
gfx/thebes/gfxFT2FontList.h
gfx/thebes/gfxFcPlatformFontList.cpp
gfx/thebes/gfxFcPlatformFontList.h
gfx/thebes/gfxFont.h
gfx/thebes/gfxGDIFontList.cpp
gfx/thebes/gfxGDIFontList.h
gfx/thebes/gfxPangoFonts.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatform.h
gfx/thebes/gfxPlatformFontList.cpp
gfx/thebes/gfxPlatformFontList.h
gfx/thebes/gfxPlatformGtk.cpp
gfx/thebes/gfxPlatformGtk.h
gfx/thebes/gfxTextRun.cpp
gfx/thebes/gfxTextRun.h
gfx/thebes/moz.build
layout/base/nsPresContext.cpp
layout/base/tests/chrome/printpreview_helper.xul
layout/reftests/font-face/reftest.list
layout/reftests/font-face/src-list-local-full-quotes.html
layout/reftests/font-face/src-list-local-full.html
modules/libpref/init/all.js
--- a/accessible/base/TextAttrs.cpp
+++ b/accessible/base/TextAttrs.cpp
@@ -13,20 +13,16 @@
 #include "gfxFont.h"
 #include "nsFontMetrics.h"
 #include "nsLayoutUtils.h"
 #include "nsContainerFrame.h"
 #include "HyperTextAccessible.h"
 #include "mozilla/AppUnits.h"
 #include "mozilla/gfx/2D.h"
 
-#if defined(MOZ_WIDGET_GTK)
-#include "gfxPlatformGtk.h" // xxx - for UseFcFontList
-#endif
-
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // TextAttrsMgr
 ////////////////////////////////////////////////////////////////////////////////
 
 void
@@ -627,40 +623,31 @@ TextAttrsMgr::FontWeightTextAttr::
   // When there doesn't exist a bold font in the family and so the rendering of
   // a non-bold font face is changed so that the user sees what looks like a
   // bold font, i.e. synthetic bolding is used. IsSyntheticBold method is only
   // needed on Mac, but it is "safe" to use on all platforms.  (For non-Mac
   // platforms it always return false.)
   if (font->IsSyntheticBold())
     return 700;
 
-  bool useFontEntryWeight = true;
-
-  // Under Linux, when gfxPangoFontGroup code is used,
-  // font->GetStyle()->weight will give the absolute weight requested of the
-  // font face. The gfxPangoFontGroup code uses the gfxFontEntry constructor
-  // which doesn't initialize the weight field.
-#if defined(MOZ_WIDGET_QT)
-  useFontEntryWeight = false;
-#elif defined(MOZ_WIDGET_GTK)
-  useFontEntryWeight = gfxPlatformGtk::UseFcFontList();
+#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
+  // On Linux, font->GetStyle()->weight will give the absolute weight requested
+  // of the font face. The Linux code uses the gfxFontEntry constructor which
+  // doesn't initialize the weight field.
+  return font->GetStyle()->weight;
+#else
+  // On Windows, font->GetStyle()->weight will give the same weight as
+  // fontEntry->Weight(), the weight of the first font in the font group, which
+  // may not be the weight of the font face used to render the characters.
+  // On Mac, font->GetStyle()->weight will just give the same number as
+  // getComputedStyle(). fontEntry->Weight() will give the weight of the font
+  // face used.
+  gfxFontEntry *fontEntry = font->GetFontEntry();
+  return fontEntry->Weight();
 #endif
-
-  if (useFontEntryWeight) {
-    // On Windows, font->GetStyle()->weight will give the same weight as
-    // fontEntry->Weight(), the weight of the first font in the font group,
-    // which may not be the weight of the font face used to render the
-    // characters. On Mac, font->GetStyle()->weight will just give the same
-    // number as getComputedStyle(). fontEntry->Weight() will give the weight
-    // of the font face used.
-    gfxFontEntry *fontEntry = font->GetFontEntry();
-    return fontEntry->Weight();
-  } else {
-    return font->GetStyle()->weight;
-  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // AutoGeneratedTextAttr
 ////////////////////////////////////////////////////////////////////////////////
 TextAttrsMgr::AutoGeneratedTextAttr::
   AutoGeneratedTextAttr(HyperTextAccessible* aHyperTextAcc,
                         Accessible* aAccessible) :
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2543,17 +2543,17 @@ ContentParent::RecvReadPrefsArray(Infall
     Preferences::GetPreferences(aPrefs);
     return true;
 }
 
 bool
 ContentParent::RecvReadFontList(InfallibleTArray<FontListEntry>* retValue)
 {
 #ifdef ANDROID
-    gfxAndroidPlatform::GetPlatform()->GetSystemFontList(retValue);
+    gfxAndroidPlatform::GetPlatform()->GetFontList(retValue);
 #endif
     return true;
 }
 
 bool
 ContentParent::RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissions)
 {
 #ifdef MOZ_PERMISSIONS
--- a/gfx/tests/crashtests/crashtests.list
+++ b/gfx/tests/crashtests/crashtests.list
@@ -97,17 +97,17 @@ load 633322-1.html
 load 665218.html
 load 686190-1.html
 load 693143-1.html
 load 768079-1.html
 load 783041-1.html
 load 783041-2.html
 load 783041-3.html
 load 783041-4.html
-load 798853.html # bug 868792
+asserts-if(gtk2Widget,1) load 798853.html # bug 868792
 asserts-if(winWidget,0-1) skip-if(B2G) load 815489.html
 load 836225-1.html
 load 839745-1.html
 load 856784-1.html
 load 893572-1.html
 load 893572-2.html
 load 893572-3.html
 load 893572-4.html
--- a/gfx/thebes/gfxAndroidPlatform.cpp
+++ b/gfx/thebes/gfxAndroidPlatform.cpp
@@ -242,19 +242,19 @@ gfxAndroidPlatform::GetFontList(nsIAtom 
 {
     gfxPlatformFontList::PlatformFontList()->GetFontList(aLangGroup,
                                                          aGenericFamily,
                                                          aListOfFonts);
     return NS_OK;
 }
 
 void
-gfxAndroidPlatform::GetSystemFontList(InfallibleTArray<FontListEntry>* retValue)
+gfxAndroidPlatform::GetFontList(InfallibleTArray<FontListEntry>* retValue)
 {
-    gfxFT2FontList::PlatformFontList()->GetSystemFontList(retValue);
+    gfxFT2FontList::PlatformFontList()->GetFontList(retValue);
 }
 
 nsresult
 gfxAndroidPlatform::UpdateFontList()
 {
     gfxPlatformFontList::PlatformFontList()->UpdateFontList();
     return NS_OK;
 }
--- a/gfx/thebes/gfxAndroidPlatform.h
+++ b/gfx/thebes/gfxAndroidPlatform.h
@@ -35,17 +35,17 @@ public:
                            gfxContentType contentType);
     
     virtual gfxImageFormat GetOffscreenFormat() { return mOffscreenFormat; }
     
     mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
       GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont);
 
     // to support IPC font list (sharing between chrome and content)
-    void GetSystemFontList(InfallibleTArray<FontListEntry>* retValue);
+    void GetFontList(InfallibleTArray<FontListEntry>* retValue);
 
     // platform implementations of font functions
     virtual bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags);
     virtual gfxPlatformFontList* CreatePlatformFontList();
     virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
                                           uint16_t aWeight,
                                           int16_t aStretch,
                                           bool aItalic);
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -1299,19 +1299,17 @@ gfxDWriteFontList::GetStandardFamilyName
         family->LocalizedName(aFamilyName);
         return true;
     }
 
     return false;
 }
 
 gfxFontFamily*
-gfxDWriteFontList::FindFamily(const nsAString& aFamily,
-                              nsIAtom* aLanguage,
-                              bool aUseSystemFonts)
+gfxDWriteFontList::FindFamily(const nsAString& aFamily, bool aUseSystemFonts)
 {
     if (!mInitialized) {
         mInitialized = true;
         DelayedInitFontList();
     }
 
     nsAutoString keyName(aFamily);
     BuildKeyNameFromFontName(keyName);
--- a/gfx/thebes/gfxDWriteFontList.h
+++ b/gfx/thebes/gfxDWriteFontList.h
@@ -360,17 +360,16 @@ public:
     
     bool GetStandardFamilyName(const nsAString& aFontName,
                                  nsAString& aFamilyName);
 
     IDWriteGdiInterop *GetGDIInterop() { return mGDIInterop; }
     bool UseGDIFontTableAccess() { return mGDIFontTableAccess; }
 
     virtual gfxFontFamily* FindFamily(const nsAString& aFamily,
-                                      nsIAtom* aLanguage = nullptr,
                                       bool aUseSystemFonts = false);
 
     virtual void GetFontFamilyList(nsTArray<nsRefPtr<gfxFontFamily> >& aFamilyArray);
 
     gfxFloat GetForceGDIClassicMaxFontSize() { return mForceGDIClassicMaxFontSize; }
 
     virtual void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
                                         FontListSizes* aSizes) const;
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -1352,17 +1352,17 @@ AddHiddenFamilyToFontList(nsStringHashKe
 
     FT2FontFamily *family = static_cast<FT2FontFamily*>(aFamily.get());
     family->AddFacesToFontList(fontlist, FT2FontFamily::kHidden);
 
     return PL_DHASH_NEXT;
 }
 
 void
-gfxFT2FontList::GetSystemFontList(InfallibleTArray<FontListEntry>* retValue)
+gfxFT2FontList::GetFontList(InfallibleTArray<FontListEntry>* retValue)
 {
     mFontFamilies.Enumerate(AddFamilyToFontList, retValue);
     mHiddenFontFamilies.Enumerate(AddHiddenFamilyToFontList, retValue);
 }
 
 static void
 LoadSkipSpaceLookupCheck(nsTHashtable<nsStringHashKey>& aSkipSpaceLookupCheck)
 {
--- a/gfx/thebes/gfxFT2FontList.h
+++ b/gfx/thebes/gfxFT2FontList.h
@@ -129,17 +129,17 @@ public:
 
     virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
                                            uint16_t aWeight,
                                            int16_t aStretch,
                                            bool aItalic,
                                            const uint8_t* aFontData,
                                            uint32_t aLength);
 
-    void GetSystemFontList(InfallibleTArray<FontListEntry>* retValue);
+    void GetFontList(InfallibleTArray<FontListEntry>* retValue);
 
     static gfxFT2FontList* PlatformFontList() {
         return static_cast<gfxFT2FontList*>(gfxPlatformFontList::PlatformFontList());
     }
 
     virtual void GetFontFamilyList(nsTArray<nsRefPtr<gfxFontFamily> >& aFamilyArray);
 
 protected:
deleted file mode 100644
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ /dev/null
@@ -1,1502 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "prlog.h"
-
-#include "gfxFcPlatformFontList.h"
-#include "gfxFont.h"
-#include "gfxFontConstants.h"
-#include "gfxFontFamilyList.h"
-#include "gfxFT2Utils.h"
-#include "gfxPlatform.h"
-#include "mozilla/ArrayUtils.h"
-#include "mozilla/TimeStamp.h"
-#include "nsGkAtoms.h"
-#include "nsILanguageAtomService.h"
-#include "nsUnicodeProperties.h"
-#include "nsUnicodeRange.h"
-
-#include <fontconfig/fcfreetype.h>
-
-#ifdef MOZ_WIDGET_GTK
-#include <gdk/gdk.h>
-#endif
-
-using namespace mozilla;
-using namespace mozilla::unicode;
-
-#ifndef FC_POSTSCRIPT_NAME
-#define FC_POSTSCRIPT_NAME  "postscriptname"      /* String */
-#endif
-
-#define PRINTING_FC_PROPERTY "gfx.printing"
-
-#ifdef PR_LOGGING
-
-#define LOG_FONTLIST(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
-                               PR_LOG_DEBUG, args)
-#define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
-                                   gfxPlatform::GetLog(eGfxLog_fontlist), \
-                                   PR_LOG_DEBUG)
-#define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \
-                                   gfxPlatform::GetLog(eGfxLog_cmapdata), \
-                                   PR_LOG_DEBUG)
-
-#endif
-
-static const FcChar8*
-ToFcChar8Ptr(const char* aStr)
-{
-    return reinterpret_cast<const FcChar8*>(aStr);
-}
-
-static const char*
-ToCharPtr(const FcChar8 *aStr)
-{
-    return reinterpret_cast<const char*>(aStr);
-}
-
-FT_Library gfxFcPlatformFontList::sCairoFTLibrary = nullptr;
-static cairo_user_data_key_t sFcFontlistUserFontDataKey;
-
-// canonical name ==> first en name or first name if no en name
-// This is the required logic for fullname lookups as per CSS3 Fonts spec.
-static uint32_t
-FindCanonicalNameIndex(FcPattern* aFont, const char* aLangField)
-{
-    uint32_t n = 0, en = 0;
-    FcChar8* lang;
-    while (FcPatternGetString(aFont, aLangField, n, &lang) == FcResultMatch) {
-        // look for 'en' or variants, en-US, en-JP etc.
-        uint32_t len = strlen(ToCharPtr(lang));
-        bool enPrefix = (strncmp(ToCharPtr(lang), "en", 2) == 0);
-        if (enPrefix && (len == 2 || (len > 2 && aLangField[2] == '-'))) {
-            en = n;
-            break;
-        }
-        n++;
-    }
-    return en;
-}
-
-static void
-GetFaceNames(FcPattern* aFont, const nsAString& aFamilyName,
-             nsAString& aPostscriptName, nsAString& aFullname)
-{
-    // get the Postscript name
-    FcChar8* psname;
-    if (FcPatternGetString(aFont, FC_POSTSCRIPT_NAME, 0, &psname) == FcResultMatch) {
-        AppendUTF8toUTF16(ToCharPtr(psname), aPostscriptName);
-    }
-
-    // get the canonical fullname (i.e. en name or first name)
-    uint32_t en = FindCanonicalNameIndex(aFont, FC_FULLNAMELANG);
-    FcChar8* fullname;
-    if (FcPatternGetString(aFont, FC_FULLNAME, en, &fullname) == FcResultMatch) {
-        AppendUTF8toUTF16(ToCharPtr(fullname), aFullname);
-    }
-
-    // if have fullname, done
-    if (!aFullname.IsEmpty()) {
-        return;
-    }
-
-    // otherwise, set the fullname to family + style name [en] and use that
-    aFullname.Append(aFamilyName);
-
-    // figure out the en style name
-    en = FindCanonicalNameIndex(aFont, FC_STYLELANG);
-    nsAutoString style;
-    FcChar8* stylename = nullptr;
-    FcPatternGetString(aFont, FC_STYLE, en, &stylename);
-    if (stylename) {
-        AppendUTF8toUTF16(ToCharPtr(stylename), style);
-    }
-
-    if (!style.IsEmpty() && !style.EqualsLiteral("Regular")) {
-        aFullname.Append(' ');
-        aFullname.Append(style);
-    }
-}
-
-static uint16_t
-MapFcWeight(int aFcWeight)
-{
-    if (aFcWeight <= (FC_WEIGHT_THIN + FC_WEIGHT_EXTRALIGHT) / 2) {
-        return 100;
-    } else if (aFcWeight <= (FC_WEIGHT_EXTRALIGHT + FC_WEIGHT_LIGHT) / 2) {
-        return 200;
-    } else if (aFcWeight <= (FC_WEIGHT_LIGHT + FC_WEIGHT_BOOK) / 2) {
-        return 300;
-    } else if (aFcWeight <= (FC_WEIGHT_REGULAR + FC_WEIGHT_MEDIUM) / 2) {
-        // This includes FC_WEIGHT_BOOK
-        return 400;
-    } else if (aFcWeight <= (FC_WEIGHT_MEDIUM + FC_WEIGHT_DEMIBOLD) / 2) {
-        return 500;
-    } else if (aFcWeight <= (FC_WEIGHT_DEMIBOLD + FC_WEIGHT_BOLD) / 2) {
-        return 600;
-    } else if (aFcWeight <= (FC_WEIGHT_BOLD + FC_WEIGHT_EXTRABOLD) / 2) {
-        return 700;
-    } else if (aFcWeight <= (FC_WEIGHT_EXTRABOLD + FC_WEIGHT_BLACK) / 2) {
-        return 800;
-    } else if (aFcWeight <= FC_WEIGHT_BLACK) {
-        return 900;
-    }
-
-    // including FC_WEIGHT_EXTRABLACK
-    return 901;
-}
-
-static int16_t
-MapFcWidth(int aFcWidth)
-{
-    if (aFcWidth <= (FC_WIDTH_ULTRACONDENSED + FC_WIDTH_EXTRACONDENSED) / 2) {
-        return NS_FONT_STRETCH_ULTRA_CONDENSED;
-    }
-    if (aFcWidth <= (FC_WIDTH_EXTRACONDENSED + FC_WIDTH_CONDENSED) / 2) {
-        return NS_FONT_STRETCH_EXTRA_CONDENSED;
-    }
-    if (aFcWidth <= (FC_WIDTH_CONDENSED + FC_WIDTH_SEMICONDENSED) / 2) {
-        return NS_FONT_STRETCH_CONDENSED;
-    }
-    if (aFcWidth <= (FC_WIDTH_SEMICONDENSED + FC_WIDTH_NORMAL) / 2) {
-        return NS_FONT_STRETCH_SEMI_CONDENSED;
-    }
-    if (aFcWidth <= (FC_WIDTH_NORMAL + FC_WIDTH_SEMIEXPANDED) / 2) {
-        return NS_FONT_STRETCH_NORMAL;
-    }
-    if (aFcWidth <= (FC_WIDTH_SEMIEXPANDED + FC_WIDTH_EXPANDED) / 2) {
-        return NS_FONT_STRETCH_SEMI_EXPANDED;
-    }
-    if (aFcWidth <= (FC_WIDTH_EXPANDED + FC_WIDTH_EXTRAEXPANDED) / 2) {
-        return NS_FONT_STRETCH_EXPANDED;
-    }
-    if (aFcWidth <= (FC_WIDTH_EXTRAEXPANDED + FC_WIDTH_ULTRAEXPANDED) / 2) {
-        return NS_FONT_STRETCH_EXTRA_EXPANDED;
-    }
-    return NS_FONT_STRETCH_ULTRA_EXPANDED;
-}
-
-// mapping of moz lang groups ==> default lang
-struct MozLangGroupData {
-    nsIAtom* const& mozLangGroup;
-    const char *defaultLang;
-};
-
-const MozLangGroupData MozLangGroups[] = {
-    { nsGkAtoms::x_western,      "en" },
-    { nsGkAtoms::x_cyrillic,     "ru" },
-    { nsGkAtoms::x_devanagari,   "hi" },
-    { nsGkAtoms::x_tamil,        "ta" },
-    { nsGkAtoms::x_armn,         "hy" },
-    { nsGkAtoms::x_beng,         "bn" },
-    { nsGkAtoms::x_cans,         "iu" },
-    { nsGkAtoms::x_ethi,         "am" },
-    { nsGkAtoms::x_geor,         "ka" },
-    { nsGkAtoms::x_gujr,         "gu" },
-    { nsGkAtoms::x_guru,         "pa" },
-    { nsGkAtoms::x_khmr,         "km" },
-    { nsGkAtoms::x_knda,         "kn" },
-    { nsGkAtoms::x_mlym,         "ml" },
-    { nsGkAtoms::x_orya,         "or" },
-    { nsGkAtoms::x_sinh,         "si" },
-    { nsGkAtoms::x_tamil,        "ta" },
-    { nsGkAtoms::x_telu,         "te" },
-    { nsGkAtoms::x_tibt,         "bo" },
-    { nsGkAtoms::Unicode,        0    }
-};
-
-static void
-GetSampleLangForGroup(nsIAtom* aLanguage, nsACString& aLangStr)
-{
-    aLangStr.Truncate();
-    if (aLanguage) {
-        // set up lang string
-        const MozLangGroupData *mozLangGroup = nullptr;
-
-        // -- look it up in the list of moz lang groups
-        for (unsigned int i = 0; i < ArrayLength(MozLangGroups); ++i) {
-            if (aLanguage == MozLangGroups[i].mozLangGroup) {
-                mozLangGroup = &MozLangGroups[i];
-                break;
-            }
-        }
-
-        // xxx - Is this sufficient? The code in
-        // gfxFontconfigUtils::GetSampleLangForGroup has logic for sniffing the
-        // LANGUAGE environment to try and map langGroup ==> closest user language
-        // but I'm guessing that's not really all that useful. For now, just use
-        // the default lang mapping.
-
-        // -- get the BCP47 string representation of the lang group
-        if (mozLangGroup) {
-            if (mozLangGroup->defaultLang) {
-                aLangStr.Assign(mozLangGroup->defaultLang);
-            }
-        } else {
-            // Not a special mozilla language group.
-            // Use aLangGroup as a language code.
-            aLanguage->ToUTF8String(aLangStr);
-        }
-    }
-}
-
-gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
-                                               FcPattern* aFontPattern)
-        : gfxFontEntry(aFaceName), mFontPattern(aFontPattern),
-          mFTFace(nullptr), mFTFaceInitialized(false),
-          mAspect(0.0), mFontData(nullptr)
-{
-    // italic
-    int slant;
-    if (FcPatternGetInteger(aFontPattern, FC_SLANT, 0, &slant) != FcResultMatch) {
-        slant = FC_SLANT_ROMAN;
-    }
-    if (slant > 0) {
-        mItalic = true;
-    }
-
-    // weight
-    int weight;
-    if (FcPatternGetInteger(aFontPattern, FC_WEIGHT, 0, &weight) != FcResultMatch) {
-        weight = FC_WEIGHT_REGULAR;
-    }
-    mWeight = MapFcWeight(weight);
-
-    // width
-    int width;
-    if (FcPatternGetInteger(aFontPattern, FC_WIDTH, 0, &width) != FcResultMatch) {
-        width = FC_WIDTH_NORMAL;
-    }
-    mStretch = MapFcWidth(width);
-}
-
-gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
-                                               uint16_t aWeight,
-                                               int16_t aStretch,
-                                               bool aItalic,
-                                               const uint8_t *aData,
-                                               FT_Face aFace)
-    : gfxFontEntry(aFaceName), mFontPattern(FcPatternCreate()),
-      mFTFace(aFace), mFTFaceInitialized(true),
-      mAspect(0.0), mFontData(aData)
-{
-    mWeight = aWeight;
-    mItalic = aItalic;
-    mStretch = aStretch;
-    mIsDataUserFont = true;
-
-    // Make a new pattern and store the face in it so that cairo uses
-    // that when creating a cairo font face.
-    FcPatternAddFTFace(mFontPattern, FC_FT_FACE, mFTFace);
-
-    mUserFontData = new FTUserFontData(mFTFace, mFontData);
-}
-
-gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
-                                               FcPattern* aFontPattern,
-                                               uint16_t aWeight,
-                                               int16_t aStretch,
-                                               bool aItalic)
-        : gfxFontEntry(aFaceName), mFontPattern(aFontPattern),
-          mFTFace(nullptr), mFTFaceInitialized(false),
-          mAspect(0.0), mFontData(nullptr)
-{
-    mWeight = aWeight;
-    mItalic = aItalic;
-    mStretch = aStretch;
-    mIsLocalUserFont = true;
-}
-
-gfxFontconfigFontEntry::~gfxFontconfigFontEntry()
-{
-}
-
-bool
-gfxFontconfigFontEntry::SupportsLangGroup(nsIAtom *aLangGroup) const
-{
-    if (!aLangGroup || aLangGroup == nsGkAtoms::Unicode) {
-        return true;
-    }
-
-    nsAutoCString fcLang;
-    GetSampleLangForGroup(aLangGroup, fcLang);
-    if (fcLang.IsEmpty()) {
-        return true;
-    }
-
-    // is lang included in the underlying pattern?
-    FcLangSet *langset;
-    if (FcPatternGetLangSet(mFontPattern, FC_LANG, 0, &langset) != FcResultMatch) {
-        return false;
-    }
-
-    if (FcLangSetHasLang(langset, (FcChar8 *)fcLang.get()) != FcLangDifferentLang) {
-        return true;
-    }
-
-    return false;
-}
-
-nsresult
-gfxFontconfigFontEntry::ReadCMAP(FontInfoData *aFontInfoData)
-{
-    // attempt this once, if errors occur leave a blank cmap
-    if (mCharacterMap) {
-        return NS_OK;
-    }
-
-    nsRefPtr<gfxCharacterMap> charmap;
-    nsresult rv;
-    bool symbolFont;
-
-    if (aFontInfoData && (charmap = GetCMAPFromFontInfo(aFontInfoData,
-                                                        mUVSOffset,
-                                                        symbolFont))) {
-        rv = NS_OK;
-    } else {
-        uint32_t kCMAP = TRUETYPE_TAG('c','m','a','p');
-        charmap = new gfxCharacterMap();
-        AutoTable cmapTable(this, kCMAP);
-
-        if (cmapTable) {
-            bool unicodeFont = false, symbolFont = false; // currently ignored
-            uint32_t cmapLen;
-            const uint8_t* cmapData =
-                reinterpret_cast<const uint8_t*>(hb_blob_get_data(cmapTable,
-                                                                  &cmapLen));
-            rv = gfxFontUtils::ReadCMAP(cmapData, cmapLen,
-                                        *charmap, mUVSOffset,
-                                        unicodeFont, symbolFont);
-        } else {
-            rv = NS_ERROR_NOT_AVAILABLE;
-        }
-    }
-
-    mHasCmapTable = NS_SUCCEEDED(rv);
-    if (mHasCmapTable) {
-        gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList();
-        mCharacterMap = pfl->FindCharMap(charmap);
-    } else {
-        // if error occurred, initialize to null cmap
-        mCharacterMap = new gfxCharacterMap();
-    }
-
-#ifdef PR_LOGGING
-    LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %d hash: %8.8x%s\n",
-                  NS_ConvertUTF16toUTF8(mName).get(),
-                  charmap->SizeOfIncludingThis(moz_malloc_size_of),
-                  charmap->mHash, mCharacterMap == charmap ? " new" : ""));
-    if (LOG_CMAPDATA_ENABLED()) {
-        char prefix[256];
-        sprintf(prefix, "(cmapdata) name: %.220s",
-                NS_ConvertUTF16toUTF8(mName).get());
-        charmap->Dump(prefix, eGfxLog_cmapdata);
-    }
-#endif
-
-    return rv;
-}
-
-static bool
-HasChar(FcPattern *aFont, FcChar32 aCh)
-{
-    FcCharSet *charset = nullptr;
-    FcPatternGetCharSet(aFont, FC_CHARSET, 0, &charset);
-    return charset && FcCharSetHasChar(charset, aCh);
-}
-
-bool
-gfxFontconfigFontEntry::TestCharacterMap(uint32_t aCh)
-{
-    // for system fonts, use the charmap in the pattern
-    if (!mIsDataUserFont) {
-        return HasChar(mFontPattern, aCh);
-    }
-    return gfxFontEntry::TestCharacterMap(aCh);
-}
-
-hb_blob_t*
-gfxFontconfigFontEntry::GetFontTable(uint32_t aTableTag)
-{
-    // for data fonts, read directly from the font data
-    if (mFontData) {
-        return GetTableFromFontData(mFontData, aTableTag);
-    }
-
-    return gfxFontEntry::GetFontTable(aTableTag);
-}
-
-void
-gfxFontconfigFontEntry::MaybeReleaseFTFace()
-{
-    // don't release if either HB or Gr face still exists
-    if (mHBFace || mGrFace) {
-        return;
-    }
-    // only close out FT_Face for system fonts, not for data fonts
-    if (!mIsDataUserFont) {
-        if (mFTFace) {
-            FT_Done_Face(mFTFace);
-            mFTFace = nullptr;
-        }
-        mFTFaceInitialized = false;
-    }
-}
-
-void
-gfxFontconfigFontEntry::ForgetHBFace()
-{
-    gfxFontEntry::ForgetHBFace();
-    MaybeReleaseFTFace();
-}
-
-void
-gfxFontconfigFontEntry::ReleaseGrFace(gr_face* aFace)
-{
-    gfxFontEntry::ReleaseGrFace(aFace);
-    MaybeReleaseFTFace();
-}
-
-double
-gfxFontconfigFontEntry::GetAspect()
-{
-    if (mAspect == 0.0) {
-        // default to aspect = 0.5
-        mAspect = 0.5;
-
-        // create a font to calculate x-height / em-height
-        gfxFontStyle s;
-        s.size = 100.0; // pick large size to avoid possible hinting artifacts
-        nsRefPtr<gfxFont> font = FindOrMakeFont(&s, false);
-        if (font) {
-            const gfxFont::Metrics& metrics =
-                font->GetMetrics(gfxFont::eHorizontal);
-
-            // The factor of 0.1 ensures that xHeight is sane so fonts don't
-            // become huge.  Strictly ">" ensures that xHeight and emHeight are
-            // not both zero.
-            if (metrics.xHeight > 0.1 * metrics.emHeight) {
-                mAspect = metrics.xHeight / metrics.emHeight;
-            }
-        }
-    }
-    return mAspect;
-}
-
-static void
-PrepareFontOptions(FcPattern* aPattern,
-                   cairo_font_options_t* aFontOptions)
-{
-    NS_ASSERTION(aFontOptions, "null font options passed to PrepareFontOptions");
-
-    // xxx - taken from the gfxPangoFonts code, needs to be reviewed
-
-    FcBool printing;
-    if (FcPatternGetBool(aPattern, PRINTING_FC_PROPERTY, 0, &printing) !=
-            FcResultMatch) {
-        printing = FcFalse;
-    }
-
-    // Font options are set explicitly here to improve cairo's caching
-    // behavior and to record the relevant parts of the pattern for
-    // SetupCairoFont (so that the pattern can be released).
-    //
-    // Most font_options have already been set as defaults on the FcPattern
-    // with cairo_ft_font_options_substitute(), then user and system
-    // fontconfig configurations were applied.  The resulting font_options
-    // have been recorded on the face during
-    // cairo_ft_font_face_create_for_pattern().
-    //
-    // None of the settings here cause this scaled_font to behave any
-    // differently from how it would behave if it were created from the same
-    // face with default font_options.
-    //
-    // We set options explicitly so that the same scaled_font will be found in
-    // the cairo_scaled_font_map when cairo loads glyphs from a context with
-    // the same font_face, font_matrix, ctm, and surface font_options.
-    //
-    // Unfortunately, _cairo_scaled_font_keys_equal doesn't know about the
-    // font_options on the cairo_ft_font_face, and doesn't consider default
-    // option values to not match any explicit values.
-    //
-    // Even after cairo_set_scaled_font is used to set font_options for the
-    // cairo context, when cairo looks for a scaled_font for the context, it
-    // will look for a font with some option values from the target surface if
-    // any values are left default on the context font_options.  If this
-    // scaled_font is created with default font_options, cairo will not find
-    // it.
-    //
-    // The one option not recorded in the pattern is hint_metrics, which will
-    // affect glyph metrics.  The default behaves as CAIRO_HINT_METRICS_ON.
-    // We should be considering the font_options of the surface on which this
-    // font will be used, but currently we don't have different gfxFonts for
-    // different surface font_options, so we'll create a font suitable for the
-    // Screen. Image and xlib surfaces default to CAIRO_HINT_METRICS_ON.
-    if (printing) {
-        cairo_font_options_set_hint_metrics(aFontOptions, CAIRO_HINT_METRICS_OFF);
-    } else {
-        cairo_font_options_set_hint_metrics(aFontOptions, CAIRO_HINT_METRICS_ON);
-    }
-
-    // The remaining options have been recorded on the pattern and the face.
-    // _cairo_ft_options_merge has some logic to decide which options from the
-    // scaled_font or from the cairo_ft_font_face take priority in the way the
-    // font behaves.
-    //
-    // In the majority of cases, _cairo_ft_options_merge uses the options from
-    // the cairo_ft_font_face, so sometimes it is not so important which
-    // values are set here so long as they are not defaults, but we'll set
-    // them to the exact values that we expect from the font, to be consistent
-    // and to protect against changes in cairo.
-    //
-    // In some cases, _cairo_ft_options_merge uses some options from the
-    // scaled_font's font_options rather than options on the
-    // cairo_ft_font_face (from fontconfig).
-    // https://bugs.freedesktop.org/show_bug.cgi?id=11838
-    //
-    // Surface font options were set on the pattern in
-    // cairo_ft_font_options_substitute.  If fontconfig has changed the
-    // hint_style then that is what the user (or distribution) wants, so we
-    // use the setting from the FcPattern.
-    //
-    // Fallback values here mirror treatment of defaults in cairo-ft-font.c.
-    FcBool hinting = FcFalse;
-    if (FcPatternGetBool(aPattern, FC_HINTING, 0, &hinting) != FcResultMatch) {
-        hinting = FcTrue;
-    }
-
-    cairo_hint_style_t hint_style;
-    if (printing || !hinting) {
-        hint_style = CAIRO_HINT_STYLE_NONE;
-    } else {
-        int fc_hintstyle;
-        if (FcPatternGetInteger(aPattern, FC_HINT_STYLE,
-                                0, &fc_hintstyle) != FcResultMatch) {
-            fc_hintstyle = FC_HINT_FULL;
-        }
-        switch (fc_hintstyle) {
-            case FC_HINT_NONE:
-                hint_style = CAIRO_HINT_STYLE_NONE;
-                break;
-            case FC_HINT_SLIGHT:
-                hint_style = CAIRO_HINT_STYLE_SLIGHT;
-                break;
-            case FC_HINT_MEDIUM:
-            default: // This fallback mirrors _get_pattern_ft_options in cairo.
-                hint_style = CAIRO_HINT_STYLE_MEDIUM;
-                break;
-            case FC_HINT_FULL:
-                hint_style = CAIRO_HINT_STYLE_FULL;
-                break;
-        }
-    }
-    cairo_font_options_set_hint_style(aFontOptions, hint_style);
-
-    int rgba;
-    if (FcPatternGetInteger(aPattern,
-                            FC_RGBA, 0, &rgba) != FcResultMatch) {
-        rgba = FC_RGBA_UNKNOWN;
-    }
-    cairo_subpixel_order_t subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT;
-    switch (rgba) {
-        case FC_RGBA_UNKNOWN:
-        case FC_RGBA_NONE:
-        default:
-            // There is no CAIRO_SUBPIXEL_ORDER_NONE.  Subpixel antialiasing
-            // is disabled through cairo_antialias_t.
-            rgba = FC_RGBA_NONE;
-            // subpixel_order won't be used by the font as we won't use
-            // CAIRO_ANTIALIAS_SUBPIXEL, but don't leave it at default for
-            // caching reasons described above.  Fall through:
-        case FC_RGBA_RGB:
-            subpixel_order = CAIRO_SUBPIXEL_ORDER_RGB;
-            break;
-        case FC_RGBA_BGR:
-            subpixel_order = CAIRO_SUBPIXEL_ORDER_BGR;
-            break;
-        case FC_RGBA_VRGB:
-            subpixel_order = CAIRO_SUBPIXEL_ORDER_VRGB;
-            break;
-        case FC_RGBA_VBGR:
-            subpixel_order = CAIRO_SUBPIXEL_ORDER_VBGR;
-            break;
-    }
-    cairo_font_options_set_subpixel_order(aFontOptions, subpixel_order);
-
-    FcBool fc_antialias;
-    if (FcPatternGetBool(aPattern,
-                         FC_ANTIALIAS, 0, &fc_antialias) != FcResultMatch) {
-        fc_antialias = FcTrue;
-    }
-    cairo_antialias_t antialias;
-    if (!fc_antialias) {
-        antialias = CAIRO_ANTIALIAS_NONE;
-    } else if (rgba == FC_RGBA_NONE) {
-        antialias = CAIRO_ANTIALIAS_GRAY;
-    } else {
-        antialias = CAIRO_ANTIALIAS_SUBPIXEL;
-    }
-    cairo_font_options_set_antialias(aFontOptions, antialias);
-}
-
-cairo_scaled_font_t*
-gfxFontconfigFontEntry::CreateScaledFont(FcPattern* aRenderPattern,
-                                         const gfxFontStyle *aStyle,
-                                         bool aNeedsBold)
-{
-    if (aNeedsBold) {
-        FcPatternAddBool(aRenderPattern, FC_EMBOLDEN, FcTrue);
-    }
-
-    // synthetic oblique by skewing via the font matrix
-    bool needsOblique = !IsItalic() &&
-            (aStyle->style & (NS_FONT_STYLE_ITALIC | NS_FONT_STYLE_OBLIQUE)) &&
-            aStyle->allowSyntheticStyle;
-
-    if (needsOblique) {
-        // disable embedded bitmaps (mimics behavior in 90-synthetic.conf)
-        FcPatternDel(aRenderPattern, FC_EMBEDDED_BITMAP);
-        FcPatternAddBool(aRenderPattern, FC_EMBEDDED_BITMAP, FcFalse);
-    }
-
-    cairo_font_face_t *face =
-        cairo_ft_font_face_create_for_pattern(aRenderPattern);
-
-    if (mFontData) {
-        // for data fonts, add the face/data pointer to the cairo font face
-        // so that it gets deleted whenever cairo decides
-        NS_ASSERTION(mFTFace, "FT_Face is null when setting user data");
-        NS_ASSERTION(mUserFontData, "user font data is null when setting user data");
-        cairo_font_face_set_user_data(face,
-                                      &sFcFontlistUserFontDataKey,
-                                      new FTUserFontDataRef(mUserFontData),
-                                      FTUserFontDataRef::Destroy);
-    }
-
-    cairo_scaled_font_t *scaledFont = nullptr;
-
-    cairo_matrix_t sizeMatrix;
-    cairo_matrix_t identityMatrix;
-
-    double adjustedSize = aStyle->size;
-    if (aStyle->sizeAdjust >= 0.0) {
-        adjustedSize = aStyle->GetAdjustedSize(GetAspect());
-    }
-    cairo_matrix_init_scale(&sizeMatrix, adjustedSize, adjustedSize);
-    cairo_matrix_init_identity(&identityMatrix);
-
-    if (needsOblique) {
-        const double kSkewFactor = OBLIQUE_SKEW_FACTOR;
-
-        cairo_matrix_t style;
-        cairo_matrix_init(&style,
-                          1,                //xx
-                          0,                //yx
-                          -1 * kSkewFactor,  //xy
-                          1,                //yy
-                          0,                //x0
-                          0);               //y0
-        cairo_matrix_multiply(&sizeMatrix, &sizeMatrix, &style);
-    }
-
-    cairo_font_options_t *fontOptions = cairo_font_options_create();
-    PrepareFontOptions(aRenderPattern, fontOptions);
-
-    scaledFont = cairo_scaled_font_create(face, &sizeMatrix,
-                                          &identityMatrix, fontOptions);
-    cairo_font_options_destroy(fontOptions);
-
-    NS_ASSERTION(cairo_scaled_font_status(scaledFont) == CAIRO_STATUS_SUCCESS,
-                 "Failed to make scaled font");
-
-    cairo_font_face_destroy(face);
-
-    return scaledFont;
-}
-
-#ifdef MOZ_WIDGET_GTK
-// defintion included below
-static void ApplyGdkScreenFontOptions(FcPattern *aPattern);
-#endif
-
-static void
-PreparePattern(FcPattern* aPattern, bool aIsPrinterFont)
-{
-    // This gets cairo_font_options_t for the Screen.  We should have
-    // different font options for printing (no hinting) but we are not told
-    // what we are measuring for.
-    //
-    // If cairo adds support for lcd_filter, gdk will not provide the default
-    // setting for that option.  We could get the default setting by creating
-    // an xlib surface once, recording its font_options, and then merging the
-    // gdk options.
-    //
-    // Using an xlib surface would also be an option to get Screen font
-    // options for non-GTK X11 toolkits, but less efficient than using GDK to
-    // pick up dynamic changes.
-    if(aIsPrinterFont) {
-       cairo_font_options_t *options = cairo_font_options_create();
-       cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);
-       cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_GRAY);
-       cairo_ft_font_options_substitute(options, aPattern);
-       cairo_font_options_destroy(options);
-       FcPatternAddBool(aPattern, PRINTING_FC_PROPERTY, FcTrue);
-    } else {
-#ifdef MOZ_WIDGET_GTK
-       ApplyGdkScreenFontOptions(aPattern);
-#endif
-    }
-
-    FcDefaultSubstitute(aPattern);
-}
-
-gfxFont*
-gfxFontconfigFontEntry::CreateFontInstance(const gfxFontStyle *aFontStyle,
-                                           bool aNeedsBold)
-{
-    nsAutoRef<FcPattern> pattern(FcPatternCreate());
-    FcPatternAddDouble(pattern, FC_PIXEL_SIZE, aFontStyle->size);
-
-    PreparePattern(pattern, aFontStyle->printerFont);
-    nsAutoRef<FcPattern> renderPattern
-        (FcFontRenderPrepare(nullptr, pattern, mFontPattern));
-
-    cairo_scaled_font_t* scaledFont =
-        CreateScaledFont(renderPattern, aFontStyle, aNeedsBold);
-    gfxFont* newFont =
-        new gfxFontconfigFont(scaledFont, this, aFontStyle, aNeedsBold);
-    cairo_scaled_font_destroy(scaledFont);
-
-    return newFont;
-}
-
-nsresult
-gfxFontconfigFontEntry::CopyFontTable(uint32_t aTableTag,
-                                      FallibleTArray<uint8_t>& aBuffer)
-{
-    NS_ASSERTION(!mIsDataUserFont,
-                 "data fonts should be reading tables directly from memory");
-
-    if (!mFTFaceInitialized) {
-        mFTFaceInitialized = true;
-        FcChar8 *filename;
-        if (FcPatternGetString(mFontPattern, FC_FILE, 0, &filename) != FcResultMatch) {
-            return NS_ERROR_FAILURE;
-        }
-        int index;
-        if (FcPatternGetInteger(mFontPattern, FC_INDEX, 0, &index) != FcResultMatch) {
-            index = 0; // default to 0 if not found in pattern
-        }
-        if (FT_New_Face(gfxFcPlatformFontList::GetFTLibrary(),
-                        (const char*)filename, index, &mFTFace) != 0) {
-            return NS_ERROR_FAILURE;
-        }
-    }
-
-    if (!mFTFace) {
-        return NS_ERROR_NOT_AVAILABLE;
-    }
-
-    FT_ULong length = 0;
-    if (FT_Load_Sfnt_Table(mFTFace, aTableTag, 0, nullptr, &length) != 0) {
-        return NS_ERROR_NOT_AVAILABLE;
-    }
-    if (!aBuffer.SetLength(length)) {
-        return NS_ERROR_OUT_OF_MEMORY;
-    }
-    if (FT_Load_Sfnt_Table(mFTFace, aTableTag, 0, aBuffer.Elements(), &length) != 0) {
-        aBuffer.Clear();
-        return NS_ERROR_FAILURE;
-    }
-
-    return NS_OK;
-}
-
-void
-gfxFontconfigFontFamily::FindStyleVariations(FontInfoData *aFontInfoData)
-{
-    if (mHasStyles) {
-        return;
-    }
-
-    // add font entries for each of the faces
-    gfxPlatformFontList *fp = gfxPlatformFontList::PlatformFontList();
-    uint32_t numFonts = mFontPatterns.Length();
-    NS_ASSERTION(numFonts, "font family containing no faces!!");
-    for (uint32_t i = 0; i < numFonts; i++) {
-        FcPattern* face = mFontPatterns[i];
-
-        // figure out the psname/fullname and choose which to use as the facename
-        nsAutoString psname, fullname;
-        GetFaceNames(face, mName, psname, fullname);
-        const nsAutoString& faceName = !psname.IsEmpty() ? psname : fullname;
-
-        gfxFontconfigFontEntry *fontEntry =
-            new gfxFontconfigFontEntry(faceName, face);
-        AddFontEntry(fontEntry);
-
-        // add entry to local name lists
-        if (!psname.IsEmpty()) {
-            fp->AddPostscriptName(fontEntry, psname);
-        }
-        NS_ASSERTION(!fullname.IsEmpty(), "empty font fullname");
-        if (!fullname.IsEmpty()) {
-            fp->AddFullname(fontEntry, fullname);
-        }
-
-#ifdef PR_LOGGING
-        if (LOG_FONTLIST_ENABLED()) {
-            LOG_FONTLIST(("(fontlist) added (%s) to family (%s)"
-                 " with style: %s weight: %d stretch: %d"
-                 " psname: %s fullname: %s",
-                 NS_ConvertUTF16toUTF8(fontEntry->Name()).get(),
-                 NS_ConvertUTF16toUTF8(Name()).get(),
-                 fontEntry->IsItalic() ? "italic" : "normal",
-                 fontEntry->Weight(), fontEntry->Stretch(),
-                 NS_ConvertUTF16toUTF8(psname).get(),
-                 NS_ConvertUTF16toUTF8(fullname).get()));
-        }
-#endif
-    }
-    mFaceNamesInitialized = true;
-    mFontPatterns.Clear();
-    SetHasStyles(true);
-}
-
-void
-gfxFontconfigFontFamily::AddFontPattern(FcPattern* aFontPattern)
-{
-    NS_ASSERTION(!mHasStyles,
-                 "font patterns must not be added to already enumerated families");
-
-    nsCountedRef<FcPattern> pattern(aFontPattern);
-    mFontPatterns.AppendElement(pattern);
-}
-
-gfxFontconfigFont::gfxFontconfigFont(cairo_scaled_font_t *aScaledFont,
-                                     gfxFontEntry *aFontEntry,
-                                     const gfxFontStyle *aFontStyle,
-                                     bool aNeedsBold) :
-    gfxFT2FontBase(aScaledFont, aFontEntry, aFontStyle)
-{
-}
-
-gfxFontconfigFont::~gfxFontconfigFont()
-{
-}
-
-#ifdef USE_SKIA
-mozilla::TemporaryRef<mozilla::gfx::GlyphRenderingOptions>
-gfxFontconfigFont::GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams)
-{
-  cairo_scaled_font_t *scaled_font = CairoScaledFont();
-  cairo_font_options_t *options = cairo_font_options_create();
-  cairo_scaled_font_get_font_options(scaled_font, options);
-  cairo_hint_style_t hint_style = cairo_font_options_get_hint_style(options);
-  cairo_font_options_destroy(options);
-
-  mozilla::gfx::FontHinting hinting;
-
-  switch (hint_style) {
-    case CAIRO_HINT_STYLE_NONE:
-      hinting = mozilla::gfx::FontHinting::NONE;
-      break;
-    case CAIRO_HINT_STYLE_SLIGHT:
-      hinting = mozilla::gfx::FontHinting::LIGHT;
-      break;
-    case CAIRO_HINT_STYLE_FULL:
-      hinting = mozilla::gfx::FontHinting::FULL;
-      break;
-    default:
-      hinting = mozilla::gfx::FontHinting::NORMAL;
-      break;
-  }
-
-  // We don't want to force the use of the autohinter over the font's built in hints
-  return mozilla::gfx::Factory::CreateCairoGlyphRenderingOptions(hinting, false);
-}
-#endif
-
-gfxFcPlatformFontList::gfxFcPlatformFontList()
-    : mLocalNames(64), mGenericMappings(32), mLastConfig(nullptr)
-{
-    // if the rescan interval is set, start the timer
-    int rescanInterval = FcConfigGetRescanInterval(nullptr);
-    if (rescanInterval) {
-        mLastConfig = FcConfigGetCurrent();
-        mCheckFontUpdatesTimer = do_CreateInstance("@mozilla.org/timer;1");
-        if (mCheckFontUpdatesTimer) {
-            mCheckFontUpdatesTimer->
-                InitWithFuncCallback(CheckFontUpdates, this,
-                                     (rescanInterval + 1) * 1000,
-                                     nsITimer::TYPE_REPEATING_SLACK);
-        } else {
-            NS_WARNING("Failure to create font updates timer");
-        }
-    }
-
-#ifdef MOZ_BUNDLED_FONTS
-    mBundledFontsInitialized = false;
-#endif
-}
-
-gfxFcPlatformFontList::~gfxFcPlatformFontList()
-{
-    if (mCheckFontUpdatesTimer) {
-        mCheckFontUpdatesTimer->Cancel();
-        mCheckFontUpdatesTimer = nullptr;
-    }
-}
-
-void
-gfxFcPlatformFontList::AddFontSetFamilies(FcFontSet* aFontSet)
-{
-    // This iterates over the fonts in a font set and adds in gfxFontFamily
-    // objects for each family. The patterns for individual fonts are not
-    // copied here. When a family is actually used, the fonts in the family
-    // are enumerated and the patterns copied. Note that we're explicitly
-    // excluding non-scalable fonts such as X11 bitmap fonts, which
-    // Chrome Skia/Webkit code does also.
-
-    FcChar8* lastFamilyName = (FcChar8*)"";
-    gfxFontFamily* fontFamily = nullptr;
-    nsAutoString familyName;
-    for (int f = 0; f < aFontSet->nfont; f++) {
-        FcPattern* font = aFontSet->fonts[f];
-
-        // not scalable? skip...
-        FcBool scalable;
-        if (FcPatternGetBool(font, FC_SCALABLE, 0, &scalable) != FcResultMatch ||
-            !scalable) {
-            continue;
-        }
-
-        // get canonical name
-        uint32_t cIndex = FindCanonicalNameIndex(font, FC_FAMILYLANG);
-        FcChar8* canonical = nullptr;
-        FcPatternGetString(font, FC_FAMILY, cIndex, &canonical);
-        if (!canonical) {
-            continue;
-        }
-
-        // same as the last one? no need to add a new family, skip
-        if (FcStrCmp(canonical, lastFamilyName) != 0) {
-            lastFamilyName = canonical;
-
-            // add new family if one doesn't already exist
-            familyName.Truncate();
-            AppendUTF8toUTF16(ToCharPtr(canonical), familyName);
-            nsAutoString keyName(familyName);
-            ToLowerCase(keyName);
-
-            fontFamily = mFontFamilies.GetWeak(keyName);
-            if (!fontFamily) {
-                fontFamily = new gfxFontconfigFontFamily(familyName);
-                mFontFamilies.Put(keyName, fontFamily);
-            }
-
-            // Add pointers to other localized family names. Most fonts
-            // only have a single name, so the first call to GetString
-            // will usually not match
-            FcChar8* otherName;
-            int n = (cIndex == 0 ? 1 : 0);
-            while (FcPatternGetString(font, FC_FAMILY, n, &otherName) == FcResultMatch) {
-                NS_ConvertUTF8toUTF16 otherFamilyName(ToCharPtr(otherName));
-                AddOtherFamilyName(fontFamily, otherFamilyName);
-                n++;
-                if (n == int(cIndex)) {
-                    n++; // skip over canonical name
-                }
-            }
-        }
-
-        NS_ASSERTION(fontFamily, "font must belong to a font family");
-        gfxFontconfigFontFamily* fcFamily =
-            static_cast<gfxFontconfigFontFamily*>(fontFamily);
-        fcFamily->AddFontPattern(font);
-
-        // map the psname, fullname ==> font family for local font lookups
-        nsAutoString psname, fullname;
-        GetFaceNames(font, familyName, psname, fullname);
-        if (!psname.IsEmpty()) {
-            ToLowerCase(psname);
-            mLocalNames.Put(psname, fontFamily);
-        }
-        if (!fullname.IsEmpty()) {
-            ToLowerCase(fullname);
-            mLocalNames.Put(fullname, fontFamily);
-        }
-    }
-}
-
-nsresult
-gfxFcPlatformFontList::InitFontList()
-{
-    mLastConfig = FcConfigGetCurrent();
-
-    // reset font lists
-    gfxPlatformFontList::InitFontList();
-
-    mLocalNames.Clear();
-    mGenericMappings.Clear();
-
-    // iterate over available fonts
-    FcFontSet* systemFonts = FcConfigGetFonts(nullptr, FcSetSystem);
-    AddFontSetFamilies(systemFonts);
-
-#ifdef MOZ_BUNDLED_FONTS
-    FcFontSet* appFonts = FcConfigGetFonts(nullptr, FcSetApplication);
-    AddFontSetFamilies(appFonts);
-#endif
-
-    mOtherFamilyNamesInitialized = true;
-    return NS_OK;
-}
-
-// For displaying the fontlist in UI, use explicit call to FcFontList. Using
-// FcFontList results in the list containing the localized names as dictated
-// by system defaults.
-static void
-GetSystemFontList(nsTArray<nsString>& aListOfFonts, nsIAtom *aLangGroup)
-{
-    aListOfFonts.Clear();
-
-    nsAutoRef<FcPattern> pat(FcPatternCreate());
-    if (!pat) {
-        return;
-    }
-
-    nsAutoRef<FcObjectSet> os(FcObjectSetBuild(FC_FAMILY, nullptr));
-    if (!os) {
-        return;
-    }
-
-    // add the lang to the pattern
-    nsAutoCString fcLang;
-    GetSampleLangForGroup(aLangGroup, fcLang);
-    if (!fcLang.IsEmpty()) {
-        FcPatternAddString(pat, FC_LANG, ToFcChar8Ptr(fcLang.get()));
-    }
-
-    // ignore size-specific fonts
-    FcPatternAddBool(pat, FC_SCALABLE, FcTrue);
-
-    nsAutoRef<FcFontSet> fs(FcFontList(nullptr, pat, os));
-    if (!fs) {
-        return;
-    }
-
-    for (int i = 0; i < fs->nfont; i++) {
-        char *family;
-
-        if (FcPatternGetString(fs->fonts[i], FC_FAMILY, 0,
-                               (FcChar8 **) &family) != FcResultMatch)
-        {
-            continue;
-        }
-
-        // Remove duplicates...
-        nsAutoString strFamily;
-        AppendUTF8toUTF16(family, strFamily);
-        if (aListOfFonts.Contains(strFamily)) {
-            continue;
-        }
-
-        aListOfFonts.AppendElement(strFamily);
-    }
-
-    aListOfFonts.Sort();
-}
-
-void
-gfxFcPlatformFontList::GetFontList(nsIAtom *aLangGroup,
-                                   const nsACString& aGenericFamily,
-                                   nsTArray<nsString>& aListOfFonts)
-{
-    // Get the list of font family names using fontconfig
-    GetSystemFontList(aListOfFonts, aLangGroup);
-
-    // Under Linux, the generics "serif", "sans-serif" and "monospace"
-    // are included in the pref fontlist. These map to whatever fontconfig
-    // decides they should be for a given language, rather than one of the
-    // fonts listed in the prefs font lists (e.g. font.name.*, font.name-list.*)
-    bool serif = false, sansSerif = false, monospace = false;
-    if (aGenericFamily.IsEmpty())
-        serif = sansSerif = monospace = true;
-    else if (aGenericFamily.LowerCaseEqualsLiteral("serif"))
-        serif = true;
-    else if (aGenericFamily.LowerCaseEqualsLiteral("sans-serif"))
-        sansSerif = true;
-    else if (aGenericFamily.LowerCaseEqualsLiteral("monospace"))
-        monospace = true;
-    else if (aGenericFamily.LowerCaseEqualsLiteral("cursive") ||
-             aGenericFamily.LowerCaseEqualsLiteral("fantasy"))
-        serif = sansSerif = true;
-    else
-        NS_NOTREACHED("unexpected CSS generic font family");
-
-    // The first in the list becomes the default in
-    // gFontsDialog.readFontSelection() if the preference-selected font is not
-    // available, so put system configured defaults first.
-    if (monospace)
-        aListOfFonts.InsertElementAt(0, NS_LITERAL_STRING("monospace"));
-    if (sansSerif)
-        aListOfFonts.InsertElementAt(0, NS_LITERAL_STRING("sans-serif"));
-    if (serif)
-        aListOfFonts.InsertElementAt(0, NS_LITERAL_STRING("serif"));
-}
-
-gfxFontFamily*
-gfxFcPlatformFontList::GetDefaultFont(const gfxFontStyle* aStyle)
-{
-    return FindGenericFamily(NS_LITERAL_STRING("serif"), nsGkAtoms::x_western);
-}
-
-gfxFontEntry*
-gfxFcPlatformFontList::LookupLocalFont(const nsAString& aFontName,
-                                       uint16_t aWeight,
-                                       int16_t aStretch,
-                                       bool aItalic)
-{
-    gfxFontEntry* lookup;
-
-    // first, lookup in face name lists
-    lookup = FindFaceName(aFontName);
-    if (!lookup) {
-        // if not found, check in global facename ==> family list
-        nsAutoString keyName(aFontName);
-        ToLowerCase(keyName);
-        gfxFontFamily* fontFamily = mLocalNames.GetWeak(keyName);
-
-        // name is not in the global list, done
-        if (!fontFamily) {
-            return nullptr;
-        }
-
-        // name is in global list but family needs enumeration
-        fontFamily->FindStyleVariations();
-
-        // facename ==> font entry should now be in the list
-        lookup = FindFaceName(aFontName);
-        NS_ASSERTION(lookup, "facename to family mapping failure");
-        if (!lookup) {
-            return nullptr;
-        }
-    }
-
-    gfxFontconfigFontEntry* fcFontEntry =
-        static_cast<gfxFontconfigFontEntry*>(lookup);
-
-    return new gfxFontconfigFontEntry(fcFontEntry->Name(),
-                                      fcFontEntry->GetPattern(),
-                                      aWeight, aStretch, aItalic);
-}
-
-gfxFontEntry*
-gfxFcPlatformFontList::MakePlatformFont(const nsAString& aFontName,
-                                        uint16_t aWeight,
-                                        int16_t aStretch,
-                                        bool aItalic,
-                                        const uint8_t* aFontData,
-                                        uint32_t aLength)
-{
-    FT_Face face;
-    FT_Error error =
-        FT_New_Memory_Face(gfxFcPlatformFontList::GetFTLibrary(),
-                           aFontData, aLength, 0, &face);
-    if (error != FT_Err_Ok) {
-        NS_Free((void*)aFontData);
-        return nullptr;
-    }
-    if (FT_Err_Ok != FT_Select_Charmap(face, FT_ENCODING_UNICODE)) {
-        FT_Done_Face(face);
-        NS_Free((void*)aFontData);
-        return nullptr;
-    }
-
-    return new gfxFontconfigFontEntry(aFontName, aWeight, aStretch, aItalic,
-                                      aFontData, face);
-}
-
-gfxFontFamily*
-gfxFcPlatformFontList::FindFamily(const nsAString& aFamily,
-                                  nsIAtom* aLanguage,
-                                  bool aUseSystemFonts)
-{
-    nsAutoString familyName(aFamily);
-    ToLowerCase(familyName);
-
-    // deprecated generic names are explicitly converted to standard generics
-    bool isDeprecatedGeneric = false;
-    if (familyName.EqualsLiteral("sans") ||
-        familyName.EqualsLiteral("sans serif")) {
-        familyName.AssignLiteral("sans-serif");
-        isDeprecatedGeneric = true;
-    } else if (familyName.EqualsLiteral("mono")) {
-        familyName.AssignLiteral("monospace");
-        isDeprecatedGeneric = true;
-    }
-
-    // fontconfig generics? use fontconfig to determine the family for lang
-    if (isDeprecatedGeneric ||
-        mozilla::FontFamilyName::Convert(familyName).IsGeneric()) {
-        return FindGenericFamily(familyName, aLanguage);
-    }
-
-    // fontconfig allows conditional substitutions in such a way that it's
-    // difficult to distinguish an explicit substitution from other suggested
-    // choices. To sniff out explicit substitutions, compare the substitutions
-    // for "font, -moz-sentinel" to "-moz-sentinel" to sniff out the
-    // substitutions
-    //
-    // Example:
-    //
-    //   serif ==> DejaVu Serif, ...
-    //   Helvetica, serif ==> Helvetica, TeX Gyre Heros, Nimbus Sans L, DejaVu Serif
-    //
-    // In this case fontconfig is including Tex Gyre Heros and
-    // Nimbus Sans L as alternatives for Helvetica.
-
-    // substitutions for serif pattern
-    const FcChar8* kSentinelName = ToFcChar8Ptr("-moz-sentinel");
-    nsAutoRef<FcPattern> sentinelSubst(FcPatternCreate());
-    FcPatternAddString(sentinelSubst, FC_FAMILY, kSentinelName);
-    FcConfigSubstitute(nullptr, sentinelSubst, FcMatchPattern);
-    FcChar8* sentinelFirstFamily = nullptr;
-    FcPatternGetString(sentinelSubst, FC_FAMILY, 0, &sentinelFirstFamily);
-
-    // substitutions for font, -moz-sentinel pattern
-    nsAutoRef<FcPattern> fontWithSentinel(FcPatternCreate());
-    NS_ConvertUTF16toUTF8 familyToFind(familyName);
-    FcPatternAddString(fontWithSentinel, FC_FAMILY, ToFcChar8Ptr(familyToFind.get()));
-    FcPatternAddString(fontWithSentinel, FC_FAMILY, kSentinelName);
-    FcConfigSubstitute(nullptr, fontWithSentinel, FcMatchPattern);
-
-    // iterate through substitutions until hitting the first serif font
-    FcChar8* substName = nullptr;
-    for (int i = 0;
-         FcPatternGetString(fontWithSentinel, FC_FAMILY,
-                            i, &substName) == FcResultMatch;
-         i++)
-    {
-        NS_ConvertUTF8toUTF16 subst(ToCharPtr(substName));
-        if (sentinelFirstFamily && FcStrCmp(substName, sentinelFirstFamily) == 0) {
-            break;
-        }
-        gfxFontFamily* foundFamily = gfxPlatformFontList::FindFamily(subst);
-        if (foundFamily) {
-            return foundFamily;
-        }
-    }
-
-    return nullptr;
-}
-
-bool
-gfxFcPlatformFontList::GetStandardFamilyName(const nsAString& aFontName,
-                                             nsAString& aFamilyName)
-{
-    // The fontconfig list of fonts includes generic family names in the
-    // font list. For these, just use the generic name.
-    if (aFontName.EqualsLiteral("serif") ||
-        aFontName.EqualsLiteral("sans-serif") ||
-        aFontName.EqualsLiteral("monospace")) {
-        aFamilyName.Assign(aFontName);
-        return true;
-    }
-
-    gfxFontFamily *family = FindFamily(aFontName);
-    if (family) {
-        family->LocalizedName(aFamilyName);
-        return true;
-    }
-
-    return false;
-}
-
-/* static */ FT_Library
-gfxFcPlatformFontList::GetFTLibrary()
-{
-    if (!sCairoFTLibrary) {
-        // Use cairo's FT_Library so that cairo takes care of shutdown of the
-        // FT_Library after it has destroyed its font_faces, and FT_Done_Face
-        // has been called on each FT_Face, at least until this bug is fixed:
-        // https://bugs.freedesktop.org/show_bug.cgi?id=18857
-        //
-        // Cairo keeps it's own FT_Library object for creating FT_Face
-        // instances, so use that. There's no simple API for accessing this
-        // so use the hacky method below of making a font and extracting
-        // the library pointer from that.
-
-        bool needsBold;
-        gfxFontStyle style;
-        gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList();
-        gfxFontFamily* family = pfl->GetDefaultFont(&style);
-        NS_ASSERTION(family, "couldn't find a default font family");
-        gfxFontEntry* fe = family->FindFontForStyle(style, needsBold);
-        if (!fe) {
-            return nullptr;
-        }
-        nsRefPtr<gfxFont> font = fe->FindOrMakeFont(&style, false);
-        if (!font) {
-            return nullptr;
-        }
-
-        gfxFT2FontBase* ft2Font = reinterpret_cast<gfxFT2FontBase*>(font.get());
-        gfxFT2LockedFace face(ft2Font);
-        if (!face.get()) {
-            return nullptr;
-        }
-
-        sCairoFTLibrary = face.get()->glyph->library;
-    }
-
-    return sCairoFTLibrary;
-}
-
-gfxFontFamily*
-gfxFcPlatformFontList::FindGenericFamily(const nsAString& aGeneric,
-                                         nsIAtom* aLanguage)
-{
-    // set up name
-    NS_ConvertUTF16toUTF8 generic(aGeneric);
-
-    nsAutoCString fcLang;
-    GetSampleLangForGroup(aLanguage, fcLang);
-
-    nsAutoCString genericLang(generic);
-    genericLang.Append(fcLang);
-
-    // try to get the family from the cache
-    gfxFontFamily *genericFamily = mGenericMappings.GetWeak(genericLang);
-    if (genericFamily) {
-        return genericFamily;
-    }
-
-    // if not found, ask fontconfig to pick the appropriate font
-    nsAutoRef<FcPattern> genericPattern(FcPatternCreate());
-    FcPatternAddString(genericPattern, FC_FAMILY,
-                       ToFcChar8Ptr(generic.get()));
-
-    // -- add the lang to the pattern
-    if (!fcLang.IsEmpty()) {
-        FcPatternAddString(genericPattern, FC_LANG,
-                           ToFcChar8Ptr(fcLang.get()));
-    }
-
-    // -- perform substitutions
-    FcConfigSubstitute(nullptr, genericPattern, FcMatchPattern);
-    FcDefaultSubstitute(genericPattern);
-
-    // -- sort to get the closest matches
-    FcResult result;
-    nsAutoRef<FcFontSet> faces(FcFontSort(nullptr, genericPattern, FcFalse,
-                                          nullptr, &result));
-
-    // -- pick the first font for which a font family exists
-    for (int i = 0; i < faces->nfont; i++) {
-        FcPattern* font = faces->fonts[i];
-        FcChar8* mappedGeneric = nullptr;
-
-        // not scalable? skip...
-        FcBool scalable;
-        if (FcPatternGetBool(font, FC_SCALABLE, 0, &scalable) != FcResultMatch ||
-            !scalable) {
-            continue;
-        }
-
-        FcPatternGetString(font, FC_FAMILY, 0, &mappedGeneric);
-        if (mappedGeneric) {
-            NS_ConvertUTF8toUTF16 mappedGenericName(ToCharPtr(mappedGeneric));
-            genericFamily = gfxPlatformFontList::FindFamily(mappedGenericName);
-            if (genericFamily) {
-                //printf("generic %s ==> %s\n", genericLang.get(), (const char*)mappedGeneric);
-                mGenericMappings.Put(genericLang, genericFamily);
-                break;
-            }
-        }
-    }
-
-    return genericFamily;
-}
-
-/* static */ void
-gfxFcPlatformFontList::CheckFontUpdates(nsITimer *aTimer, void *aThis)
-{
-    // check for font updates
-    FcInitBringUptoDate();
-
-    // update fontlist if current config changed
-    gfxFcPlatformFontList *pfl = static_cast<gfxFcPlatformFontList*>(aThis);
-    FcConfig* current = FcConfigGetCurrent();
-    if (current != pfl->GetLastConfig()) {
-        pfl->UpdateFontList();
-        pfl->ForceGlobalReflow();
-    }
-}
-
-#ifdef MOZ_BUNDLED_FONTS
-void
-gfxFcPlatformFontList::ActivateBundledFonts()
-{
-    if (!mBundledFontsInitialized) {
-        mBundledFontsInitialized = true;
-        nsCOMPtr<nsIFile> localDir;
-        nsresult rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(localDir));
-        if (NS_FAILED(rv)) {
-            return;
-        }
-        if (NS_FAILED(localDir->Append(NS_LITERAL_STRING("fonts")))) {
-            return;
-        }
-        bool isDir;
-        if (NS_FAILED(localDir->IsDirectory(&isDir)) || !isDir) {
-            return;
-        }
-        if (NS_FAILED(localDir->GetNativePath(mBundledFontsPath))) {
-            return;
-        }
-    }
-    if (!mBundledFontsPath.IsEmpty()) {
-        FcConfigAppFontAddDir(nullptr, ToFcChar8Ptr(mBundledFontsPath.get()));
-    }
-}
-#endif
-
-#ifdef MOZ_WIDGET_GTK
-/***************************************************************************
- *
- * This function must be last in the file because it uses the system cairo
- * library.  Above this point the cairo library used is the tree cairo if
- * MOZ_TREE_CAIRO.
- */
-
-#if MOZ_TREE_CAIRO
-// Tree cairo symbols have different names.  Disable their activation through
-// preprocessor macros.
-#undef cairo_ft_font_options_substitute
-
-// The system cairo functions are not declared because the include paths cause
-// the gdk headers to pick up the tree cairo.h.
-extern "C" {
-NS_VISIBILITY_DEFAULT void
-cairo_ft_font_options_substitute (const cairo_font_options_t *options,
-                                  FcPattern                  *pattern);
-}
-#endif
-
-static void
-ApplyGdkScreenFontOptions(FcPattern *aPattern)
-{
-    const cairo_font_options_t *options =
-        gdk_screen_get_font_options(gdk_screen_get_default());
-
-    cairo_ft_font_options_substitute(options, aPattern);
-}
-
-#endif // MOZ_WIDGET_GTK2
-
-
deleted file mode 100644
--- a/gfx/thebes/gfxFcPlatformFontList.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GFXFCPLATFORMFONTLIST_H_
-#define GFXFCPLATFORMFONTLIST_H_
-
-#include "gfxFont.h"
-#include "gfxFontEntry.h"
-#include "gfxFT2FontBase.h"
-#include "gfxPlatformFontList.h"
-#include "mozilla/mozalloc.h"
-
-#include <fontconfig/fontconfig.h>
-#include "ft2build.h"
-#include FT_FREETYPE_H
-#include FT_TRUETYPE_TABLES_H
-#include <cairo.h>
-#include <cairo-ft.h>
-
-#include "gfxFontconfigUtils.h" // xxx - only for nsAutoRefTraits<FcPattern>, etc.
-
-template <>
-class nsAutoRefTraits<FcObjectSet> : public nsPointerRefTraits<FcObjectSet>
-{
-public:
-    static void Release(FcObjectSet *ptr) { FcObjectSetDestroy(ptr); }
-};
-
-template <>
-class nsAutoRefTraits<FcConfig> : public nsPointerRefTraits<FcConfig>
-{
-public:
-    static void Release(FcConfig *ptr) { FcConfigDestroy(ptr); }
-    static void AddRef(FcConfig *ptr) { FcConfigReference(ptr); }
-};
-
-// Helper classes used for clearning out user font data when cairo font
-// face is destroyed. Since multiple faces may use the same data, be
-// careful to assure that the data is only cleared out when all uses
-// expire. The font entry object contains a refptr to FTUserFontData and
-// each cairo font created from that font entry contains a
-// FTUserFontDataRef with a refptr to that same FTUserFontData object.
-
-class FTUserFontData {
-public:
-    NS_INLINE_DECL_REFCOUNTING(FTUserFontData)
-
-    explicit FTUserFontData(FT_Face aFace, const uint8_t* aData)
-        : mFace(aFace), mFontData(aData)
-    {
-    }
-
-    const uint8_t *FontData() const { return mFontData; }
-
-private:
-    ~FTUserFontData()
-    {
-        FT_Done_Face(mFace);
-        if (mFontData) {
-            NS_Free((void*)mFontData);
-        }
-    }
-
-    FT_Face        mFace;
-    const uint8_t *mFontData;
-};
-
-class FTUserFontDataRef {
-public:
-    explicit FTUserFontDataRef(FTUserFontData *aUserFontData)
-        : mUserFontData(aUserFontData)
-    {
-    }
-
-    static void Destroy(void* aData) {
-        FTUserFontDataRef* aUserFontDataRef =
-            static_cast<FTUserFontDataRef*>(aData);
-        delete aUserFontDataRef;
-    }
-
-private:
-    nsRefPtr<FTUserFontData> mUserFontData;
-};
-
-// The names for the font entry and font classes should really
-// the common 'Fc' abbreviation but the gfxPangoFontGroup code already
-// defines versions of these, so use the verbose name for now.
-
-class gfxFontconfigFontEntry : public gfxFontEntry {
-public:
-    // used for system fonts with explicit patterns
-    explicit gfxFontconfigFontEntry(const nsAString& aFaceName,
-                                    FcPattern* aFontPattern);
-
-    // used for data fonts where the fontentry takes ownership
-    // of the font data and the FT_Face
-    explicit gfxFontconfigFontEntry(const nsAString& aFaceName,
-                                    uint16_t aWeight,
-                                    int16_t aStretch,
-                                    bool aItalic,
-                                    const uint8_t *aData,
-                                    FT_Face aFace);
-
-    // used for @font-face local system fonts with explicit patterns
-    explicit gfxFontconfigFontEntry(const nsAString& aFaceName,
-                                    FcPattern* aFontPattern,
-                                    uint16_t aWeight,
-                                    int16_t aStretch,
-                                    bool aItalic);
-
-    FcPattern* GetPattern() { return mFontPattern; }
-
-    bool SupportsLangGroup(nsIAtom *aLangGroup) const override;
-
-    nsresult ReadCMAP(FontInfoData *aFontInfoData = nullptr) override;
-    bool TestCharacterMap(uint32_t aCh) override;
-
-    hb_blob_t* GetFontTable(uint32_t aTableTag) override;
-
-    void ForgetHBFace() override;
-    void ReleaseGrFace(gr_face* aFace) override;
-
-protected:
-    virtual ~gfxFontconfigFontEntry();
-
-    gfxFont *CreateFontInstance(const gfxFontStyle *aFontStyle,
-                                bool aNeedsBold) override;
-
-    // helper method for creating cairo font from pattern
-    cairo_scaled_font_t*
-    CreateScaledFont(FcPattern* aRenderPattern,
-                     const gfxFontStyle *aStyle,
-                     bool aNeedsBold);
-
-    // override to pull data from FTFace
-    virtual nsresult
-    CopyFontTable(uint32_t aTableTag,
-                  FallibleTArray<uint8_t>& aBuffer) override;
-
-    // if HB or GR faces are gone, close down the FT_Face
-    void MaybeReleaseFTFace();
-
-    double GetAspect();
-
-    // pattern for a single face of a family
-    nsCountedRef<FcPattern> mFontPattern;
-
-    // user font data, when needed
-    nsRefPtr<FTUserFontData> mUserFontData;
-
-    // FTFace - initialized when needed
-    FT_Face   mFTFace;
-    bool      mFTFaceInitialized;
-    double    mAspect;
-
-    // data font
-    const uint8_t* mFontData;
-};
-
-class gfxFontconfigFontFamily : public gfxFontFamily {
-public:
-    gfxFontconfigFontFamily(const nsAString& aName) :
-        gfxFontFamily(aName) { }
-
-    void FindStyleVariations(FontInfoData *aFontInfoData = nullptr) override;
-
-    // Families are constructed initially with just references to patterns.
-    // When necessary, these are enumerated within FindStyleVariations.
-    void AddFontPattern(FcPattern* aFontPattern);
-
-protected:
-    virtual ~gfxFontconfigFontFamily() { }
-
-    nsTArray<nsCountedRef<FcPattern> > mFontPatterns;
-};
-
-class gfxFontconfigFont : public gfxFT2FontBase {
-public:
-    gfxFontconfigFont(cairo_scaled_font_t *aScaledFont,
-                      gfxFontEntry *aFontEntry,
-                      const gfxFontStyle *aFontStyle,
-                      bool aNeedsBold);
-
-#ifdef USE_SKIA
-    virtual mozilla::TemporaryRef<mozilla::gfx::GlyphRenderingOptions>
-    GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams = nullptr) override;
-#endif
-
-protected:
-    virtual ~gfxFontconfigFont();
-};
-
-class gfxFcPlatformFontList : public gfxPlatformFontList {
-public:
-    gfxFcPlatformFontList();
-
-    // initialize font lists
-    nsresult InitFontList() override;
-
-    void GetFontList(nsIAtom *aLangGroup,
-                     const nsACString& aGenericFamily,
-                     nsTArray<nsString>& aListOfFonts) override;
-
-
-    gfxFontFamily*
-    GetDefaultFont(const gfxFontStyle* aStyle) override;
-
-    gfxFontEntry*
-    LookupLocalFont(const nsAString& aFontName, uint16_t aWeight,
-                    int16_t aStretch, bool aItalic) override;
-
-    gfxFontEntry*
-    MakePlatformFont(const nsAString& aFontName, uint16_t aWeight,
-                     int16_t aStretch, bool aItalic,
-                     const uint8_t* aFontData,
-                     uint32_t aLength) override;
-
-    gfxFontFamily* FindFamily(const nsAString& aFamily,
-                              nsIAtom* aLanguage = nullptr,
-                              bool aUseSystemFonts = false) override;
-
-    bool GetStandardFamilyName(const nsAString& aFontName,
-                               nsAString& aFamilyName) override;
-
-    FcConfig* GetLastConfig() const { return mLastConfig; }
-
-    static FT_Library GetFTLibrary();
-
-protected:
-    virtual ~gfxFcPlatformFontList();
-
-    // add all the font families found in a font set
-    void AddFontSetFamilies(FcFontSet* aFontSet);
-
-    // figure out which family fontconfig maps a generic to
-    // (aGeneric assumed already lowercase)
-    gfxFontFamily* FindGenericFamily(const nsAString& aGeneric,
-                                     nsIAtom* aLanguage);
-
-    static void CheckFontUpdates(nsITimer *aTimer, void *aThis);
-
-#ifdef MOZ_BUNDLED_FONTS
-    void ActivateBundledFonts();
-    nsCString mBundledFontsPath;
-    bool mBundledFontsInitialized;
-#endif
-
-    // to avoid enumerating all fonts, maintain a mapping of local font
-    // names to family
-    nsRefPtrHashtable<nsStringHashKey, gfxFontFamily> mLocalNames;
-
-    // caching generic/lang ==> font family
-    nsRefPtrHashtable<nsCStringHashKey, gfxFontFamily> mGenericMappings;
-
-    nsCOMPtr<nsITimer> mCheckFontUpdatesTimer;
-    nsCountedRef<FcConfig> mLastConfig;
-
-    static FT_Library sCairoFTLibrary;
-};
-
-#endif /* GFXPLATFORMFONTLIST_H_ */
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -49,18 +49,16 @@ class gfxTextContextPaint;
 #define NO_FONT_LANGUAGE_OVERRIDE      0
 
 #define SMALL_CAPS_SCALE_FACTOR        0.8
 
 // The skew factor used for synthetic-italic [oblique] fonts;
 // we use a platform-dependent value to harmonize with the platform's own APIs.
 #ifdef XP_WIN
 #define OBLIQUE_SKEW_FACTOR  0.3
-#elif defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
-#define OBLIQUE_SKEW_FACTOR  0.2
 #else
 #define OBLIQUE_SKEW_FACTOR  0.25
 #endif
 
 struct gfxTextRunDrawCallbacks;
 
 namespace mozilla {
 namespace gfx {
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -825,19 +825,17 @@ gfxGDIFontList::MakePlatformFont(const n
     if (isCFF && !IsWin7OrLater()) {
         fe->mForceGDI = true;
     }
 
     return fe;
 }
 
 gfxFontFamily*
-gfxGDIFontList::FindFamily(const nsAString& aFamily,
-                           nsIAtom* aLanguage,
-                           bool aUseSystemFonts)
+gfxGDIFontList::FindFamily(const nsAString& aFamily, bool aUseSystemFonts)
 {
     nsAutoString keyName(aFamily);
     BuildKeyNameFromFontName(keyName);
 
     gfxFontFamily *ff = mFontSubstitutes.GetWeak(keyName);
     if (ff) {
         return ff;
     }
--- a/gfx/thebes/gfxGDIFontList.h
+++ b/gfx/thebes/gfxGDIFontList.h
@@ -305,17 +305,16 @@ public:
     }
 
     // initialize font lists
     virtual nsresult InitFontList();
 
     virtual gfxFontFamily* GetDefaultFont(const gfxFontStyle* aStyle);
 
     virtual gfxFontFamily* FindFamily(const nsAString& aFamily,
-                                      nsIAtom* aLanguage = nullptr,
                                       bool aUseSystemFonts = false);
 
     virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
                                           uint16_t aWeight,
                                           int16_t aStretch,
                                           bool aItalic);
 
     virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
--- a/gfx/thebes/gfxPangoFonts.cpp
+++ b/gfx/thebes/gfxPangoFonts.cpp
@@ -1257,17 +1257,16 @@ gfxPangoFontGroup::gfxPangoFontGroup(con
     // This language is passed to the font for shaping.
     // Shaping doesn't know about lang groups so make it a real language.
     if (mPangoLanguage) {
         mStyle.language = do_GetAtom(pango_language_to_string(mPangoLanguage));
     }
 
     // dummy entry, will be replaced when actually needed
     mFonts.AppendElement(FamilyFace());
-    mSkipUpdateUserFonts = true;
 }
 
 gfxPangoFontGroup::~gfxPangoFontGroup()
 {
 }
 
 gfxFontGroup *
 gfxPangoFontGroup::Copy(const gfxFontStyle *aStyle)
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -71,20 +71,16 @@
 #include "imgITools.h"
 
 #include "plstr.h"
 #include "nsCRT.h"
 #include "GLContext.h"
 #include "GLContextProvider.h"
 #include "mozilla/gfx/Logging.h"
 
-#if defined(MOZ_WIDGET_GTK)
-#include "gfxPlatformGtk.h" // xxx - for UseFcFontList
-#endif
-
 #ifdef MOZ_WIDGET_ANDROID
 #include "TexturePoolOGL.h"
 #endif
 
 #ifdef MOZ_WIDGET_GONK
 #include "mozilla/layers/GrallocTextureHost.h"
 #endif
 
@@ -381,49 +377,16 @@ static const char *gPrefLangNames[] = {
     "x-orya",
     "x-telu",
     "x-knda",
     "x-sinh",
     "x-tibt",
     "x-unicode",
 };
 
-// this needs to match the list of pref font.default.xx entries listed in all.js!
-// the order *must* match the order in eFontPrefLang
-static nsIAtom* gPrefLangToLangGroups[] = {
-    nsGkAtoms::x_western,
-    nsGkAtoms::Japanese,
-    nsGkAtoms::Taiwanese,
-    nsGkAtoms::Chinese,
-    nsGkAtoms::HongKongChinese,
-    nsGkAtoms::ko,
-    nsGkAtoms::x_cyrillic,
-    nsGkAtoms::el,
-    nsGkAtoms::th,
-    nsGkAtoms::he,
-    nsGkAtoms::ar,
-    nsGkAtoms::x_devanagari,
-    nsGkAtoms::x_tamil,
-    nsGkAtoms::x_armn,
-    nsGkAtoms::x_beng,
-    nsGkAtoms::x_cans,
-    nsGkAtoms::x_ethi,
-    nsGkAtoms::x_geor,
-    nsGkAtoms::x_gujr,
-    nsGkAtoms::x_guru,
-    nsGkAtoms::x_khmr,
-    nsGkAtoms::x_mlym,
-    nsGkAtoms::x_orya,
-    nsGkAtoms::x_telu,
-    nsGkAtoms::x_knda,
-    nsGkAtoms::x_sinh,
-    nsGkAtoms::x_tibt,
-    nsGkAtoms::Unicode
-};
-
 gfxPlatform::gfxPlatform()
   : mTileWidth(-1)
   , mTileHeight(-1)
   , mAzureCanvasBackendCollector(this, &gfxPlatform::GetAzureBackendInfo)
   , mApzSupportCollector(this, &gfxPlatform::GetApzSupportInfo)
 {
     mAllowDownloadableFonts = UNINITIALIZED_VALUE;
     mFallbackUsesCmaps = UNINITIALIZED_VALUE;
@@ -535,30 +498,23 @@ gfxPlatform::Init()
     mozilla::gl::GLContext::StaticInit();
 #endif
 
     InitLayersAccelerationPrefs();
     InitLayersIPC();
 
     nsresult rv;
 
-    bool usePlatformFontList = true;
-#if defined(MOZ_WIDGET_GTK)
-    usePlatformFontList = gfxPlatformGtk::UseFcFontList();
-#elif defined(MOZ_WIDGET_QT)
-    usePlatformFontList = false;
+#if defined(XP_MACOSX) || defined(XP_WIN) || defined(ANDROID) // temporary, until this is implemented on others
+    rv = gfxPlatformFontList::Init();
+    if (NS_FAILED(rv)) {
+        NS_RUNTIMEABORT("Could not initialize gfxPlatformFontList");
+    }
 #endif
 
-    if (usePlatformFontList) {
-        rv = gfxPlatformFontList::Init();
-        if (NS_FAILED(rv)) {
-            NS_RUNTIMEABORT("Could not initialize gfxPlatformFontList");
-        }
-    }
-
     gPlatform->mScreenReferenceSurface =
         gPlatform->CreateOffscreenSurface(IntSize(1, 1),
                                           gfxContentType::COLOR_ALPHA);
     if (!gPlatform->mScreenReferenceSurface) {
         NS_RUNTIMEABORT("Could not initialize mScreenReferenceSurface");
     }
 
     gPlatform->mScreenReferenceDrawTarget =
@@ -1513,29 +1469,16 @@ gfxPlatform::GetFontPrefLangFor(nsIAtom 
 {
     if (!aLang)
         return eFontPrefLang_Others;
     nsAutoCString lang;
     aLang->ToUTF8String(lang);
     return GetFontPrefLangFor(lang.get());
 }
 
-nsIAtom*
-gfxPlatform::GetLangGroupForPrefLang(eFontPrefLang aLang)
-{
-    // the special CJK set pref lang should be resolved into separate
-    // calls to individual CJK pref langs before getting here
-    NS_ASSERTION(aLang != eFontPrefLang_CJKSet, "unresolved CJK set pref lang");
-
-    if (uint32_t(aLang) < ArrayLength(gPrefLangToLangGroups)) {
-        return gPrefLangToLangGroups[uint32_t(aLang)];
-    }
-    return nsGkAtoms::Unicode;
-}
-
 const char*
 gfxPlatform::GetPrefLangName(eFontPrefLang aLang)
 {
     if (uint32_t(aLang) < ArrayLength(gPrefLangNames)) {
         return gPrefLangNames[uint32_t(aLang)];
     }
     return nullptr;
 }
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -465,19 +465,16 @@ public:
                                   void *aClosure);
 
     // convert a lang group to enum constant (i.e. "zh-TW" ==> eFontPrefLang_ChineseTW)
     static eFontPrefLang GetFontPrefLangFor(const char* aLang);
 
     // convert a lang group atom to enum constant
     static eFontPrefLang GetFontPrefLangFor(nsIAtom *aLang);
 
-    // convert an enum constant to a lang group atom
-    static nsIAtom* GetLangGroupForPrefLang(eFontPrefLang aLang);
-
     // convert a enum constant to lang group string (i.e. eFontPrefLang_ChineseTW ==> "zh-TW")
     static const char* GetPrefLangName(eFontPrefLang aLang);
    
     // map a Unicode range (based on char code) to a font language for Preferences
     static eFontPrefLang GetFontPrefLangFor(uint8_t aUnicodeRange);
 
     // returns true if a pref lang is CJK
     static bool IsLangCJK(eFontPrefLang aLang);
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -645,17 +645,18 @@ gfxPlatformFontList::CommonFontFallback(
                                                        aRunScript,
                                                        defaultFallbacks);
     numFallbacks = defaultFallbacks.Length();
     for (i = 0; i < numFallbacks; i++) {
         nsAutoString familyName;
         const char *fallbackFamily = defaultFallbacks[i];
 
         familyName.AppendASCII(fallbackFamily);
-        gfxFontFamily *fallback = FindFamilyByCanonicalName(familyName);
+        gfxFontFamily *fallback =
+                gfxPlatformFontList::PlatformFontList()->FindFamily(familyName);
         if (!fallback)
             continue;
 
         gfxFontEntry *fontEntry;
         bool needsBold;  // ignored in the system fallback case
 
         // use first font in list that supports a given character
         fontEntry = fallback->FindFontForStyle(*aMatchStyle, needsBold);
@@ -720,19 +721,17 @@ gfxPlatformFontList::CheckFamily(gfxFont
         mFontFamilies.Remove(key);
         return nullptr;
     }
 
     return aFamily;
 }
 
 gfxFontFamily* 
-gfxPlatformFontList::FindFamily(const nsAString& aFamily,
-                                nsIAtom* aLanguage,
-                                bool aUseSystemFonts)
+gfxPlatformFontList::FindFamily(const nsAString& aFamily, bool aUseSystemFonts)
 {
     nsAutoString key;
     gfxFontFamily *familyEntry;
     GenerateFontListKey(aFamily, key);
 
     NS_ASSERTION(mFontFamilies.Count() != 0, "system font list was not initialized correctly");
 
     // lookup in canonical (i.e. English) family name list
--- a/gfx/thebes/gfxPlatformFontList.h
+++ b/gfx/thebes/gfxPlatformFontList.h
@@ -105,33 +105,32 @@ public:
         sPlatformFontList = nullptr;
     }
 
     virtual ~gfxPlatformFontList();
 
     // initialize font lists
     virtual nsresult InitFontList();
 
-    virtual void GetFontList(nsIAtom *aLangGroup,
-                             const nsACString& aGenericFamily,
-                             nsTArray<nsString>& aListOfFonts);
+    void GetFontList (nsIAtom *aLangGroup,
+                      const nsACString& aGenericFamily,
+                      nsTArray<nsString>& aListOfFonts);
 
     void UpdateFontList();
 
     void ClearPrefFonts() { mPrefFonts.Clear(); }
 
     virtual void GetFontFamilyList(nsTArray<nsRefPtr<gfxFontFamily> >& aFamilyArray);
 
     gfxFontEntry*
     SystemFindFontForChar(uint32_t aCh, uint32_t aNextCh,
                           int32_t aRunScript,
                           const gfxFontStyle* aStyle);
 
     virtual gfxFontFamily* FindFamily(const nsAString& aFamily,
-                                      nsIAtom* aLanguage = nullptr,
                                       bool aUseSystemFonts = false);
 
     gfxFontEntry* FindFontForFamily(const nsAString& aFamily, const gfxFontStyle* aStyle, bool& aNeedsBold);
 
     bool GetPrefFontFamilyEntries(eFontPrefLang aLangGroup, nsTArray<nsRefPtr<gfxFontFamily> > *array);
     void SetPrefFontFamilyEntries(eFontPrefLang aLangGroup, nsTArray<nsRefPtr<gfxFontFamily> >& array);
 
     // name lookup table methods
@@ -206,28 +205,16 @@ protected:
     explicit gfxPlatformFontList(bool aNeedFullnamePostscriptNames = true);
 
     static gfxPlatformFontList *sPlatformFontList;
 
     static PLDHashOperator FindFontForCharProc(nsStringHashKey::KeyType aKey,
                                                nsRefPtr<gfxFontFamily>& aFamilyEntry,
                                                void* userArg);
 
-    // Lookup family name in global family list without substitutions or
-    // localized family name lookup. Used for common font fallback families.
-    gfxFontFamily* FindFamilyByCanonicalName(const nsAString& aFamily) {
-        nsAutoString key;
-        gfxFontFamily *familyEntry;
-        GenerateFontListKey(aFamily, key);
-        if ((familyEntry = mFontFamilies.GetWeak(key))) {
-            return CheckFamily(familyEntry);
-        }
-        return nullptr;
-    }
-
     // returns default font for a given character, null otherwise
     gfxFontEntry* CommonFontFallback(uint32_t aCh, uint32_t aNextCh,
                                      int32_t aRunScript,
                                      const gfxFontStyle* aMatchStyle,
                                      gfxFontFamily** aMatchedFamily);
 
     // search fonts system-wide for a given character, null otherwise
     virtual gfxFontEntry* GlobalFontFallback(const uint32_t aCh,
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -7,17 +7,16 @@
 #define PANGO_ENABLE_ENGINE
 
 #include "gfxPlatformGtk.h"
 #include "prenv.h"
 
 #include "nsUnicharUtils.h"
 #include "nsUnicodeProperties.h"
 #include "gfx2DGlue.h"
-#include "gfxFcPlatformFontList.h"
 #include "gfxFontconfigUtils.h"
 #include "gfxPangoFonts.h"
 #include "gfxContext.h"
 #include "gfxUserFontSet.h"
 #include "gfxUtils.h"
 #include "gfxFT2FontBase.h"
 
 #include "mozilla/gfx/2D.h"
@@ -55,43 +54,37 @@ gfxFontconfigUtils *gfxPlatformGtk::sFon
 #if (MOZ_WIDGET_GTK == 2)
 static cairo_user_data_key_t cairo_gdk_drawable_key;
 #endif
 
 #ifdef MOZ_X11
     bool gfxPlatformGtk::sUseXRender = true;
 #endif
 
-bool gfxPlatformGtk::sUseFcFontList = false;
-
 gfxPlatformGtk::gfxPlatformGtk()
 {
-    sUseFcFontList = mozilla::Preferences::GetBool("gfx.font_rendering.fontconfig.fontlist.enabled");
-    if (!sUseFcFontList && !sFontconfigUtils) {
+    if (!sFontconfigUtils)
         sFontconfigUtils = gfxFontconfigUtils::GetFontconfigUtils();
-    }
-
 #ifdef MOZ_X11
     sUseXRender = (GDK_IS_X11_DISPLAY(gdk_display_get_default())) ? 
                     mozilla::Preferences::GetBool("gfx.xrender.enabled") : false;
 #endif
 
     uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO) | BackendTypeBit(BackendType::SKIA);
     uint32_t contentMask = BackendTypeBit(BackendType::CAIRO) | BackendTypeBit(BackendType::SKIA);
     InitBackendPrefs(canvasMask, BackendType::CAIRO,
                      contentMask, BackendType::CAIRO);
 }
 
 gfxPlatformGtk::~gfxPlatformGtk()
 {
-    if (!sUseFcFontList) {
-        gfxFontconfigUtils::Shutdown();
-        sFontconfigUtils = nullptr;
-        gfxPangoFontGroup::Shutdown();
-    }
+    gfxFontconfigUtils::Shutdown();
+    sFontconfigUtils = nullptr;
+
+    gfxPangoFontGroup::Shutdown();
 }
 
 void
 gfxPlatformGtk::FlushContentDrawing()
 {
     if (UseXRender()) {
         XFlush(DefaultXDisplay());
     }
@@ -151,138 +144,58 @@ gfxPlatformGtk::CreateOffscreenSurface(c
     return newSurface.forget();
 }
 
 nsresult
 gfxPlatformGtk::GetFontList(nsIAtom *aLangGroup,
                             const nsACString& aGenericFamily,
                             nsTArray<nsString>& aListOfFonts)
 {
-    if (sUseFcFontList) {
-        gfxPlatformFontList::PlatformFontList()->GetFontList(aLangGroup,
-                                                             aGenericFamily,
-                                                             aListOfFonts);
-        return NS_OK;
-    }
-
-    return sFontconfigUtils->GetFontList(aLangGroup,
-                                         aGenericFamily,
+    return sFontconfigUtils->GetFontList(aLangGroup, aGenericFamily,
                                          aListOfFonts);
 }
 
 nsresult
 gfxPlatformGtk::UpdateFontList()
 {
-    if (sUseFcFontList) {
-        gfxPlatformFontList::PlatformFontList()->UpdateFontList();
-        return NS_OK;
-    }
-
     return sFontconfigUtils->UpdateFontList();
 }
 
-// xxx - this is ubuntu centric, need to go through other distros and flesh
-// out a more general list
-static const char kFontDejaVuSans[] = "DejaVu Sans";
-static const char kFontDejaVuSerif[] = "DejaVu Serif";
-static const char kFontFreeSans[] = "FreeSans";
-static const char kFontFreeSerif[] = "FreeSerif";
-static const char kFontTakaoPGothic[] = "TakaoPGothic";
-static const char kFontDroidSansFallback[] = "Droid Sans Fallback";
-static const char kFontWenQuanYiMicroHei[] = "WenQuanYi Micro Hei";
-static const char kFontNanumGothic[] = "NanumGothic";
-
-void
-gfxPlatformGtk::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
-                                       int32_t aRunScript,
-                                       nsTArray<const char*>& aFontList)
-{
-    aFontList.AppendElement(kFontDejaVuSerif);
-    aFontList.AppendElement(kFontFreeSerif);
-    aFontList.AppendElement(kFontDejaVuSans);
-    aFontList.AppendElement(kFontFreeSans);
-
-    // add fonts for CJK ranges
-    // xxx - this isn't really correct, should use the same CJK font ordering
-    // as the pref font code
-    if (aCh >= 0x3000 &&
-        ((aCh < 0xe000) ||
-         (aCh >= 0xf900 && aCh < 0xfff0) ||
-         ((aCh >> 16) == 2))) {
-        aFontList.AppendElement(kFontTakaoPGothic);
-        aFontList.AppendElement(kFontDroidSansFallback);
-        aFontList.AppendElement(kFontWenQuanYiMicroHei);
-        aFontList.AppendElement(kFontNanumGothic);
-    }
-}
-
-gfxPlatformFontList*
-gfxPlatformGtk::CreatePlatformFontList()
-{
-    gfxPlatformFontList* list = new gfxFcPlatformFontList();
-    if (NS_SUCCEEDED(list->InitFontList())) {
-        return list;
-    }
-    gfxPlatformFontList::Shutdown();
-    return nullptr;
-}
-
 nsresult
 gfxPlatformGtk::GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName)
 {
-    if (sUseFcFontList) {
-        gfxPlatformFontList::PlatformFontList()->
-            GetStandardFamilyName(aFontName, aFamilyName);
-        return NS_OK;
-    }
-
     return sFontconfigUtils->GetStandardFamilyName(aFontName, aFamilyName);
 }
 
 gfxFontGroup *
 gfxPlatformGtk::CreateFontGroup(const FontFamilyList& aFontFamilyList,
                                 const gfxFontStyle *aStyle,
                                 gfxUserFontSet *aUserFontSet)
 {
-    if (sUseFcFontList) {
-        return new gfxFontGroup(aFontFamilyList, aStyle, aUserFontSet);
-    }
-
     return new gfxPangoFontGroup(aFontFamilyList, aStyle, aUserFontSet);
 }
 
 gfxFontEntry*
 gfxPlatformGtk::LookupLocalFont(const nsAString& aFontName,
                                 uint16_t aWeight,
                                 int16_t aStretch,
                                 bool aItalic)
 {
-    if (sUseFcFontList) {
-        gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList();
-        return pfl->LookupLocalFont(aFontName, aWeight, aStretch, aItalic);
-    }
-
     return gfxPangoFontGroup::NewFontEntry(aFontName, aWeight,
                                            aStretch, aItalic);
 }
 
 gfxFontEntry* 
 gfxPlatformGtk::MakePlatformFont(const nsAString& aFontName,
                                  uint16_t aWeight,
                                  int16_t aStretch,
                                  bool aItalic,
                                  const uint8_t* aFontData,
                                  uint32_t aLength)
 {
-    if (sUseFcFontList) {
-        gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList();
-        return pfl->MakePlatformFont(aFontName, aWeight, aStretch, aItalic,
-                                     aFontData, aLength);
-    }
-
     // passing ownership of the font data to the new font entry
     return gfxPangoFontGroup::NewFontEntry(aFontName, aWeight,
                                            aStretch, aItalic,
                                            aFontData, aLength);
 }
 
 bool
 gfxPlatformGtk::IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags)
--- a/gfx/thebes/gfxPlatformGtk.h
+++ b/gfx/thebes/gfxPlatformGtk.h
@@ -36,23 +36,16 @@ public:
       GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont) override;
 
     virtual nsresult GetFontList(nsIAtom *aLangGroup,
                                  const nsACString& aGenericFamily,
                                  nsTArray<nsString>& aListOfFonts) override;
 
     virtual nsresult UpdateFontList() override;
 
-    virtual void
-    GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
-                           int32_t aRunScript,
-                           nsTArray<const char*>& aFontList) override;
-
-    virtual gfxPlatformFontList* CreatePlatformFontList();
-
     virtual nsresult GetStandardFamilyName(const nsAString& aFontName,
                                            nsAString& aFamilyName) override;
 
     virtual gfxFontGroup* CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
                                           const gfxFontStyle *aStyle,
                                           gfxUserFontSet *aUserFontSet) override;
 
     /**
@@ -103,18 +96,16 @@ public:
             return false;
 
         return sUseXRender;
 #else
         return false;
 #endif
     }
 
-    static bool UseFcFontList() { return sUseFcFontList; }
-
     bool UseImageOffscreenSurfaces() {
         // We want to turn on image offscreen surfaces ONLY for GTK3 builds
         // since GTK2 theme rendering still requires xlib surfaces per se.
 #if (MOZ_WIDGET_GTK == 3)
         return gfxPrefs::UseImageOffscreenSurfaces();
 #else
         return false;
 #endif
@@ -133,15 +124,11 @@ protected:
 
 private:
     virtual void GetPlatformCMSOutputProfile(void *&mem,
                                              size_t &size) override;
 
 #ifdef MOZ_X11
     static bool sUseXRender;
 #endif
-
-    // xxx - this will be removed once the new fontconfig platform font list
-    // replaces gfxPangoFontGroup
-    static bool sUseFcFontList;
 };
 
 #endif /* GFX_PLATFORM_GTK_H */
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -18,20 +18,16 @@
 #include "gfxFontMissingGlyphs.h"
 #include "gfxScriptItemizer.h"
 #include "nsUnicodeProperties.h"
 #include "nsUnicodeRange.h"
 #include "nsStyleConsts.h"
 #include "mozilla/Likely.h"
 #include "gfx2DGlue.h"
 
-#if defined(MOZ_WIDGET_GTK)
-#include "gfxPlatformGtk.h" // xxx - for UseFcFontList
-#endif
-
 #include "cairo.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::unicode;
 using mozilla::services::GetObserverService;
 
 static const char16_t kEllipsisChar[] = { 0x2026, 0x0 };
@@ -1535,17 +1531,16 @@ gfxFontGroup::gfxFontGroup(const FontFam
     : mFamilyList(aFontFamilyList)
     , mStyle(*aStyle)
     , mUnderlineOffset(UNDERLINE_OFFSET_NOT_SET)
     , mHyphenWidth(-1)
     , mUserFontSet(aUserFontSet)
     , mTextPerf(nullptr)
     , mPageLang(gfxPlatform::GetFontPrefLangFor(aStyle->language))
     , mSkipDrawing(false)
-    , mSkipUpdateUserFonts(false)
 {
     // We don't use SetUserFontSet() here, as we want to unconditionally call
     // BuildFontList() rather than only do UpdateUserFonts() if it changed.
     mCurrGeneration = GetGeneration();
     BuildFontList();
 }
 
 gfxFontGroup::~gfxFontGroup()
@@ -1682,27 +1677,20 @@ void gfxFontGroup::EnumerateFontList(nsI
                          aLanguage,
                          aClosure);
     }
 }
 
 void
 gfxFontGroup::BuildFontList()
 {
-    bool enumerateFonts = true;
-
-#if defined(MOZ_WIDGET_GTK)
-    // xxx - eliminate this once gfxPangoFontGroup is no longer needed
-    enumerateFonts = gfxPlatformGtk::UseFcFontList();
-#elif defined(MOZ_WIDGET_QT)
-    enumerateFonts = false;
+// gfxPangoFontGroup behaves differently, so this method is a no-op on that platform
+#if defined(XP_MACOSX) || defined(XP_WIN) || defined(ANDROID)
+    EnumerateFontList(mStyle.language);
 #endif
-    if (enumerateFonts) {
-        EnumerateFontList(mStyle.language);
-    }
 }
 
 void
 gfxFontGroup::FindPlatformFont(const nsAString& aName,
                                bool aUseFontSet,
                                void *aClosure)
 {
     bool needsBold;
@@ -1731,17 +1719,17 @@ gfxFontGroup::FindPlatformFont(const nsA
                 }
             }
         }
     }
 
     // Not known in the user font set ==> check system fonts
     if (!family) {
         gfxPlatformFontList *fontList = gfxPlatformFontList::PlatformFontList();
-        family = fontList->FindFamily(aName, mStyle.language, mStyle.systemFont);
+        family = fontList->FindFamily(aName, mStyle.systemFont);
         if (family) {
             fe = family->FindFontForStyle(mStyle, needsBold);
         }
     }
 
     // add to the font group, unless it's already there
     if (fe && !HasFont(fe)) {
         mFonts.AppendElement(FamilyFace(family, fe, needsBold));
@@ -2352,21 +2340,23 @@ gfxFontGroup::InitScriptRun(gfxContext *
                             uint32_t aLength, // length of the script run
                             int32_t aRunScript,
                             gfxMissingFontRecorder *aMFR)
 {
     NS_ASSERTION(aLength > 0, "don't call InitScriptRun for a 0-length run");
     NS_ASSERTION(aTextRun->GetShapingState() != gfxTextRun::eShapingState_Aborted,
                  "don't call InitScriptRun with aborted shaping state");
 
-    // confirm the load state of userfonts in the list
-    if (!mSkipUpdateUserFonts && mUserFontSet &&
-        mCurrGeneration != mUserFontSet->GetGeneration()) {
+#if defined(XP_MACOSX) || defined(XP_WIN) || defined(ANDROID)
+    // non-linux platforms build the fontlist lazily and include userfonts
+    // so need to confirm the load state of userfonts in the list
+    if (mUserFontSet && mCurrGeneration != mUserFontSet->GetGeneration()) {
         UpdateUserFonts();
     }
+#endif
 
     gfxFont *mainFont = GetFirstValidFont();
 
     uint32_t runStart = 0;
     nsAutoTArray<gfxTextRange,3> fontRanges;
     ComputeRanges(fontRanges, aString, aLength, aRunScript,
                   aTextRun->GetFlags() & gfxTextRunFactory::TEXT_ORIENT_MASK);
     uint32_t numRanges = fontRanges.Length();
@@ -2612,16 +2602,20 @@ gfxFontGroup::GetEllipsisTextRun(int32_t
 }
 
 already_AddRefed<gfxFont>
 gfxFontGroup::FindNonItalicFaceForChar(gfxFontFamily* aFamily, uint32_t aCh)
 {
     NS_ASSERTION(mStyle.style != NS_FONT_STYLE_NORMAL,
                  "should only be called in the italic/oblique case");
 
+    if (!aFamily->TestCharacterMap(aCh)) {
+        return nullptr;
+    }
+
     gfxFontStyle regularStyle = mStyle;
     regularStyle.style = NS_FONT_STYLE_NORMAL;
     bool needsBold;
     gfxFontEntry *fe = aFamily->FindFontForStyle(regularStyle, needsBold);
     NS_ASSERTION(!fe->mIsUserFontContainer,
                  "should only be searching platform fonts");
     if (!fe->HasCharacter(aCh)) {
         return nullptr;
@@ -2798,21 +2792,19 @@ gfxFontGroup::FindFontForChar(uint32_t a
             if (font) {
                 *aMatchType = gfxTextRange::kFontGroup;
                 return font.forget();
             }
         }
 
         // If italic, test the regular face to see if it supports the character.
         // Only do this for platform fonts, not userfonts.
-        fe = ff.FontEntry();
         if (mStyle.style != NS_FONT_STYLE_NORMAL &&
-            !fe->mIsUserFontContainer &&
-            !fe->IsUserFont()) {
-            font = FindNonItalicFaceForChar(ff.Family(), aCh);
+            !ff.FontEntry()->IsUserFont()) {
+            font = FindNonItalicFaceForChar(mFonts[i].Family(), aCh);
             if (font) {
                 *aMatchType = gfxTextRange::kFontGroup;
                 return font.forget();
             }
         }
     }
 
     if (fontListLength == 0) {
@@ -3085,20 +3077,17 @@ struct PrefFontCallbackData {
     {}
 
     nsTArray<nsRefPtr<gfxFontFamily> >& mPrefFamilies;
 
     static bool AddFontFamilyEntry(eFontPrefLang aLang, const nsAString& aName, void *aClosure)
     {
         PrefFontCallbackData *prefFontData = static_cast<PrefFontCallbackData*>(aClosure);
 
-        // map pref lang to langGroup for language-sensitive lookups
-        nsIAtom* lang = gfxPlatform::GetLangGroupForPrefLang(aLang);
-        gfxFontFamily *family =
-            gfxPlatformFontList::PlatformFontList()->FindFamily(aName, lang);
+        gfxFontFamily *family = gfxPlatformFontList::PlatformFontList()->FindFamily(aName);
         if (family) {
             prefFontData->mPrefFamilies.AppendElement(family);
         }
         return true;
     }
 };
 
 already_AddRefed<gfxFont>
--- a/gfx/thebes/gfxTextRun.h
+++ b/gfx/thebes/gfxTextRun.h
@@ -1051,19 +1051,16 @@ protected:
     eFontPrefLang           mLastPrefLang;       // lang group for last pref font
     eFontPrefLang           mPageLang;
     bool                    mLastPrefFirstFont;  // is this the first font in the list of pref fonts for this lang group?
 
     bool                    mSkipDrawing; // hide text while waiting for a font
                                           // download to complete (or fallback
                                           // timer to fire)
 
-    // xxx - gfxPangoFontGroup skips UpdateUserFonts
-    bool                    mSkipUpdateUserFonts;
-
     /**
      * Textrun creation short-cuts for special cases where we don't need to
      * call a font shaper to generate glyphs.
      */
     gfxTextRun *MakeEmptyTextRun(const Parameters *aParams, uint32_t aFlags);
     gfxTextRun *MakeSpaceTextRun(const Parameters *aParams, uint32_t aFlags);
     gfxTextRun *MakeBlankTextRun(uint32_t aLength,
                                  const Parameters *aParams, uint32_t aFlags);
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -106,17 +106,16 @@ elif CONFIG['MOZ_WIDGET_GTK']:
         'gfxGdkNativeRenderer.h',
         'gfxPangoFonts.h',
         'gfxPDFSurface.h',
         'gfxPlatformGtk.h',
         'gfxPSSurface.h',
     ]
 
     SOURCES += [
-        'gfxFcPlatformFontList.cpp',
         'gfxFontconfigUtils.cpp',
         'gfxFT2FontBase.cpp',
         'gfxFT2Utils.cpp',
         'gfxGdkNativeRenderer.cpp',
         'gfxPangoFonts.cpp',
         'gfxPDFSurface.cpp',
         'gfxPlatformGtk.cpp',
         'gfxPSSurface.cpp',
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -63,21 +63,16 @@
 #include "nsFrameLoader.h"
 #include "mozilla/dom/FontFaceSet.h"
 #include "nsContentUtils.h"
 #include "nsPIWindowRoot.h"
 #include "mozilla/Preferences.h"
 #include "gfxTextRun.h"
 #include "nsFontFaceUtils.h"
 
-#if defined(MOZ_WIDGET_GTK)
-#include "gfxPlatformGtk.h" // xxx - for UseFcFontList
-#endif
-
-
 // Needed for Start/Stop of Image Animation
 #include "imgIContainer.h"
 #include "nsIImageLoadingContent.h"
 
 #include "nsCSSParser.h"
 #include "nsBidiUtils.h"
 #include "nsServiceManagerUtils.h"
 
@@ -2170,20 +2165,18 @@ nsPresContext::RebuildUserFontSet()
 
 void
 nsPresContext::UserFontSetUpdated(gfxUserFontEntry* aUpdatedFont)
 {
   if (!mShell)
     return;
 
   bool usePlatformFontList = true;
-#if defined(MOZ_WIDGET_GTK)
-    usePlatformFontList = gfxPlatformGtk::UseFcFontList();
-#elif defined(MOZ_WIDGET_QT)
-    usePlatformFontList = false;
+#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
+  usePlatformFontList = false;
 #endif
 
   // xxx - until the Linux platform font list is always used, use full
   // restyle to force updates with gfxPangoFontGroup usage
   // Note: this method is called without a font when rules in the userfont set
   // are updated, which may occur during reflow as a result of the lazy
   // initialization of the userfont set. It would be better to avoid a full
   // restyle but until this method is only called outside of reflow, schedule a
--- a/layout/base/tests/chrome/printpreview_helper.xul
+++ b/layout/base/tests/chrome/printpreview_helper.xul
@@ -121,31 +121,31 @@ function startTest1() {
   // after print preview, but not during it.
   window.frames[0].wrappedJSObject.counter = counter;
   window.frames[0].counterTimeout = "document.body.firstChild.nextSibling.innerHTML = ++counter + ' timers';" +
                                     "window.setTimeout(counterTimeout, 0);";
   window.frames[0].setTimeout(window.frames[0].counterTimeout, 0);
   window.frames[0].document.body.firstChild.innerHTML = "Print preview";
 
   printpreview();
-  ctx1.drawWindow(window.frames[1], 0, 0, 400, 400, "rgb(256,256,256)");
+  ctx1.drawWindow(window.frames[1], 0, 0, 300, 300, "rgb(256,256,256)");
   window.frames[0].document.body.firstChild.innerHTML = "Galley presentation";
 
   // Add some elements.
   addHTMLContent(window.frames[0].document.body.lastChild);
   // Delete them.
   window.frames[0].document.body.lastChild.innerHTML = "";
   // And readd.
   addHTMLContent(window.frames[0].document.body.lastChild);
 
   setTimeout(finalizeTest1, 1000);
 }
 
 function finalizeTest1() {
-  ctx2.drawWindow(window.frames[1], 0, 0, 400, 400, "rgb(256,256,256)");
+  ctx2.drawWindow(window.frames[1], 0, 0, 300, 300, "rgb(256,256,256)");
   exitprintpreview();
   ok(compareCanvases(), "Canvas should be the same!");
   counter = window.frames[0].counter;
   // This timeout is needed so that we can check that timers do run after
   // print preview.
   setTimeout(runTest2, 1000);
 }
 
@@ -205,23 +205,23 @@ function runTest3() {
   setTimeout(runTest4, 0)
 }
 
 function compareFormElementPrint(el1, el2, equals) {
   window.frames[0].document.body.innerHTML = el1;
   window.frames[0].document.body.firstChild.value =
     window.frames[0].document.body.firstChild.getAttribute('value');
   printpreview();
-  ctx1.drawWindow(window.frames[1], 0, 0, 400, 400, "rgb(256,256,256)");
+  ctx1.drawWindow(window.frames[1], 0, 0, 300, 300, "rgb(256,256,256)");
   exitprintpreview();
   window.frames[0].document.body.innerHTML = el2;
   window.frames[0].document.body.firstChild.value =
     window.frames[0].document.body.firstChild.getAttribute('value');
   printpreview();
-  ctx2.drawWindow(window.frames[1], 0, 0, 400, 400, "rgb(256,256,256)");
+  ctx2.drawWindow(window.frames[1], 0, 0, 300, 300, "rgb(256,256,256)");
   exitprintpreview();
   is(compareCanvases(), equals,
      "Comparing print preview didn't succeed [" + el1 + " : " + el2 + "]");
   setTimeout(runTest3, 100);
 }
 
 // This is a crash test for bug 539060.
 function runTest4() {
@@ -263,12 +263,12 @@ function runTest6end() {
 
   finish();
 }
 
 ]]></script>
 <table style="border: 1px solid black;" xmlns="http://www.w3.org/1999/xhtml">
 <tr><th>Print preview canvas 1</th><th>Print preview canvas 2</th></tr>
 <tr>
-<td><canvas height="400" width="400"></canvas></td>
-<td><canvas height="400" width="400"></canvas></td>
+<td><canvas height="300" width="300"></canvas></td>
+<td><canvas height="300" width="300"></canvas></td>
 </tr></table>
 </window>
--- a/layout/reftests/font-face/reftest.list
+++ b/layout/reftests/font-face/reftest.list
@@ -38,38 +38,37 @@ skip-if(B2G||Mulet) HTTP(..) == src-list
 == src-list-data-4.html src-list-data-ref.html
 
 # load with data url vs. font data load
 skip-if(B2G||Mulet) HTTP(..) == src-list-actual-font-ref.html src-list-data-1.html # bug 773482 # Initial mulet triage: parity with B2G/B2G Desktop
 
 # localized full fontnames should *not* match, only English ones (need locale-invariant key)
 skip HTTP(..) == src-list-local-localized.html src-list-local-localized-ref.html # 486787, 486497
 
-# postscript name lookup
-# fontconfig only supports postscript name lookup from 2.10.92, Android/B2G not supported
-skip-if(B2G||Mulet) fails-if(Android) random-if(gtk2Widget) == src-list-local-ps.html src-list-local-full-ref.html # bug 773482
+# Postscript name lookup only supported on MacOS/Windows currently
+skip-if(B2G||Mulet) fails-if(Android) random-if(gtk2Widget) == src-list-local-ps.html src-list-local-full-ref.html # bug 773482 # Initial mulet triage: parity with B2G/B2G Desktop
 # Mac-specific test of 100 weight faces
 random-if(!cocoaWidget) == helveticaneue-ultra.html helveticaneue-ultra-ref.html
 
 HTTP(..) == order-1.html order-1-ref.html
-pref(layout.css.unicode-range.enabled,true) HTTP(..) == order-2.html order-2-ref.html
-pref(layout.css.unicode-range.enabled,true) HTTP(..) == order-3.html order-3-ref.html
+pref(layout.css.unicode-range.enabled,true) random-if(gtk2Widget) HTTP(..) == order-2.html order-2-ref.html # bug 1056479
+pref(layout.css.unicode-range.enabled,true) random-if(gtk2Widget) HTTP(..) == order-3.html order-3-ref.html # bug 1056479
 HTTP(..) == multiple-in-family-1.html multiple-in-family-1-ref.html
 HTTP(..) == multiple-in-family-1b.html multiple-in-family-1-ref.html
 HTTP(..) != multiple-in-family-1.html multiple-in-family-1-notref.html
 HTTP(..) == prop-order-over-rule-order-1a.html prop-order-over-rule-order-2a.html
 HTTP(..) == prop-order-over-rule-order-1b.html prop-order-over-rule-order-2b.html
 HTTP(..) != prop-order-over-rule-order-1a.html prop-order-over-rule-order-1b.html
 skip-if(B2G||Mulet) HTTP(..) == cross-iframe-1.html cross-iframe-1-ref.html # bug 773482 # Initial mulet triage: parity with B2G/B2G Desktop
 
-# unicode-range
-pref(layout.css.unicode-range.enabled,true) HTTP(..) == unicoderange-1.html unicoderange-1-ref.html
-pref(layout.css.unicode-range.enabled,true) HTTP(..) == unicoderange-2.html unicoderange-2-ref.html
-pref(layout.css.unicode-range.enabled,true) HTTP(..) == unicoderange-3.html unicoderange-3-ref.html
-pref(layout.css.unicode-range.enabled,true) HTTP(..) == unicoderange-4.html unicoderange-4-ref.html
+# unicode-range (Linux implementation - bug 1056479)
+pref(layout.css.unicode-range.enabled,true) random-if(gtk2Widget) HTTP(..) == unicoderange-1.html unicoderange-1-ref.html
+pref(layout.css.unicode-range.enabled,true) random-if(gtk2Widget) HTTP(..) == unicoderange-2.html unicoderange-2-ref.html
+pref(layout.css.unicode-range.enabled,true) random-if(gtk2Widget) HTTP(..) == unicoderange-3.html unicoderange-3-ref.html
+pref(layout.css.unicode-range.enabled,true) random-if(gtk2Widget) HTTP(..) == unicoderange-4.html unicoderange-4-ref.html
 
 # Dynamic changes
 # we need to skip these because of the bug that's causing order-2.html to fail
 HTTP(..) == enable-sheet-1.html enable-sheet-1-ref.html
 skip HTTP(..) == enable-sheet-2.html multiple-in-family-1-ref.html
 skip HTTP(..) == enable-sheet-3.html multiple-in-family-1-ref.html
 HTTP(..) == enable-sheet-4.html enable-sheet-4-ref.html
 HTTP(..) == enable-sheet-5.html enable-sheet-4-ref.html
--- a/layout/reftests/font-face/src-list-local-full-quotes.html
+++ b/layout/reftests/font-face/src-list-local-full-quotes.html
@@ -10,28 +10,28 @@ body {
   margin: 50px;
   font-size: 24pt;
 }
 
 /* use full names */
 
 @font-face {
   font-family: test-regular;
-  src: local("Helvetica Neue"), local("Bitstream Vera Sans"), local("Bitstream Vera Sans Roman"), local("FreeSans"), local("Free Sans"), local("SwissA"), local("DejaVu Sans"), local("Arial");
+  src: local("Helvetica Neue"), local("Bitstream Vera Sans"), local("Bitstream Vera Sans Roman"), local("Free Sans"), local("SwissA"), local("DejaVu Sans"), local("Arial");
 }
 
 /* use Helvetica on the Mac, since Futura has no bold face on 10.4, 10.5 */
 @font-face {
   font-family: test-bold;
-  src: local("Helvetica Neue Bold"), local("Bitstream Vera Sans Bold"), local("FreeSans Bold"), local("Free Sans Bold"), local("SwissA Bold"), local("DejaVu Sans Bold"), local("Arial Bold");
+  src: local("Helvetica Neue Bold"), local("Bitstream Vera Sans Bold"), local("Free Sans Bold"), local("SwissA Bold"), local("DejaVu Sans Bold"), local("Arial Bold");
 }
 
 @font-face {
   font-family: test-italic;
-  src: local("Helvetica Neue Italic"), local("Bitstream Vera Sans Oblique"), local("FreeSans Oblique"), local("Free Sans Oblique"), local("SwissA Italic"), local("DejaVu Sans Oblique"), local("Arial Italic");
+  src: local("Helvetica Neue Italic"), local("Bitstream Vera Sans Oblique"), local("Free Sans Oblique"), local("SwissA Italic"), local("DejaVu Sans Oblique"), local("Arial Italic");
 }
 
 .regular { font-family: test-regular, serif; }
 .bold { font-family: test-bold, serif; }
 .italic { font-family: test-italic, serif; }
 
 </style>
 
--- a/layout/reftests/font-face/src-list-local-full.html
+++ b/layout/reftests/font-face/src-list-local-full.html
@@ -10,28 +10,28 @@ body {
   margin: 50px;
   font-size: 24pt;
 }
 
 /* use full names */
 
 @font-face {
   font-family: test-regular;
-  src: local(Helvetica Neue), local(Bitstream Vera Sans), local(Bitstream Vera Sans Roman), local(FreeSans), local(Free Sans), local(SwissA), local(DejaVu Sans), local(Arial);
+  src: local(Helvetica Neue), local(Bitstream Vera Sans), local(Bitstream Vera Sans Roman), local(Free Sans), local(SwissA), local(DejaVu Sans), local(Arial);
 }
 
 /* use Helvetica on the Mac, since Futura has no bold face on 10.4, 10.5 */
 @font-face {
   font-family: test-bold;
-  src: local(Helvetica Neue Bold), local(Bitstream Vera Sans Bold), local(FreeSans Bold), local(Free Sans Bold), local(SwissA Bold), local(DejaVu Sans Bold), local(Arial Bold);
+  src: local(Helvetica Neue Bold), local(Bitstream Vera Sans Bold), local(Free Sans Bold), local(SwissA Bold), local(DejaVu Sans Bold), local(Arial Bold);
 }
 
 @font-face {
   font-family: test-italic;
-  src: local(Helvetica Neue Italic), local(Bitstream Vera Sans Oblique), local(FreeSans Oblique), local(Free Sans Oblique), local(SwissA Italic), local(DejaVu Sans Oblique), local(Arial Italic);
+  src: local(Helvetica Neue Italic), local(Bitstream Vera Sans Oblique), local(Free Sans Oblique), local(SwissA Italic), local(DejaVu Sans Oblique), local(Arial Italic);
 }
 
 .regular { font-family: test-regular, serif; }
 .bold { font-family: test-bold, serif; }
 .italic { font-family: test-italic, serif; }
 
 </style>
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3603,28 +3603,16 @@ pref("ui.panel.default_level_parent", tr
 pref("mousewheel.system_scroll_override_on_root_content.enabled", false);
 
 #if MOZ_WIDGET_GTK == 2
 pref("intl.ime.use_simple_context_on_password_field", true);
 #else
 pref("intl.ime.use_simple_context_on_password_field", false);
 #endif
 
-# enable new platform fontlist for linux on GTK platforms
-# temporary pref to allow flipping back to the existing
-# gfxPangoFontGroup/gfxFontconfigUtils code for handling system fonts
-
-#ifdef MOZ_WIDGET_GTK
-#ifdef RELEASE_BUILD
-pref("gfx.font_rendering.fontconfig.fontlist.enabled", false);
-#else
-pref("gfx.font_rendering.fontconfig.fontlist.enabled", true);
-#endif
-#endif
-
 # XP_UNIX
 #endif
 #endif
 #endif
 
 #if defined(ANDROID) || defined(MOZ_B2G)
 
 pref("font.size.fixed.ar", 12);