[Font Features] TrueType fonts trigger real features even when synthesis is applied
Created attachment 267334 [details] Patch
Created attachment 267344 [details] Patch
Comment on attachment 267344 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=267344&action=review > Source/WebCore/platform/graphics/cocoa/FontCocoa.mm:481 > + if (!CFDictionaryContainsKey(featureType, kCTFontFeatureTypeIdentifierKey)) > + continue; > + int rawFeatureKey; > + CFNumberRef featureKey = static_cast<CFNumberRef>(CFDictionaryGetValue(featureType, kCTFontFeatureTypeIdentifierKey)); Should check for null instead of calling CFDictionaryContainsKey and then CFDictionaryGetValue. More efficient: saves one hash table lookup. > Source/WebCore/platform/graphics/cocoa/FontCocoa.mm:487 > + CFArrayRef featureSelectors = static_cast<CFArrayRef>(CFDictionaryGetValue(featureType, kCTFontFeatureTypeSelectorsKey)); > + CFIndex selectorsCount = CFArrayGetCount(featureSelectors); Do we have a guarantee this won’t be null? > Source/WebCore/platform/graphics/cocoa/FontCocoa.mm:493 > + if (!CFDictionaryContainsKey(featureSelector, kCTFontFeatureSelectorDefaultKey)) > + continue; > + int rawIsDefault; > + CFNumberRef isDefault = static_cast<CFNumberRef>(CFDictionaryGetValue(featureSelector, kCTFontFeatureSelectorDefaultKey)); Should check for null instead of calling CFDictionaryContainsKey and then CFDictionaryGetValue. More efficient: saves one hash table lookup.
Committed r194114: <http://trac.webkit.org/changeset/194114>
rdar://problem/23957523
*** Bug 152109 has been marked as a duplicate of this bug. ***