字体真棒没有正确显示在Firefox /如何通过CDN售卖?

Ala*_*ing 12 css firefox cross-domain font-awesome

即使在localhost中,我也无法在firefox中正确显示font-awesome.我收到以下跨域错误:

Timestamp: 08/08/2012 02:49:37 PM
Error: downloadable font: download failed (font-family: "FontAwesome" style:normal weight:normal stretch:normal     `src index:2): bad URI or cross-site access not allowed
source: http://localhost:3000/djpsite/baseadmin/font/fontawesome-webfont.ttf
Source File: http://localhost:3000/djpsite/baseadmin/css/font-awesome.css
Line: 0
Source Code:
@font-face {   font-family: "FontAwesome";   font-style: normal;   font-weight: normal;   src: url("../font/fontawesome-webfont.eot?#iefix") format("embedded-opentype"), url("../font/fontawesome-webfont.woff") format("woff"), url("../font/fontawesome-webfont.ttf") format("truetype"), url("../font/fontawesome-webfont.svg#FontAwesome") format("svg"); }
Run Code Online (Sandbox Code Playgroud)

我按照这篇文章的建议使用双引号:firefox @ font-face使用fontawesome失败但是没有解决问题.

Chrome中的一切都运行良好; 有什么建议?

除了解决Chrome中的问题之外,鉴于此限制,我应该如何在CDN上销售字体 - http://dev.w3.org/csswg/css3-fonts/#default-same-origin-restriction

以下是我的CSS文件中的代码:

@font-face {
    font-family: 'FontAwesome';
    src: url("../font/fontawesome-webfont.eot");
    src: url("../font/fontawesome-webfont.eot?#iefix") format('embedded-opentype'),
    url("../font/fontawesome-webfont.woff") format('woff'),
    url("../font/fontawesome-webfont.ttf") format('truetype'),
    url("../font/fontawesome-webfont.svg#FontAwesome") format('svg');
    font-weight: normal;
    font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助!

Ist*_*ros 21

为我解决了Firefox跨域字体问题(这导致Firefox中没有加载字体).只需将以下内容添加到.htaccess或直接添加到apache配置:

<FilesMatch "\.(ttf|otf|eot|woff)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>
Run Code Online (Sandbox Code Playgroud)

有一个网页,其中包含有关如何使用不同服务器设置CORS的说明:https: //enable-cors.org/server.html