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

Custom fonts + variable fonts #4

Closed
bdon opened this issue Apr 10, 2021 · 2 comments
Closed

Custom fonts + variable fonts #4

bdon opened this issue Apr 10, 2021 · 2 comments

Comments

@bdon
Copy link
Member

bdon commented Apr 10, 2021

Helper for FontFace API to block drawing until font is loaded

@bdon
Copy link
Member Author

bdon commented Apr 22, 2021

The simplest implementation I can think of is an array of Tasks that is awaited on via Promise.all before every Paint execution.

A task is a promise that resolves when the object is ready to use: A font is loaded into the document, a protosprites sheet has been baked into a canvas, etc.

TODO: figure out what to do when tasks fail/reject. A font or sprite sheet failing to load shouldn't blow up the entire map, or should it?

@bdon
Copy link
Member Author

bdon commented May 12, 2021

Map loading will still succeed if individual tasks ,like fonts or sprites, fail to load; how those are handled in failure case is up to the specific task

@bdon bdon closed this as completed May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant