字体在IE 10中不起作用 [英] font-face not working in IE 10

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

问题描述

我绝对无法使IE 10显示自定义字体.还有其他人对此有解决方案吗?我在网上看到一些大声疾呼,说别人在IE 10中使用字体时遇到了麻烦,但是找不到解决方案或已确认的错误.

I have absolutely no succes in getting IE 10 to display custom fonts. Has anyone else a solution for this? I can see a few shout-outs on the net that others have trouble with their fonts in IE 10, but no solutions or confirmed bugs to be found.

有相同经验或解决方案的人吗?

Anyone with the same experience or solution?

这就是我现在拥有的,它在IE 10,Chrome和Safari之前的版本中都可以很好地工作:

This is what I have right now, and it works well in IE before 10, Chrome and Safari:

@font-face {
    font-family: "LCD";
    src: url('http://www.somedomain.xxx/Public/Fonts/Quartz_Regular.ttf');
}

<!--[if IE]>
<style type="text/css">
@font-face {
    font-family: "LCD";
    src: url('http://www.somedomain.xxx/Public/Fonts/Quartz_Regular.eot');
}
</style>
<![endif]-->

我试图用woff,ott等其他格式的字体文件代替,但是一点都不运气.

I have tried to substitute with font files in other formats woff, ott etc. but no luck at all with that.

提示字体松鼠的答案使之起作用. 现在,工作标记(对于IE 10)为:

The answer which hinted at font-squirrel made it Work. Now the working markup (for IE 10) is:

@font-face {
    font-family: "LCD";
    src: url('/Public/Fonts/quartz_regular-webfont.eot');
    src: url('/Public/Fonts/quartz_regular-webfont.eot?#iefix') format('embedded-opentype'),
         url('/Public/Fonts/quartz_regular-webfont.woff') format('woff'),
         url('/Public/Fonts/quartz_regular-webfont.ttf') format('truetype'),
         url('/Public/Fonts/quartz_regular-webfont.svg#quartzregular') format('svg');
    font-weight: normal;
    font-style: normal;
}

推荐答案

由于HTML注释和样式元素,我认为这是在HTML文件中...如果没有,请调查一下.

I assume this is in an HTML file, due to the HTML comments and style elements...if not, look into that.

除此之外,只需使用 @ font-face生成器

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

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