[Webkit-unassigned] [Bug 180979] Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 2 17:22:26 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=180979

--- Comment #18 from Joseph Pecoraro <joepeck at webkit.org> ---
(In reply to Devin Rousso from comment #14)
> Comment on attachment 330339 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=330339&action=review
> 
> > Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:747
> > +        // We don't want to make the hidden system fonts visible and since they
> > +        // all begin with a period, ignore all fonts that begin with a period.
> > +        if (CFStringHasPrefix(fontName, CFSTR(".")))
> 
> It appears that there is already a static function `fontIsSystemFont`, but
> it expects a `CTFontRef`.  Perhaps you can overload it with a version for
> `CFStringRef` and use it here instead of duplicating that logic.

Great idea. I added:

    static inline bool fontNameIsSystemFont(CFStringRef fontName)
    {
        return CFStringGetLength(fontName) > 0 && CFStringGetCharacterAtIndex(fontName, 0) == '.';
    }

And used it where appropriate.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180103/5594b070/attachment-0001.html>


More information about the webkit-unassigned mailing list