在Internet Explorer 7中@font-face存在问题

4

我在一个网站上使用Font Squirrel生成的@font-face代码时遇到了问题。这种字体在Internet Explorer 7中无法显示,但在其他浏览器中可以正常工作。

网站地址为:http://www.mrsherskin.com

@font-face {
    font-family: 'PFRondaSeven';
    src: url('font/pf_ronda_seven-webfont.eot');
    src: url('font/pf_ronda_seven-webfont.eot?iefix') format('eot'),
         url('font/pf_ronda_seven-webfont.woff') format('woff'),
         url('font/pf_ronda_seven-webfont.ttf') format('truetype'),
         url('font/pf_ronda_seven-webfont.svg#webfont7vFUbybx') format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'PFRondaSeven';
    src: url('font/pf_ronda_seven_bold-webfont.eot');
    src: url('font/pf_ronda_seven_bold-webfont.eot?iefix') format('eot'),
         url('font/pf_ronda_seven_bold-webfont.woff') format('woff'),
         url('font/pf_ronda_seven_bold-webfont.ttf') format('truetype'),
         url('font/pf_ronda_seven_bold-webfont.svg#webfont2zOjOL6G') format('svg');
    font-weight: bold;
    font-style: normal;
}

/* basic font-set */

body { font-family: 'PFRondaSeven'; font-size-adjust: 0.62; }

很奇怪,因为我用这种方法制作的另一个网站可以完美运行。

请问有什么帮助吗?可能是什么问题呢?

3个回答

4

试试这个替代方法:

@font-face {
font-family: 'Avenir';
src: url('avenirl8-webfont.eot');
src: local('☺'), url('avenirl8-webfont.woff') format('woff'), url('avenirl8-webfont.ttf') format('truetype'), url('avenirl8-webfont.svg#webfontIFZXxqn6') format('svg');
font-weight: normal;
font-style: normal;
}

替换字体为您自己的字体,并添加粗体字声明。就这样做应该可以工作;)

笑脸规则!我花了很多时间:(谢谢! - Arvid

3

0
你确定eot文件的MIME类型是正确的吗?
我通常会将以下内容添加到我的.htaccess文件中(或在不同软件上等效的位置)。
AddType application/vnd.ms-fontobject eot
AddType font/ttf                      ttf
AddType font/otf                      otf
AddType font/x-woff                   woff

AddType text/x-component .htc

当我将这个复制到我的 .htaccess 文件中时,它完全破坏了网站 :-(( 我不得不回退到一些旧版本。 - Gas
这很奇怪 - 也许您的托管不允许这样的指令。 - Rich Bradshaw

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接