views:

25

answers:

2

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;
}
A: 

I'm not having any problems, but my code looks a little different:

@font-face
{
    font-family: 'NewAthenaUnicodeRegular';
    src: url('fonts/new_athena_unicode.eot');
    src: local('New Athena Unicode Regular'), 
        local('NewAthenaUnicode'), 
        url('fonts/new_athena_unicode.woff') format('woff'), 
        url('fonts/new_athena_unicode.ttf') format('truetype'), 
        url('fonts/new_athena_unicode.svg#NewAthenaUnicode') format('svg');
}

Are your directory names correct? Why does 'local' have that funny face? And is this happening with all your fonts, or just these?

egrunin
i have my fonts on the root so my url is "/fontname.ext". The smiley is put there by fontsquirrel. However it's explained here: http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/ under "Bulletproof @font-face: Smiley variation"
dcp3450
Smiley face: see http://paulirish.com/2010/font-face-gotchas/#smiley
Matthew Wilson
I've also tried the "url(//:) format('no404')" fix but that didn't have any effect. The odd thing is, the fonts work in firefox and chrome. They
dcp3450
A: 

Solved it:

I had to use Mo'Bulletproofer method

dcp3450
Does that mean you're not using WOFF anymore? Could it be that your webserver isn't properly configured to serve WOFF files? E.g. see this: http://stackoverflow.com/questions/3594823/mime-type-for-woff-fonts/3627228#3627228
mercator
no the woff is encoded with base64
dcp3450
I tested the font with the encoding with other machines. Displays fine and no 404 error.
dcp3450
Can you post your new css?
egrunin
It wont let me. The encoding is way to long. It's explained here: http://paulirish.com/2010/font-face-gotchas/
dcp3450