为什么 @fontface 在 Firefox 中有时有效,有时无效?修复?
有谁知道为什么 @fontface 有时在 Firefox 中有效,但在其他版本中无效?
在此页面上... http://www.independentink.ca/gameday/indexb.htm 您可以看到以嵌入字体书写的“设计包”。然后,我尝试在同一页面上实现一些联盟哥特式,如下所示... http://ggszabo .com/new/indexb.html 它不会工作。
我在 FF 中观看,其中一个有效,而另一个则无效。我的代码在两者上完全相同。
我已经搜索过答案,但没有一个具体解决这个问题。
我的CSS如下。
@font-face {
font-family: 'League Gothic';
src: url('../fonts/League_Gothic.eot');
src: local('☺'),
url("../fonts/League_Gothic.woff") format("woff"),
url("../fonts/League_Gothic.svg") format("svg");
}
请帮忙!
Does anybody know why @fontface will work sometimes in Firefox but not others?
On this page... http://www.independentink.ca/gameday/indexb.htm you can see 'Design Packages' written in an embedded font. Then, I try to implement some League Gothic on the same page, as seen here... http://ggszabo.com/new/indexb.html and it won't work.
I'm viewing both in FF and one works while the other doesn't. My code is exactly the same on both.
I've searched for answers but none address this problem specifically.
My css is as follows.
@font-face {
font-family: 'League Gothic';
src: url('../fonts/League_Gothic.eot');
src: local('☺'),
url("../fonts/League_Gothic.woff") format("woff"),
url("../fonts/League_Gothic.svg") format("svg");
}
Please help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我至少找到了本地开发的答案...
“Firefox 默认情况下有一个非常严格的“文件 uri origin”(file:///) 策略:要让它像其他浏览器一样运行,请转到 about:config ,按 fileuri 过滤并切换以下首选项:
security.fileuri.strict_origin_policy
将其设置为 false,您应该能够跨不同路径级别加载本地字体资源。”
我还没有看到它发布后是否有效。我有理由相信它会的。
I found an answer for local development at least...
"Firefox comes with a very strict "file uri origin" (file:///) policy by default: to have it to behave just as other browsers, go to about:config, filter by fileuri and toggle the following preference:
security.fileuri.strict_origin_policy
Set it to false and you should be able to load local font resources across different path levels."
I have yet to see if it works when published. I have reason to believe that it will.