Bug 148218

Summary: [OS X] Remove dead code from FontCache::systemFallbackForCharacters()
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: New BugsAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: dbates
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch dbates: review+

Description Myles C. Maxfield 2015-08-20 01:45:36 PDT
[OS X] Remove dead code from FontCache::systemFallbackForCharacters()
Comment 1 Myles C. Maxfield 2015-08-20 01:47:19 PDT
Created attachment 259460 [details]
Patch
Comment 2 Myles C. Maxfield 2015-08-20 01:55:14 PDT
Comment on attachment 259460 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259460&action=review

> Source/WebCore/platform/graphics/mac/FontCacheMac.mm:-565
> -        if (NSFont *bestVariation = [fontManager fontWithFamily:[substituteFont familyName] traits:traits weight:weight size:size]) {

No need for the "size" variable
Comment 3 Myles C. Maxfield 2015-08-20 19:45:03 PDT
Created attachment 259567 [details]
Patch
Comment 4 Daniel Bates 2015-08-21 11:17:57 PDT
Comment on attachment 259567 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259567&action=review

> Source/WebCore/ChangeLog:8
> +        CTFontCreateForCharactersWithLanguage() will always return the best

For your consideration, I suggest writing this sentence in terms of FontCache::lookupCTFont() (which calls CTFontCreateForCharactersWithLanguage() at the time of writing) instead of CTFontCreateForCharactersWithLanguage() since FontCache::systemFallbackForCharacters() does not explicitly call CTFontCreateForCharactersWithLanguage().

> Source/WebCore/ChangeLog:10
> +        font. Also, all fonts that will be created on WebKit's behalf are
> +        already printer fonts.

You may want to consider adding a comment to the code to explain that FontCache::lookupCTFont()/CTFontCreateForCharactersWithLanguage() will return a printer-friendly font.

> Source/WebCore/platform/graphics/mac/FontCacheMac.mm:-543
> -    CGFloat size;

With the removal of this size variable and associated logic the comment above fontManager is now out-of-date. Please update the comment above fontManager.
Comment 5 Myles C. Maxfield 2015-08-21 16:43:08 PDT
Comment on attachment 259567 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259567&action=review

>> Source/WebCore/ChangeLog:10
>> +        already printer fonts.
> 
> You may want to consider adding a comment to the code to explain that FontCache::lookupCTFont()/CTFontCreateForCharactersWithLanguage() will return a printer-friendly font.

Going forward, the concept of a "printer font" will become less and less relevant. I don't think it's worth paying it any more lip service.
Comment 6 Myles C. Maxfield 2015-08-21 16:50:40 PDT
Committed r188802: <http://trac.webkit.org/changeset/188802>