Skip to content

Instantly share code, notes, and snippets.

@hoangsetup
Created March 2, 2016 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoangsetup/57e7a90bc3008938cdb8 to your computer and use it in GitHub Desktop.
Save hoangsetup/57e7a90bc3008938cdb8 to your computer and use it in GitHub Desktop.
Optimizing web fonts with Font Load Events API
if(typeof FontFace === 'function') {
var font = new FontFace('FontAwesome', 'url('+ config.url_dashboard +'widget/fonts/fontawesome-webfont.woff?v=4.2.0)', {});
console.log('Time start FontFace: ' + (Date.now() - time_start) );
font.load().then(function() {
console.log(('Time done FontFace: ' + (Date.now() - time_start) );
});
}
@hoangsetup
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment