FontCache should only deal with SimpleFontData
[WebKit-https.git] / Source / WebCore / platform / graphics / FontCache.cpp
index d578c80..e1fc78a 100644 (file)
@@ -490,48 +490,6 @@ size_t FontCache::inactiveFontDataCount()
     return count;
 }
 
-RefPtr<FontData> FontCache::fontForFamilyAtIndex(const FontDescription& description, int& familyIndex, FontSelector* fontSelector)
-{
-    ASSERT(familyIndex != cAllFamiliesScanned);
-    RefPtr<FontData> result;
-
-    bool isFirst = !familyIndex;
-    int familyCount = description.familyCount();
-    for (;familyIndex < familyCount && !result; ++familyIndex) {
-        const AtomicString& family = description.familyAt(familyIndex);
-        if (family.isEmpty())
-            continue;
-        if (fontSelector)
-            result = fontSelector->getFontData(description, family);
-        if (!result)
-            result = fontForFamily(description, family);
-    }
-    if (familyIndex == familyCount)
-        familyIndex = cAllFamiliesScanned;
-
-#if PLATFORM(COCOA)
-    if (!result) {
-        // We didn't find a font. Try to find a similar font using our own specific knowledge about our platform.
-        // For example on OS X, we know to map any families containing the words Arabic, Pashto, or Urdu to the
-        // Geeza Pro font.
-        result = similarFontPlatformData(description);
-    }
-#endif
-
-    if (!result && isFirst) {
-        // If it's the primary font that we couldn't find, we try the following. In all other cases, we will
-        // just use per-character system fallback.
-        if (fontSelector) {
-            // Try the user's preferred standard font.
-            if (RefPtr<FontData> data = fontSelector->getFontData(description, standardFamily))
-                return data.release();
-        }
-        // Still no result.  Hand back our last resort fallback font.
-        result = lastResortFallbackFont(description);
-    }
-    return result.release();
-}
-
 static HashSet<FontSelector*>* gClients;
 
 void FontCache::addClient(FontSelector* client)
@@ -581,4 +539,11 @@ void FontCache::invalidate()
     purgeInactiveFontData();
 }
 
+#if !PLATFORM(COCOA)
+RefPtr<SimpleFontData> FontCache::similarFontPlatformData(const FontDescription&)
+{
+    return nullptr;
+}
+#endif
+
 } // namespace WebCore