While designing this site’s preferences system, I encountered a problem related to the loading of the site’s themes. To wit:
The solution, I found, is to load the fonts asynchronously using the HTML5
The script Typekit tells you to install on your website is something like this:
The trick to load them asynchronously is to replace this with:
YOUR-KIT-ID, obviously, with your Kit’s ID. This way, jQuery’s
$(document).ready will fire before the fonts are loaded, ready to apply the styles before the page appears on-screen.
Using this will result in the fonts being loaded in Internet Explorer 10, Safari 5, Chrome 11, or Firefox 3.6 or later. On earlier browsers, the fonts will be loaded in the normal, synchronous manner — the magic of backwards-compatibility and graceful degradation.
Precisely 14 people will be interested in this.