3

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

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

我的 CSS 声明是这样的:

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

1 回答 1

0

数据 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 在您的本地/Web 服务器上具有正确的 mime 类型(例如:用于.eot文件的 application/vnd.ms-fontobject)。

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

于 2013-03-05T20:26:27.613 回答