Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy-load fonts as needed #765

Open
bcamper opened this issue Jul 26, 2020 · 0 comments
Open

Lazy-load fonts as needed #765

bcamper opened this issue Jul 26, 2020 · 0 comments

Comments

@bcamper
Copy link
Member

bcamper commented Jul 26, 2020

Currently, all fonts in the scene are parsed and loaded when the scene is initially loaded. And there is a blocking effect because all fonts must be loaded before any text labels are rendered on the main thread (but the font loading process starts in parallel with the rest of the scene build process, so the actual blocking time depends on when the first label render request is made from a tile).

Instead, we should lazily load each font definition the first time it is need for label rendering. This requires doing some extra parsing/"matching" logic from font parameters in the draw group, back to the appropriate font face definition in the scene fonts block (and if no matching font is found, assume it's a built-in one).

This could also be used to address the Chrome bug with italics and variable fonts mentioned in #757, by issuing an explicit font load request for each new weight (which should resolve immediately, but needs to be verified).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant