【问题标题】:Are .eot fonts supported via @font-face datauri on IE8?IE8 上的 @font-face datauri 是否支持 .eot 字体?
【发布时间】:2013-02-16 05:54:10
【问题描述】:

IE8 上的 @font-face datauri 是否支持 .eot 字体?
IE8 上的 datauris 是否仅支持图像?

我知道 32KB 的限制。我的 .eot 字体的 base64 表示不超过此限制。

我的 css 声明是这样的:

@font-face {
    font-family: 'MyFont';
    src: url(data:font/opentype;base64,B1QAAB9TAAACAAI.....);
    font-weight: normal;
    font-style: normal;
}

【问题讨论】:

  • 我会说:打开IE8试试看?
  • @MichaëlHompus 惊人的想法:)
  • 我也遇到了同样的问题。我相信这是因为 IE8 将 datauri 限制为某些文件类型:en.wikipedia.org/wiki/Data_URI_scheme

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


【解决方案1】:

数据 URI 对此应该没有任何问题...

...它应该可以工作,我的 .eot 网络字体可以在所有浏览器(甚至 IE7)中使用这个...但我也使用 WOFF/TTF/SVG 来支持其余的浏览器

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

确保 IIS 在您的本地/网络服务器上具有正确的 mime 类型(例如:application/vnd.ms-fontobject for .eot 个文件)。

最后....我怀疑 Datauri 是原因,但为了安全起见,请尝试不使用 data/base64,看看它是否有任何作用

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-05
    • 1970-01-01
    • 1970-01-01
    • 2013-08-25
    • 2016-07-06
    • 1970-01-01
    • 2010-11-29
    • 2011-12-06
    相关资源
    最近更新 更多