Title: [188802] trunk/Source/WebCore
Revision
188802
Author
mmaxfi...@apple.com
Date
2015-08-21 16:50:21 -0700 (Fri, 21 Aug 2015)

Log Message

[OS X] Remove dead code from FontCache::systemFallbackForCharacters()
https://bugs.webkit.org/show_bug.cgi?id=148218

Reviewed by Daniel Bates.

lookupCTFont() in FontCacheMac.mm will always return the best font (because
CTFontCreateForCharactersWithLanguage() does so). Also, all fonts that will
be created on WebKit's behalf are already printer fonts.

No new tests because there is no behavior change.

* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::systemFallbackForCharacters): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (188801 => 188802)


--- trunk/Source/WebCore/ChangeLog	2015-08-21 23:48:52 UTC (rev 188801)
+++ trunk/Source/WebCore/ChangeLog	2015-08-21 23:50:21 UTC (rev 188802)
@@ -1,3 +1,19 @@
+2015-08-21  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [OS X] Remove dead code from FontCache::systemFallbackForCharacters()
+        https://bugs.webkit.org/show_bug.cgi?id=148218
+
+        Reviewed by Daniel Bates.
+
+        lookupCTFont() in FontCacheMac.mm will always return the best font (because
+        CTFontCreateForCharactersWithLanguage() does so). Also, all fonts that will
+        be created on WebKit's behalf are already printer fonts.
+
+        No new tests because there is no behavior change.
+
+        * platform/graphics/mac/FontCacheMac.mm:
+        (WebCore::FontCache::systemFallbackForCharacters): Deleted.
+
 2015-08-21  Anders Carlsson  <ander...@apple.com>
 
         Fix build.

Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (188801 => 188802)


--- trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2015-08-21 23:48:52 UTC (rev 188801)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2015-08-21 23:50:21 UTC (rev 188802)
@@ -518,17 +518,10 @@
     // font pointer.
     NSFont *substituteFont = toNSFont(fallbackDedupSet().add(result).iterator->get());
 
-    // Use the family name from the AppKit-supplied substitute font, requesting the
-    // traits, weight, and size we want. One way this does better than the original
-    // AppKit request is that it takes synthetic bold and oblique into account.
-    // But it does create the possibility that we could end up with a font that
-    // doesn't actually cover the characters we need.
-
     NSFontManager *fontManager = [NSFontManager sharedFontManager];
 
     NSFontTraitMask traits = 0;
     NSInteger weight;
-    CGFloat size;
 
     if (nsFont) {
         if (description.italic())
@@ -538,32 +531,15 @@
         if (platformData.m_syntheticOblique)
             traits |= NSFontItalicTrait;
         weight = [fontManager weightOfFont:nsFont];
-        size = [nsFont pointSize];
     } else {
-        // For custom fonts nsFont is nil.
+        ASSERT(!CORETEXT_WEB_FONTS);
         traits = description.italic() ? NSFontItalicTrait : 0;
         weight = toAppKitFontWeight(description.weight());
-        size = description.computedPixelSize();
     }
 
     NSFontTraitMask substituteFontTraits = [fontManager traitsOfFont:substituteFont];
     NSInteger substituteFontWeight = [fontManager weightOfFont:substituteFont];
 
-    if (traits != substituteFontTraits || weight != substituteFontWeight || !nsFont) {
-        if (NSFont *bestVariation = [fontManager fontWithFamily:[substituteFont familyName] traits:traits weight:weight size:size]) {
-            UChar32 character;
-            U16_GET(characters, 0, 0, length, character);
-            if (!nsFont || (([fontManager traitsOfFont:bestVariation] != substituteFontTraits || [fontManager weightOfFont:bestVariation] != substituteFontWeight)
-                && [[bestVariation coveredCharacterSet] longCharacterIsMember:character]))
-                substituteFont = bestVariation;
-        }
-    }
-
-    substituteFont = [substituteFont printerFont];
-
-    substituteFontTraits = [fontManager traitsOfFont:substituteFont];
-    substituteFontWeight = [fontManager weightOfFont:substituteFont];
-
     FontPlatformData alternateFont(toCTFont(substituteFont), platformData.size(),
         !isPlatformFont && isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(substituteFontWeight),
         !isPlatformFont && (traits & NSFontItalicTrait) && !(substituteFontTraits & NSFontItalicTrait),
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to