【发布时间】:2013-01-06 02:29:31
【问题描述】:
我在我的页面上使用了三种不同的字体,它们都可以在不同的浏览器中出色地显示,但其中一种在 Chrome 中不起作用(仅限 Windows。它适用于 Chrome MAC OS X&Linux)。 首先,出现错误“资源解释为字体但使用 MIME 类型应用程序/八位字节流传输:”我通过在 .htaccess 中添加以下代码来修复此错误:
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
但我的字体没有显示。 我的 CSS 和字体:
@font-face{
font-family:'PopularScript';
src:url('http://test.dubrovka.dn.ua/stc/eot/PopularScript.eot');
src:url('http://test.dubrovka.dn.ua/stc/eot/PopularScript.eot?#iefix') format('embedded-opentype'),
url('http://test.dubrovka.dn.ua/stc/wof/PopularScript.woff') format('woff'),
url('http://test.dubrovka.dn.ua/stc/ttf/PopularScript.ttf') format('truetype'),
url('http://test.dubrovka.dn.ua/stc/svg/PopularScript.svg#PopularScript') format('svg');
font-weight:normal;
font-style:normal;
}
【问题讨论】:
-
这个似乎在 Chrome (v24.0.1312.52 m) 上运行良好 jsfiddle ...奇怪地不适用于 Firefox v18.0.1 :D
-
...好的,我看到了你关于 Firefox 的帖子,那没问题。
-
这是什么?该代码适用于 Chrome,还有一个更早的问题是关于这不适用于 Firefox:stackoverflow.com/questions/14445516/…。所以请关闭这个问题或澄清。
-
Ок,这适用于 Chrome MAC OS X,但不适用于 Chrome Windows/Linux。它适用于 Firefox MAC OS X,但不适用于 Firefox Windows/Linux。我使用 Font Squirrel 来生成 @font-face 工具包,它不会重复前面的问题。我使用了 3 种不同的字体,只损坏了三种字体中的一种。
-
UPD。我修复了 Firefox Windows/Linux 和 Chrome Linux 中的问题。 Font Squirrel 从字体 Cyrillic 中删除。我使用 font2web 转换此字体,但 Steel 在 Chrome Windows 中存在问题,它下载字体,但没有响应...
标签: css google-chrome font-face