@font-face 带有多个 font-size css 声明会使 Firefox 缓慢爬行
CSS:
@font-face {
font-family: Gabriola;
font-weight: normal;
font-style: normal;
src: local("Gabriola Regular"), local("Gabriola"),
url("Gabriola.eot"), /* IE 5+ */
url('Gabriola.woff') format('woff'), /* FF 3.6, Chrome 5, IE9 */
url('Gabriola.ttf') format('truetype'), /* Opera, Safari */
url('Gabriola.svg#Gabriola') format('svg'); /* iOS */
}
body {
font-family: Gabriola, sans-serif;
font-size: 1.3em;
}
.wine_name { font-size:2em; }
.price { font-size:2.6em; color:#CCC; }
.sugar { font-size:2em; color:#980000; }
br { page-break-after: always; }
页面显示得很快,因为我已经安装了 Gabriola。当我删除 local() 引用时,文件会下载...但 Firefox 在最终渲染页面之前冻结了大约 20 秒。这是因为有多个字体大小声明。当我删除它们时,无论我是否指定 local() 源,它都会快速渲染。还有其他人遇到过这个问题吗?
CSS:
@font-face {
font-family: Gabriola;
font-weight: normal;
font-style: normal;
src: local("Gabriola Regular"), local("Gabriola"),
url("Gabriola.eot"), /* IE 5+ */
url('Gabriola.woff') format('woff'), /* FF 3.6, Chrome 5, IE9 */
url('Gabriola.ttf') format('truetype'), /* Opera, Safari */
url('Gabriola.svg#Gabriola') format('svg'); /* iOS */
}
body {
font-family: Gabriola, sans-serif;
font-size: 1.3em;
}
.wine_name { font-size:2em; }
.price { font-size:2.6em; color:#CCC; }
.sugar { font-size:2em; color:#980000; }
br { page-break-after: always; }
The page displays quickly because I have Gabriola already installed. When I remove the local() references, the file downloads...but Firefox freezes for around 20 seconds before finally rendering the page. This is because of the multiple font-size declarations. When I remove them, it renders fast whether or not I specify local() sources. Has anyone else had this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许我很不耐烦,但我最近似乎经常回答自己的问题:S
事实证明,A)字体文件本身有问题和/或 B)Firefox 不擅长解析某些类型的字体。我
下载了不同的脚本字体(akaDora)并测试了它......它工作得很好。没有滞后。没有延迟。当然,现在我的任务是为 Gabriola 寻找不会让 Firefox 呕吐的字体文件。有人认识他们吗?我从 http://www.fonts2u.com/ 测试了两种字体。
Perhaps I'm impatient but I seem to be answering my own questions a lot lately :S
Turns out there's either A) something wrong with the font file itself and/or B) Firefox isn't good at parsing certain types of fonts...
I downloaded a different script font (akaDora) and tested it...it works just fine. No lag. No delay. Now of course I'm tasked with finding font-face files for Gabriola that don't make Firefox barf. Anyone know of them? I got both fonts tested from http://www.fonts2u.com/.