Changeset 188802 in webkit
- Timestamp:
- Aug 21, 2015, 4:50:21 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/mac/FontCacheMac.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r188799 r188802 1 2015-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 1 17 2015-08-21 Anders Carlsson <andersca@apple.com> 2 18 -
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm
r188795 r188802 519 519 NSFont *substituteFont = toNSFont(fallbackDedupSet().add(result).iterator->get()); 520 520 521 // Use the family name from the AppKit-supplied substitute font, requesting the522 // traits, weight, and size we want. One way this does better than the original523 // 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 that525 // doesn't actually cover the characters we need.526 527 521 NSFontManager *fontManager = [NSFontManager sharedFontManager]; 528 522 529 523 NSFontTraitMask traits = 0; 530 524 NSInteger weight; 531 CGFloat size;532 525 533 526 if (nsFont) { … … 539 532 traits |= NSFontItalicTrait; 540 533 weight = [fontManager weightOfFont:nsFont]; 541 size = [nsFont pointSize];542 534 } else { 543 // For custom fonts nsFont is nil.535 ASSERT(!CORETEXT_WEB_FONTS); 544 536 traits = description.italic() ? NSFontItalicTrait : 0; 545 537 weight = toAppKitFontWeight(description.weight()); 546 size = description.computedPixelSize();547 538 } 548 539 549 540 NSFontTraitMask substituteFontTraits = [fontManager traitsOfFont:substituteFont]; 550 541 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];566 542 567 543 FontPlatformData alternateFont(toCTFont(substituteFont), platformData.size(),
Note:
See TracChangeset
for help on using the changeset viewer.