RESOLVED FIXED Bug 152287
[Font Features] TrueType fonts trigger real features even when synthesis is applied
https://bugs.webkit.org/show_bug.cgi?id=152287
Summary [Font Features] TrueType fonts trigger real features even when synthesis is a...
Myles C. Maxfield
Reported 2015-12-14 19:08:37 PST
[Font Features] TrueType fonts trigger real features even when synthesis is applied
Attachments
Patch (25.61 KB, patch)
2015-12-14 19:11 PST, Myles C. Maxfield
no flags
Patch (43.65 KB, patch)
2015-12-14 21:43 PST, Myles C. Maxfield
darin: review+
Myles C. Maxfield
Comment 1 2015-12-14 19:11:30 PST
Myles C. Maxfield
Comment 2 2015-12-14 21:43:40 PST
Darin Adler
Comment 3 2015-12-14 22:01:48 PST
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.
Myles C. Maxfield
Comment 4 2015-12-15 13:56:08 PST
Jon Lee
Comment 5 2015-12-18 11:04:00 PST
Myles C. Maxfield
Comment 6 2016-01-13 15:04:24 PST
*** Bug 152109 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.