Created
August 11, 2014 14:03
-
-
Save thomasmb/b67680a04ae75bc301b7 to your computer and use it in GitHub Desktop.
Google Webfonts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebFontConfig = { | |
google: { families: [ 'PT+Sans:400,400italic:latin', 'Ubuntu:300,400,500:latin' ] } | |
}; | |
var cb = function() { | |
var wf = document.createElement('script'); | |
wf.src = '//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; | |
wf.type = 'text/javascript'; | |
wf.async = 'true'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(wf, s); | |
}; | |
var raf = requestAnimationFrame || mozRequestAnimationFrame || webkitRequestAnimationFrame || msRequestAnimationFrame; | |
if(raf){ | |
raf(cb); | |
}else{ | |
window.addEventListener('load', cb); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've also created an updated GIST here: https://gist.github.com/kosmiq/2cdac1677d0ba07fc846