9

I've used the following code to get a custom font in my website! using the following code!

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

This works in chrome,ff,IE10,IE9 but not in IE8! What am I doing wrong here? Please correct me if I'm doing anything wrong.

Note : I've googled and found few stackoverflow answers but nothing seems to solve my problem.

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
4

3 回答 3

17

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

要解决此问题,您需要编辑字体文件,为 Fontname、Family name 和 Name for human 定义相同的名称,然后导出您的 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;
}
于 2013-10-03T08:35:24.060 回答
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;
}
于 2013-11-27T18:49:47.677 回答
2

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

应该早点看IE的控制台,有说permiossion的问题。

于 2013-11-08T10:14:31.390 回答