我正在尝试使用来自 typefront.com 的字体。它适用于所有其他浏览器,但 Firefox 中的安全限制不允许使用来自不同域的字体。
我已经尝试创建一个 .htaccess
文件并添加以下代码片段,但是当我尝试加载该网站时,我收到一个内部服务器错误页面!
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "http://mydomain.com"
</IfModule>
</FilesMatch>
这是我的 CSS 代码:
@font-face {
font-family: "Gravur-CondensedBold";
src: url("http://typefront.com/fonts/825589026.eot");
src: local("☺"),
url("http://typefront.com/fonts/825589026.woff") format("woff"),
url("http://typefront.com/fonts/825589026.ttf") format("truetype"),
url("http://typefront.com/fonts/825589026.svg") format("svg");
}
@font-face {
font-family: "Gravur-CondensedLight";
src: url("http://typefront.com/fonts/825589027.eot");
src: local("☺"),
url("http://typefront.com/fonts/825589027.woff") format("woff"),
url("http://typefront.com/fonts/825589027.ttf") format("truetype"),
url("http://typefront.com/fonts/825589027.svg") format("svg");
}
谁能帮我解决这个问题?
最佳答案
关于.htaccess - @font-face 在 Firefox 中不能跨域工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10383375/