html - GOOGLE web font loader -
i've check many blogs, couldn't find answer question, i'm using google web font loader asynchronously load fonts google cdn, however, making use of font stored locally on server using @font face declaration in css.
is possible combine two, i.e. make async script load google fonts cdn , local font (including fallback)
// here's script in html file
<script type="text/javascript"> webfontconfig = { google: { families: [ 'merriweather:400,900italic,700italic,900,700:all' ] }, custom: { families: ['fira sans'], urls: ['../assets/css/type.css'] } }; (function() { var wf = document.createelement('script'); wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://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); })(); </script> <noscript> <link href='http://fonts.googleapis.com/css?family=merriweather:400,900italic,700italic,900,700&subset=all' rel='stylesheet' type='text/css'> </noscript>
//here local font declaration found in css file
@font-face { font-family:'museo_sans300'; src: url('museo/museosans_300-webfont.eot?') format('eot'), url('museo/museosans_300-webfont.woff') format('woff'), url('museo/museosans_300-webfont.ttf') format('truetype');}
i make both of these load async , maybe include typekit in future!
is possible?
many
Comments
Post a Comment