为什么 Firefox 中的网络字体不能在不同的域上工作?
我正在 Firefox 3.5 中尝试奇特的新 OpenType 字体功能,然后我运行了陷入一个问题。我试图将字体嵌入到与使用该字体的页面不同的域中,但它不起作用。我认为这可能是一个错误,但从我在 MDC 参考页面上读到的内容中,我注意到了这个注释:
在 Gecko 中,Web 字体受到相同的域限制(字体文件必须与使用它们的页面位于同一域中),除非使用 HTTP 访问控制来放宽此限制。
看起来他们是故意这样设计浏览器的。出于好奇,他们为什么要这样做?嵌入字体是否存在安全风险?或者是为了合法的商标或版权问题?或者其他什么?
I was experimenting with the fancy new OpenType font capability in Firefox 3.5 and I ran into a problem. I was trying to embed a font on a different domain than the page it would be used on, and it didn't work. I thought it may have been a bug, but from what I read on the MDC reference page, I noticed this note:
In Gecko, web fonts are subject to the same domain restriction (font files must be on the same domain as the page using them), unless HTTP access controls are used to relax this restriction.
It looks like they designed the browser that way on purpose. Out of curiosity, why would they do that? Is there any security risk with embedding a font? Or is it for legal trademark or copyright issues? Or something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你想绕过它,你可以尝试将其添加到你的 .htaccess 中:
为了回答你的问题,这可能与以下事实有关:自版本 3.5 以来 Firefox 支持 跨域共享标准。
If you want to bypass it you could try adding this to your .htaccess:
To answer your question, it's probably related to the fact that since version 3.5 Firefox supports the cross-origin sharing standard.
嵌入字体时,合法的商标和版权问题有时会限制基于域的使用。
编辑:
这就是为什么您应该始终查看您可能购买的字体许可证上的小字母。如果您创建了它,那么您就拥有完全的所有权并且没有任何问题。
PS:我不是律师,但可以向我的几位客户证实此案。
Legal trademark and copyright issues sometimes restrict the usage based on domain when embedding fonts.
Edit:
That's why you should always look at the tiny letters on the font license that you might buy. If you created it, then you have full ownership and no problems at all.
P.S: I am not a lawyer, but can confirm the case with several customers of mine.