Font Face无法按预期在IE8中运行

时间:2013-10-03 05:38:45

标签: css css3 internet-explorer-8 font-face

我使用以下代码在我的网站上获取自定义字体!使用以下代码!

@font-face{
     font-family:portagolTC;
     src: url(../font/PortagoITC_TT.woff?) format('woff');
     src: url(../font/PortagoITC_TT.eot?#iefix) format('opentype');
}

这适用于chrome,ff,IE10,IE9,但不适用于IE8!我在这做错了什么?如果我做错了,请纠正我。

注意:我用Google搜索并发现很少的stackoverflow答案,但似乎没有解决我的问题。

CSS3111: @font-face encountered unknown error. 
PortagoITC_TT.woff
CSS3114: @font-face failed OpenType embedding permission check. Permission must be Installable. 
PortagoITC_TT.ttf
CSS3114: @font-face failed OpenType embedding permission check. Permission must be Installable. 
PortagoITC_TT.ttf

3 个答案:

答案 0 :(得分:17)

如果IE8抛出CSS3111: @font-face encountered unknown error,您可能会遇到不匹配的字体系列名称问题。

要解决此问题,您需要编辑字体文件,为人物定义相同的字体名称,姓氏和名称,并导出您的TTF。这可以使用FontForge应用程序完成。然后,你再次将其转换成网页(EOT,WOFF)。

更多信息:http://fontface.codeandmore.com/blog/ie-7-8-error-with-eot-css3111/

<强>更新

通过下载自己版本的TTF字体并将其转换为网络来使其正常工作。我使用的CSS:

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

答案 1 :(得分:3)

我遇到IE8问题,并且没有控制台错误消息。解决了我的问题的原因是稍微改变了我的@font-face代码:

<强>之前:

@font-face {
    font-family: "Hero";
    src: local("Hero"),
         url("../fonts/Hero.eot?"),
         url("../fonts/Hero.woff") format("woff"),
         url("../fonts/Hero.ttf") format("truetype"),
         url("../fonts/Hero.svg#Hero") format("svg");
    font-weight: normal;
    font-style: normal;
}

<强>后:

@font-face {
    font-family: "Hero";
    src: url("../fonts/Hero.eot"); /* this line made the difference */
    src: local("Hero"),
         url("../fonts/Hero.eot?"),
         url("../fonts/Hero.woff") format("woff"),
         url("../fonts/Hero.ttf") format("truetype"),
         url("../fonts/Hero.svg#Hero") format("svg");
    font-weight: normal;
    font-style: normal;
}

答案 2 :(得分:2)

虽然我的公司购买了字体,所有格式(eot,woff等),但我没有在IE8和IE10中使用它。我将ttf格式上传到http://www.fontsquirrel.com/tools/webfont-generator并获得了'webfont'?版本,现在它可以工作!!!

应该早点看到IE的控制台,有陈述的问题。

相关问题