我需要一些解决方案或建议,以加载更快的字体在网站上。
就像这样
@font-face {
font-family: 'myfont';
src: url('myfont.eot');
src: url('myfont.eot?#iefix') format('embedded-opentype'),
url('myfont.woff') format('woff'),
url('myfont.ttf') format('truetype'),
url('myfont.svg#nexa_heavyregular') format('svg');
font-weight: normal;
font-style: normal;
}当html加载或下载font-face url时,需要一些时间来改变font-face,有没有更快加载它的想法?
发布于 2013-04-03 23:58:28
你不能让它加载得更快,因为它依赖于网络和浏览器的字体渲染,但你可以在使用FontLoader加载字体时显示某种加载指示器
// Show an activity indicator while font is loading...
var fontLoader = new FontLoader(["myfont"], {
"fontsLoaded": function(error) {
// Hide the activity indicator and show the text.
}
}, 3000);
fontLoader.loadFonts();这是一个关于jsFiddle的演示
https://stackoverflow.com/questions/15364376
复制相似问题