Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Page doesn't display font until Google Font API's requests are returned

Every time I refresh the page I have to wait for a bunch of requests to return before I actually see the fonts appear. The fonts are cached and all these requests return a "Not Modified" header. Is it proper browser behavior to not display the font until it is made certain that the font hasn't been modified? Am I missing something?

I understand that I can use a generic fallback font until the proper fonts are loaded, but this will break my page.

I'm seeing this behavior in Chrome and Firefox, both on Ubuntu. My internet is really patchy, so sometimes I have to stare at a fully loaded page with invisible text, it's really frustrating.

like image 592
Alexei Boronine Avatar asked Nov 13 '22 08:11

Alexei Boronine


1 Answers

You should always use a fall-back font, and design your page such that it will not break the page. Sometimes the Google font service may be unavailable; other times, your users could be behind firewalls that prevent downloading the fonts. And, as you've seen, your fonts won't display immediately until the browser is satisfied that the fonts have been downloaded properly.

like image 103
saluce Avatar answered Dec 28 '22 10:12

saluce