-
Notifications
You must be signed in to change notification settings - Fork 66
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
Callback on font download #17
Comments
The font picker adds fonts to the document using Instead, you could use |
You need to install FontFaceObserver in your project.
Then in your code wherever you are loading your font, you can wait till the font is loaded as var font = new FontFaceObserver('My Family', { font.load().then(function () { |
Thanks alot! Seems to be working now for the most part. Still throws the error after remounting the component whilst the fonts are already loaded from the previous mount (if that makes sense). |
I'm using this wonderful font picker to change the font of a canvas element. Unfortunately, the font change is triggered as soon as I pick a new font, therefore, even if it is not completely downloaded, it will be partially applied to my canvas element. (like, half the letters will have the correct font, the other ones will have a fallback browser font).
Is there a way to make sure the font is completely downloaded before using it for anything else ?
The text was updated successfully, but these errors were encountered: