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"); }
I used double quotes as suggested by this post: firefox @font-face fail with fontawesome but that didn’t resolve the problem.
Everything works fine in Chrome; any suggestions?
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?
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;
}
Thanks for your help!
This solved the Firefox cross domain font issue for me (which causes the font to not load in Firefox). Just add the following to
.htaccessor directly to apache config:There is a webpage with instructions on how to set up CORS with different servers:
https://enable-cors.org/server.html