IE9拒绝加载自定义字体? [英] IE9 Refusing to Load custom font?
问题描述
pre code $ @ font-face {
font-family:BrushstrokePlain;
src:url(../../ fonts / BRUSHSTP-webfont.eot);
src:url(../../ fonts / BRUSHSTP-webfont.eot?#iefix)format(embedded-opentype),
url(../../ fonts (truetype),
url(../../ fonts / BRUSHSTP-webfont.ttf)格式(woff),
url(/ BRUSHSTP-webfont.woff ../../fonts/BRUSHSTP-webfont.svg#BrushstrokePlain)格式(svg);
font-weight:normal;
font-style:normal;
}
但是IE9固执地拒绝合作。现场是: http://family.steps.org.au
适用于所有的浏览器和IE 7& 8,IE9除外:(b / b)
$ b 编辑
这是我添加到我的nginx配置,以使其正常工作:
pre $ location〜* \。( eot | ttf | woff)$ {
add_header Access-Control-Allow-Origin *;
}
<解决方案
解决方案
解决方案您的问题是要处理您的HTTP头,尝试添加到您的Apache配置文件:
<$ p (ttf | otf | eot | woff)$>
< IfModule mod_headers.c>
标题集Access-Control- Allow-Originhttp://mydomain.com
< / IfModule>
< / FilesMatch>
将mydomain.com替换为你的域,你在ie9中得到了一个交叉错误,因为你可能没有在你的配置文件中正确设置.ttf文件,上面的代码应该可以解决这个问题。检查,因为你可能已经在你的配置中有这个,你可能只是没有所有的文件类型指定ied。
I'm trying to get IE9 to display a custom font. Should be easy... researched plenty of google sites, and even stackoverflow questions. This is what I've got:
@font-face {
font-family: "BrushstrokePlain";
src: url("../../fonts/BRUSHSTP-webfont.eot");
src: url("../../fonts/BRUSHSTP-webfont.eot?#iefix") format("embedded-opentype"),
url("../../fonts/BRUSHSTP-webfont.woff") format("woff"),
url("../../fonts/BRUSHSTP-webfont.ttf") format("truetype"),
url("../../fonts/BRUSHSTP-webfont.svg#BrushstrokePlain") format("svg");
font-weight: normal;
font-style: normal;
}
But IE9 stubbornly refuses to cooperate. The live site is: http://family.steps.org.au
It works on all browsers and IE 7 & 8, except IE9 :(
Edit
This is what I added to my nginx config to get it working:
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
Your issue is to do with your HTTP Headers. Try adding this to your Apache config file:
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "http://mydomain.com"
</IfModule>
</FilesMatch>
Replace mydomain.com with your domain. You are getting a cross-origin error in ie9 becuase you probably do not have .ttf files setup properly in your config. The above code should solve that. Double check, as you may already have this in your config, you may just not have all the file types specified.
这篇关于IE9拒绝加载自定义字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!