加載使用web字體的字體,我這樣做,因爲他們認爲這裏:https://developers.google.com/fonts/docs/webfont_loader使用WebFont加載器時,如何對css進行硬編碼?
WebFontConfig = {
custom: { families: ['font1', 'font2', 'font3'],
urls: [ 'stylesheets/fonts.css' ] },
loading: function(){
console.log('loaded');
},
inactive: function(){
console.log('not loaded');
}
};
WebFont.load(WebFontConfig);
但是,這是否意味着broswer等待的CSS文件的下載它開始加載fonts.The CSS是短短之前代碼行,我不明白爲什麼我不能直接粘貼到JS。
任何人都知道如何做到這一點?
http://webdesign.tutsplus.com/tutorials/ux-tutorials/quick-tip-avoid-fout-by-adding-a-web-font-preloader/ – Andreas 2013-05-04 14:57:59
好嘖嘖,但他們仍然加載外部的CSS加載字體之前;這是我想避免:) – fabien 2013-05-04 15:19:14