I'm using @font-face
on my company's site and it works/looks great. Except Firefox and Chrome will throw a 404 error on the .woff
file. IE does not throw the error. I have the fonts located at the root but I've tried with the fonts in the css folder and even giving the entire url for the font. If remove those fonts from my css file I don't get a 404 so I know it's not a syntax error.
Also, I used fontsquirrels tool to create the @font-face
fonts and code:
@font-face {
font-family: 'LaurenCBrownRegular';
src: url('/laurencb-webfont.eot');
src: local('☺'),
url('/laurencb-webfont.woff') format('woff'),
url('/laurencb-webfont.ttf') format('truetype'),
url('/laurencb-webfont.svg#webfontaaFhOfws') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'FontinSansRegular';
src: url('/fontin_sans_r_45b-webfont.eot');
src: local('☺'),
url('/fontin_sans_r_45b-webfont.woff') format('woff'),
url('/fontin_sans_r_45b-webfont.ttf') format('truetype'),
url('/fontin_sans_r_45b-webfont.svg#webfontKJHTwWCi') format('svg');
font-weight: normal;
font-style: normal;
}
The answer to this post was very helpful and a big time saver. However, I found that when using
FontAwesome 4.50
, I had to add an additional configuration forwoff2
type of extension also as shown below else requests forwoff2
type was giving a 404 error in Chrome's Developer Tools under Console> Errors.According to the comment by S.Serp, the below configuration should be put within
<system.webServer>
tag.Also check your URL rewriter. It may throw 404 if something "weird" was found.
Actually the @Ian Robinson answer works well but Chrome will continue complain with that message : "Resource interpreted as Font but transferred with MIME type application/x-woff"
If you get that, you can change from
to
and you will not have any Chrome console errors anymore !
(tested on Chrome 17)
If you are using CodeIgniter under IIS7 :
In your web.config file, add woff to the pattern
Hope it helps !
If you dont have access to your webserver config, you can also just RENAME the font file so that it ends in svg (but retain the format). Works fine for me in Chrome and Firefox.
This might be obvious, but it has tripped me up with 404s a number of times... Make sure the fonts folder permissions are set correctly.