字体awesome没有正确显示在Firefox /如何通过CDN出售? [英] Font-awesome not properly displaying on Firefox / how to vend via CDN?

查看:279
本文介绍了字体awesome没有正确显示在Firefox /如何通过CDN出售?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法得到字体真棒在firefox中正确显示,即使在localhost。我收到以下跨网域错误:

I can't get font-awesome to display properly in firefox, even in localhost. I'm receiving the following cross domain error:

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"); }

我使用了这篇文章建议的双引号: firefox @ font-face fail with fontawesome 但是没有解决问题。

I used double quotes as suggested by this post: firefox @font-face fail with fontawesome but that didn't resolve the problem.

在Chrome中一切正常;任何建议?

Everything works fine in Chrome; any suggestions?

除了在Chrome中解决这个问题,我应该如何通过CDN提供font-awesome的限制:http://dev.w3.org/csswg/css3-fonts/#default-same-origin-restriction

Beyond fixing the problem in Chrome, how should I vend font-awesome over a CDN given this restriction: http://dev.w3.org/csswg/css3-fonts/#default-same-origin-restriction?

下面是我的CSS文件的代码:

Below is the code from my CSS file:

@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;
}

感谢您的帮助!

推荐答案

解决了Firefox的跨域字体问题为我(这导致字体不加载在Firefox)。只需添加以下到 .htaccess 或直接到apache配置:

This solved the Firefox cross domain font issue for me (which causes the font to not load in Firefox). Just add the following to .htaccess or directly to apache config:

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

这篇关于字体awesome没有正确显示在Firefox /如何通过CDN出售?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆