Summary: | [Font Features] TrueType fonts trigger real features even when synthesis is applied | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Myles C. Maxfield <mmaxfield> | ||||||
Component: | New Bugs | Assignee: | Myles C. Maxfield <mmaxfield> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | dino, jonlee, koivisto, simon.fraser, thorton, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 149779 | ||||||||
Attachments: |
|
Description
Myles C. Maxfield
2015-12-14 19:08:37 PST
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> *** Bug 152109 has been marked as a duplicate of this bug. *** |