Css 字体未按预期在IE8中工作
我已经使用以下代码在我的网站中获得了自定义字体!使用下面的代码Css 字体未按预期在IE8中工作,css,internet-explorer-8,font-face,Css,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中无效!我做错了什么?如果我做错了什
@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中无效!我做错了什么?如果我做错了什么,请纠正我
注意:我在谷歌上搜索了一下,找到了一些答案,但似乎没有什么能解决我的问题
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遇到未知错误
,则可能存在字体系列名称不匹配的问题
要解决此问题,您需要编辑字体文件,为Fontname、Family name和人名定义相同的名称,并导出TTF。这可以使用应用程序来完成。然后,再次将其转换为web(EOT、WOFF)
更多信息:
更新
通过下载自己版本的TTF字体并将其转换为web字体,使其正常工作。我使用的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;
}
虽然我的公司购买了所有格式(eot、woff等)的字体,但我并没有让它在IE8和IE10中工作。我上传了ttf格式到,得到了一个“webfont”??版本和现在它的作品
应该在IE出现问题之前就观察控制台。我在IE8出现问题,并且没有控制台错误消息。解决我的问题的方法是稍微修改我的
@字体
代码:
之前:
@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;
}
之后:
@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;
}
可能是重复的。我检查过了,但不起作用!也许是因为字体。请尝试使用另一个进行测试。当查看浏览器的控制台输出时,是否有错误,例如:CSS3111:@font-face遇到未知错误?我已经用错误更新了问题!刚刚在本地试用过,它可以在所有浏览器上运行(包括IE7和IE8)。我下载了“PortagoITC TT”字体的TTF格式,并将其转换为web格式。我使用的CSS:&at;字体面{font family:'portagiotc tt';src:url('font/portagiotc tt.eot');src:url('font/portagiotc tt.eot?iefix')格式('opentype')、url('font/portagiotc tt.woff')格式('woff')、url('font/portagiotc tt.ttf')格式('truetype');字体重量:正常;字体样式:正常;}您的字体文件似乎有问题。你用什么工具来转换?如果你能告诉我你在哪里下载并转换了字体,它可能会帮助我。你能在你的答案中添加CSS吗?。我已经从下载了它,并用“让我知道它是否在你这边有效”来隐藏它。