【发布时间】:2015-09-21 23:10:34
【问题描述】:
我有一组在 Firefox、Chrome、Safari 中运行良好的嵌入式字体 - 但是,令人惊讶的是,在 IE 中却不行(v11,但在 10 中尝试过,但也没有用)。
我可以在 IE 中加载一些内容,但不能加载其他内容。 CSS示例:
/* working */
@font-face {
font-family: 'FoundersGroteskWeb-Semibold';
src: url(./fonts/FoundersGroteskWeb-Semibold.eot);
src: url(./fonts/FoundersGroteskWeb-Semibold.eot?#iefix) format('embedded-opentype'),
url(./fonts/FoundersGroteskWeb-Semibold.woff) format('woff');
font-style: normal;
font-weight: normal;
}
/* not working */
@font-face {
font-family: 'FoundersGroteskX-CondensedWeb-Bold';
src: url(./fonts/FoundersGroteskX-CondensedWeb-Bold.eot);
src: url(./fonts/FoundersGroteskX-CondensedWeb-Bold.eot?#iefix) format('embedded-opentype'),
url(./fonts/FoundersGroteskX-CondensedWeb-Bold.woff) format('woff');
font-style: normal;
font-weight: normal;
}
提供了字体,所有字体都正确命名,等等。我注意到的一个区别是所有其他浏览器都在加载 woff 文件,而 IE 使用的是(第一个,非 #iefix)eot 文件。所以我尝试删除所有对eot文件的引用,迫使IE11使用woff。再次,它加载第一个很好,但没有使用第二个(所有其他浏览器都加载没有问题)。
当我在 IE 上检查网络选项卡时,我可以看到第一个字体的 200 响应,但第二个字体什么都没有,看起来它可能会在解析 css 时窒息。但是,鉴于这两个声明除了字体名称之外是相同的,我不明白为什么会这样。
有没有人知道我还能尝试什么,因为我已经用完了可以抓住的稻草?
【问题讨论】:
标签: html css internet-explorer fonts