Changeset 216342 in webkit
- Timestamp:
- May 6, 2017 10:43:29 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r216341 r216342 1 2017-05-06 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive 4 https://bugs.webkit.org/show_bug.cgi?id=171636 5 <rdar://problem/30811218> 6 7 Reviewed by Dean Jackson. 8 9 * fast/text/lastResort-expected.html: Added. 10 * fast/text/lastResort.html: Added. 11 1 12 2017-05-06 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r216341 r216342 1 2017-05-06 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive 4 https://bugs.webkit.org/show_bug.cgi?id=171636 5 <rdar://problem/30811218> 6 7 Reviewed by Dean Jackson. 8 9 LastResort is the only name which needs to be looked up case-sensitively. We can handle 10 this in our existing function which handles special font names (like -apple-system) to 11 make sure that we always do the right thing. 12 13 Test: fast/text/lastResort.html 14 15 * platform/graphics/ios/FontCacheIOS.mm: 16 (WebCore::platformFontWithFamilySpecialCase): 17 * platform/graphics/mac/FontCacheMac.mm: 18 (WebCore::platformFontWithFamilySpecialCase): 19 * platform/spi/cocoa/CoreTextSPI.h: 20 1 21 2017-05-06 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
r216278 r216342 34 34 #import "FontCascade.h" 35 35 #import "RenderThemeIOS.h" 36 #import "SoftLinking.h" 36 37 #import <wtf/HashSet.h> 37 38 #import <wtf/NeverDestroyed.h> 38 39 #import <wtf/RetainPtr.h> 39 40 #import <wtf/text/CString.h> 41 42 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 43 SOFT_LINK_FRAMEWORK(CoreText); 44 SOFT_LINK_MAY_FAIL(CoreText, CTFontDescriptorCreateLastResort, CTFontDescriptorRef, (), ()); 45 #endif 40 46 41 47 namespace WebCore { … … 165 171 } 166 172 173 if (equalLettersIgnoringASCIICase(family, "lastresort")) { 174 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 175 if (canLoadCTFontDescriptorCreateLastResort()) { 176 static NeverDestroyed<RetainPtr<CTFontDescriptorRef>> lastResort = adoptCF(CTFontDescriptorCreateLastResort()); 177 return adoptCF(CTFontCreateWithFontDescriptor(lastResort.get().get(), size, nullptr)); 178 } 179 #endif 180 // LastResort is special, so it's important to look this exact string up, and not some case-folded version. 181 // We handle this here so any caching and case folding we do in our general text codepath is bypassed. 182 return adoptCF(CTFontCreateWithName(CFSTR("LastResort"), size, nullptr)); 183 } 184 167 185 return nullptr; 168 186 } -
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm
r216278 r216342 47 47 #import <wtf/Threading.h> 48 48 #import <wtf/text/AtomicStringHash.h> 49 #endif 50 51 #import "SoftLinking.h" 52 53 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 54 SOFT_LINK_FRAMEWORK(CoreText); 55 SOFT_LINK_MAY_FAIL(CoreText, CTFontDescriptorCreateLastResort, CTFontDescriptorRef, (), ()); 49 56 #endif 50 57 … … 112 119 return toCTFont([NSFont labelFontOfSize:size]); 113 120 121 if (equalLettersIgnoringASCIICase(family, "lastresort")) { 122 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 123 if (canLoadCTFontDescriptorCreateLastResort()) { 124 static NeverDestroyed<RetainPtr<CTFontDescriptorRef>> lastResort = adoptCF(CTFontDescriptorCreateLastResort()); 125 return adoptCF(CTFontCreateWithFontDescriptor(lastResort.get().get(), size, nullptr)); 126 } 127 #endif 128 // LastResort is special, so it's important to look this exact string up, and not some case-folded version. 129 // We handle this here so any caching and case folding we do in our general text codepath is bypassed. 130 return adoptCF(CTFontCreateWithName(CFSTR("LastResort"), size, nullptr)); 131 } 132 114 133 return nullptr; 115 134 } -
trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h
r216278 r216342 84 84 85 85 CTFontDescriptorRef CTFontDescriptorCreateWithAttributesAndOptions(CFDictionaryRef attributes, CTFontDescriptorOptions); 86 CTFontDescriptorRef CTFontDescriptorCreateLastResort(); 86 87 87 88 extern const CFStringRef kCTFontCSSWeightAttribute;
Note: See TracChangeset
for help on using the changeset viewer.