You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Try to avoid hitting the platform font list for simple fonts #1677
Obtaining the list of platform fonts is incredibly performance-sensitive. We have a gfxPlatformFontList object for this, which caches the font list indefinitely. When the system notifies us of a font list change, we rebuild our font list from scratch, but that's very rare of course. The tricky part is how to build this list without slowing down startup. The key thing is that we don't always need the list. We can look up simple fonts by family name without having a complete list of the platform fonts, and for each language we have a list of default font names that have a good chance of supporting the characters of that language; all that means we can render many pages without needing the platform font list. So, we build it incrementally after startup, off the main thread (as of recently, thanks to jdaggett).
Funnily enough, this is how Servo has worked for years. What we don't have is the ability to look through the platform list for a font that contains a given character. This would allow us to stop relying on the list of default font names once the list of system fonts has loaded in the background. In addition, it would be good to support two more types of fallback:
Ask the system font selection API how to render a character or to find a font with a character.
Activity
mrobinson commentedon May 18, 2024
Funnily enough, this is how Servo has worked for years. What we don't have is the ability to look through the platform list for a font that contains a given character. This would allow us to stop relying on the list of default font names once the list of system fonts has loaded in the background. In addition, it would be good to support two more types of fallback: