⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 188802 in webkit


Ignore:
Timestamp:
Aug 21, 2015, 4:50:21 PM (11 years ago)
Author:
mmaxfield@apple.com
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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r188799 r188802  
     12015-08-21  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [OS X] Remove dead code from FontCache::systemFallbackForCharacters()
     4        https://bugs.webkit.org/show_bug.cgi?id=148218
     5
     6        Reviewed by Daniel Bates.
     7
     8        lookupCTFont() in FontCacheMac.mm will always return the best font (because
     9        CTFontCreateForCharactersWithLanguage() does so). Also, all fonts that will
     10        be created on WebKit's behalf are already printer fonts.
     11
     12        No new tests because there is no behavior change.
     13
     14        * platform/graphics/mac/FontCacheMac.mm:
     15        (WebCore::FontCache::systemFallbackForCharacters): Deleted.
     16
    1172015-08-21  Anders Carlsson  <andersca@apple.com>
    218
  • trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm

    r188795 r188802  
    519519    NSFont *substituteFont = toNSFont(fallbackDedupSet().add(result).iterator->get());
    520520
    521     // Use the family name from the AppKit-supplied substitute font, requesting the
    522     // traits, weight, and size we want. One way this does better than the original
    523     // AppKit request is that it takes synthetic bold and oblique into account.
    524     // But it does create the possibility that we could end up with a font that
    525     // doesn't actually cover the characters we need.
    526 
    527521    NSFontManager *fontManager = [NSFontManager sharedFontManager];
    528522
    529523    NSFontTraitMask traits = 0;
    530524    NSInteger weight;
    531     CGFloat size;
    532525
    533526    if (nsFont) {
    … …  
    539532            traits |= NSFontItalicTrait;
    540533        weight = [fontManager weightOfFont:nsFont];
    541         size = [nsFont pointSize];
    542534    } else {
    543         // For custom fonts nsFont is nil.
     535        ASSERT(!CORETEXT_WEB_FONTS);
    544536        traits = description.italic() ? NSFontItalicTrait : 0;
    545537        weight = toAppKitFontWeight(description.weight());
    546         size = description.computedPixelSize();
    547538    }
    548539
    549540    NSFontTraitMask substituteFontTraits = [fontManager traitsOfFont:substituteFont];
    550541    NSInteger substituteFontWeight = [fontManager weightOfFont:substituteFont];
    551 
    552     if (traits != substituteFontTraits || weight != substituteFontWeight || !nsFont) {
    553         if (NSFont *bestVariation = [fontManager fontWithFamily:[substituteFont familyName] traits:traits weight:weight size:size]) {
    554             UChar32 character;
    555             U16_GET(characters, 0, 0, length, character);
    556             if (!nsFont || (([fontManager traitsOfFont:bestVariation] != substituteFontTraits || [fontManager weightOfFont:bestVariation] != substituteFontWeight)
    557                 && [[bestVariation coveredCharacterSet] longCharacterIsMember:character]))
    558                 substituteFont = bestVariation;
    559         }
    560     }
    561 
    562     substituteFont = [substituteFont printerFont];
    563 
    564     substituteFontTraits = [fontManager traitsOfFont:substituteFont];
    565     substituteFontWeight = [fontManager weightOfFont:substituteFont];
    566542
    567543    FontPlatformData alternateFont(toCTFont(substituteFont), platformData.size(),
Note: See TracChangeset for help on using the changeset viewer.