字体不工作在IE8如预期 [英] Font Face not working in IE8 as expected

查看:217
本文介绍了字体不工作在IE8如预期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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');
}

这适用于chrome,ff,IE10,IE9,我在这里做错了什么?如果我做错了什么,请更正我。

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.

注意:我已经google了,发现几个stackoverflow的答案,但似乎没有解决我的问题。

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


推荐答案

如果IE8抛出 CSS3111:@ font-face遇到未知错误,您可能有不匹配的字体族名称问题。

If IE8 throws the CSS3111: @font-face encountered unknown error, you probably have the non-matching font-family name problem.

要解决此问题,您需要编辑您的字体文件,为字体名称,家庭名称和名称为人类定义相同的名称,并导出您的TTF。这可以使用 FontForge 应用程序完成。

To resolve this, you need to edit your font file, define identical names for Fontname, Family name and Name for humans and export your TTF. This can be done using the FontForge application. Afterwards, you than again convert it for web (EOT, WOFF).

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

更新

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

Made it working by downloading an own version of the TTF font and converted it for web. The CSS I used:

@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;
}

这篇关于字体不工作在IE8如预期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆