在IE中遇到@ font-face的问题

时间:2011-11-22 18:05:00

标签: html css internet-explorer font-face

我正在尝试使用fontsquirrel.com上的@ font-face工具包。我已经从他们提供的文件中直接删除了所有内容,但是当使用开发人员工具在IE9中进行测试时,我得到以下结果:

浏览器模式:IE9,文档模式:IE9标准 - 字体呈现正确
浏览器模式:IE8,文档模式:IE8标准 - 字体不呈现
浏览器模式:IE7,文档模式:IE7标准 - 字体不呈现

好奇和令人愤怒的事情是当我从@ font-face工具包中查看演示文件时,它会在上述所有三种情况下正确渲染。就像我说的一切都是从提供的文件中复制/粘贴。

我能想到的唯一区别是我使用的是HTML5 Boilerplate。

任何想法都会受到重视。

回复评论:

这是字体:http://www.fontsquirrel.com/fonts/bebas-neue

我正在使用的CSS:

@font-face {
font-family: "BebasNeueRegular";
src: url('BebasNeue-webfont.eot?') format('eot'),
     url('BebasNeue-webfont.woff') format('woff'),
     url('BebasNeue-webfont.ttf') format('truetype'),
     url('BebasNeue-webfont.svg#webfontfvFLBU0N') format('svg');
font-weight: normal;
font-style: normal;
}

1 个答案:

答案 0 :(得分:1)

杰森,你的font-face代码与我下载的套件中的代码不完全匹配。注意第四行(我用一些评论的惊叹号标记)与你的不同。

@font-face {
    font-family: 'BebasNeueRegular';
    src: url('BebasNeue-webfont.eot');
    src: url('BebasNeue-webfont.eot?#iefix') format('embedded-opentype'), /* !!! */
         url('BebasNeue-webfont.woff') format('woff'),
         url('BebasNeue-webfont.ttf') format('truetype'),
         url('BebasNeue-webfont.svg#BebasNeueRegular') format('svg');
    font-weight: normal;
    font-style: normal;

}
相关问题