New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 771070 link

Starred by 2 users

Issue metadata

Status: Closed
Owner: ----
Closed: Oct 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Feature



Sign in to add a comment

System font loading in Chrome should be asynchronous

Project Member Reported by tapted@chromium.org, Oct 3 2017

Issue description

Chrome Version       : 63.0.3218.0
OS Version: OS X 10.12.6

Deriving a new font (e.g. 1pt larger, bold, italic, etc.), or loading a new font by name typically requires some kind of IPC with a Font Server process. This IPC is usually transparent to the API (i.e. it is synchronous/blocking).

That sucks for Chrome's speed, for UI responsiveness, and for Chrome startup.


macOS 10.13 introduce an asynchronous Foundation API for their font server -- NSFontAssetRequest (search https://developer.apple.com/library/content/releasenotes/AppKit/RN-AppKit/index.html#NSFontAssetRequest ).

There is also a low-level API -- CTFontDescriptorMatchFontDescriptorsWithProgressHandler available since 10.9, so all macOS versions that Chrome currently supports can take advantage of this. https://developer.apple.com/documentation/coretext/1511433-ctfontdescriptormatchfontdescrip?language=objc


Something similar probably exists for other OSes.
 
Hmm. except CTFontDescriptorMatchFontDescriptorsWithProgressHandler is for downloading fonts from the web.. https://developer.apple.com/library/content/documentation/StringsTextFonts/Conceptual/CoreText_Programming/Overview/Overview.html says "Downloading fonts on demand is unnecessary in OS X because all available fonts are installed with the system." (so... Why did Apple add it to AppKit at all?)

in any case, -[NSFontManager convert{Font,Weight} to{Size,HaveTrait}] are undeniably slow on Mac and turn up all the time in profiler/samples - there may be some latency gains either by using this API, or doing some kind of background-thread-warmup of NSFont objects.
Project Member

Comment 2 by sheriffbot@chromium.org, Oct 3

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Closed (was: Untriaged)
#icebox

Sign in to add a comment