Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are @font-face embedded fonts always the last things to download?

I'm using @font-face for the first time, and it seems like the font file is always the last resource to load on the page, no matter what. I'm using a Font Squirrel-generated kit with the smiley syntax. I've tried some of the techniques suggested here, among other places, to get the font to download earlier, including putting the font directly as data in the CSS and putting a styled element in the head section of the document. None of these techniques are working; in Chrome, FF, and IE the font file is always downloaded very last.

Is there any to affect the order in which the font loads?

There is a related question here, but it just links to the same Paul Irish post I mentioned.

like image 286
alexp Avatar asked Aug 02 '11 15:08

alexp


1 Answers

Font loading differs from browser to browser (i guess you're reffering to FOUC).

I think the only browser that loads it as fast as it reads the @font-face rule is IE and Opera.

EDIT with samples:

Here are some net load lists for a simple site:

  • font-family is called last in .css file - after all background images
  • font being loaded is scriptbl-webfont
  • @font-face is defined at top of css after the reset styles.

FF5 - font loads last: enter image description here

IE9 - font loads on @font-face - and before background images: enter image description here

Opera 11 - font loads @font-face - and before background images: enter image description here

Safari 5 - font loads last (there is no favicon in my folder - Safari adds that by itself): enter image description here

like image 170
easwee Avatar answered Nov 15 '22 05:11

easwee