-
Notifications
You must be signed in to change notification settings - Fork 645
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
Long delay for active to be called when using custom fonts #421
Comments
Quick update here, if I use a |
@mobileben could you provide any code with exmaple please ? |
Sorry for the delay, let me get one together ... |
@Szymon-dziewonski apologies for the delay. Here is a code example. Please let me know if you have any questions. |
@Szymon-dziewonski just wanted to check in to see if you had a chance to look at this. Thanks! |
Hey @mobileben sorry, I checked it, but then I switched to native preload, precatch with loading font with
and using
It's working much faster. Now loading fonts as handle by browser which is fast than doing it in JS and then you can just observe it via package. Anyway thank you very much for you time for sharing your code, appreciate that ! |
Yess this is a very irritating thing. If I do it the normal way and let my webpage suffer the FOUT, then that flash lives for just a split second, but if I wait for the active function to kick in, it takes like 4-5 seconds. This is such a big difference. |
I have locally defined fonts, which I'm loading as
custom
fonts. These are actually Google fonts, however I have them local. The primary reason for this is because this will be a Cordova app, so I don't want to have to hit the external network if I can avoid it.I declare these custom fonts with
font-face
.Code-wise, I load it via:
You can see I have some debug on when loading occurs and when a font is active. I did have some debug logging in active, but I've removed it from this code snippet.
What I find is that when
custom
is not used, it loads quickly. However, whencustom
is used, it's very slow to load even though I see the loading message and active message for the font. There is a clear 1-2+ second delay before the actual active is being called.Visually I see a white screen for 1-2+ seconds. Then the game starts.
The text was updated successfully, but these errors were encountered: