Bug 148218 - [OS X] Remove dead code from FontCache::systemFallbackForCharacters()
Summary: [OS X] Remove dead code from FontCache::systemFallbackForCharacters()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-20 01:45 PDT by Myles C. Maxfield
Modified: 2015-08-21 16:50 PDT (History)
1 user (show)

See Also:


Attachments
Patch (2.36 KB, patch)
2015-08-20 01:47 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (3.38 KB, patch)
2015-08-20 19:45 PDT, Myles C. Maxfield
dbates: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>