【问题标题】:@font-face not working in ie8 - the revenge@font-face 在 ie8 中不起作用 - 复仇
【发布时间】:2013-11-28 12:38:59
【问题描述】:

是的,我知道这里有一个相同的问题,并且有许多类似的问题在这里提出和回答,还有许多在线资源讨论了这个问题。对我的情况没有任何帮助,所以我采取了绝望的措施。

我正在尝试使用@font-face 语法加载网络字体。这是代码(我加载了多个,但语法相同):

@font-face {
    font-family: 'MyFont';
    src: url('../typography/MyFont-Book.eot');
    src: local('?'), 
            url('../typography/MyFont-Book.eot?#iefix') format('embedded-opentype'),
            url('../typography/MyFont-Book.woff') format('woff'), 
            url('../typography/MyFont-Book.ttf') format('truetype'), 
            url('../typography/MyFont-Book.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

如标题所述,它在 ie8 中不起作用(在 ie9 和 10 以及显然所有其他浏览器中都可以正常工作)。我已经尝试了几件事。

一开始,我得到了错误“CSS3111:@font-face遇到未知错误”,我找到了this site。我按照这些步骤更改了字体的名称并重新生成了它们。显然,那一定是修复了 something 因为我不再收到那个错误了。我还看到网络嗅探器中正确加载了字体,全部返回干净的 200。

我已经清除了我的缓存(多次),但仍然没有骰子。字体仍然没有显示在页面上。相反,会显示后备的“Arial”字体,因为它比 Web 字体大得多,所以会弄乱布局。

有人知道 eff 可能发生了什么吗?

【问题讨论】:

标签: css internet-explorer fonts internet-explorer-8


【解决方案1】:

我有几个项目将字体加载到 IE8。它们的定义与您的定义几乎相同,但没有 src : local(?)。

@font-face {
    font-family: 'MyFont';
    src: url('../typography/MyFont-Book.eot');
    src: url('../typography/MyFont-Book.eot?#iefix') format('embedded-opentype'),
         url('../typography/MyFont-Book.woff') format('woff'), 
         url('../typography/MyFont-Book.ttf') format('truetype'), 
         url('../typography/MyFont-Book.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-20
    • 1970-01-01
    • 1970-01-01
    • 2013-08-25
    • 1970-01-01
    • 2011-10-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多