Skip to content

Instantly share code, notes, and snippets.

@sky4git
Last active November 26, 2016 10:34
Show Gist options
  • Save sky4git/045c6ab1885a202382ced8ff094fd919 to your computer and use it in GitHub Desktop.
Save sky4git/045c6ab1885a202382ced8ff094fd919 to your computer and use it in GitHub Desktop.
Web Font Loader
----------- Example 1 for Google Fonts ----------------------------------
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js"></script>
<script>
WebFont.load({
google: {
families: ['Droid Sans', 'Droid Serif']
}
});
</script>
------------- Example 2 for Typekit------------------------------------
<script>
WebFontConfig = {
typekit: { id: 'xxxxxx' }
};
(function(d) {
var wf = d.createElement('script'), s = d.scripts[0];
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js';
s.parentNode.insertBefore(wf, s);
})(document);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment