I wonder what is the best way to load fonts from Google Fonts. I googled and founded <link/>
way better than @import
. Are there any tools to measure speed and performance over network and browser? What about javascript method?
<link href='http://fonts.googleapis.com/css?family=Oswald:300' rel='stylesheet' type='text/css'>
or
@import url(http://fonts.googleapis.com/css?family=Oswald:300);
or
<script type="text/javascript">
WebFontConfig = {
google: { families: [ 'Oswald:300:latin' ] }
};
(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>