Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it necessary to provide a fallback font for a web font face?

We are using some web fonts on our site, e.g.

<link href="http://fonts.googleapis.com/css?family=Anton" 
    rel="stylesheet" type="text/css">

Due to a bug in IE8 that I have no desire to workaround in other ways, I'd like to recommend to our site authors that they not provide a fallback font when specifying web fonts. For example, instead of:

font-family: 'Anton', "Arial Black", sans-serif;

..do...

font-family: 'Anton';

Is there a real-world scenario where this could cause problems, i.e. why would I need to provide a fallback for a font that I am providing?

like image 576
Steve Campbell Avatar asked Aug 21 '12 13:08

Steve Campbell


3 Answers

If the Google 'font server' is down, unreachable or otherwise, the browser would fall back to it's default font, I think. So in that case, it might be handy to have a fallback font defined yourself.

like image 169
Dirk McQuickly Avatar answered Nov 23 '22 11:11

Dirk McQuickly


To not use a fallback would mean that you have perfect faith in the following:

  • that your site will always be loaded with a good internet connection
  • the external font asset will always be perfectly available at the location you request it at
  • that if your font doesn't load, the affected text in the site will look absolutely fine, without the font

If you disagree with any of those, then yes, you should have a fallback font, which is designed to be a fallback, in case your original choice is unvailable.

like image 43
Kristian Avatar answered Nov 23 '22 11:11

Kristian


Its always a good idea to at least provide ONE fallback: serif or sans-serif. This font will display in case the @font-face request fails, or takes too long to load.

Additionally, you can achieve fine-grained control over how your website loads by using the google font loader.

https://developers.google.com/webfonts/docs/webfont_loader

like image 27
Kostia Avatar answered Nov 23 '22 11:11

Kostia