Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firefox @font-face fail with fontawesome

I'm using the FontAwesome font on an OSS app I'm running and I can't seem to get past Firefox's font sanitizer.

The files are all served out the same domain, the paths are correct, and I'm using the official css from FontAwesome which works in Firefox when served via their site and the local docs.

So I must be missing something simple.

live url: https://bmark.us

[11:39:02.945] downloadable font: invalid version tag (font-family: "FontAwesome" style:normal weight:normal stretch:normal src index:0)
source: http://127.0.0.1:6543/static/font/fontawesome-webfont.eot @ http://127.0.0.1:6543/static/css/responsive.css
[11:39:02.945] downloadable font: rejected by sanitizer (font-family: "FontAwesome" style:normal weight:normal stretch:normal src index:0)
source: http://127.0.0.1:6543/static/font/fontawesome-webfont.eot @ http://127.0.0.1:6543/static/css/responsive.css

Are examples of Firefox's errors when I try to correct this via dev. I've tried to do full root paths /static/font and relative to the css ../font/ and it always fails with these errors for me.

Everything works in Chrome and such. It only seems Firefox hates me. I've searched through the other answers and I've got the whole series of font faces.

https://github.com/mitechie/Bookie/tree/develop/bookie/static/font

Thanks for any hints.

like image 864
Rick Avatar asked Jun 17 '12 15:06

Rick


1 Answers

I ran into the same problem on one of my clients websites.

@font-face {
 font-family: 'SourceSansProBlack';
  src: url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/eot');
  src: url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/eot') format('embedded-opentype'),
       url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/woff') format('woff'),
       url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/ttf') format('truetype'),
       url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/svg') format('svg');
}

The above worked in firefox. The one below didn't work.

@font-face {
 font-family: 'SourceSansProBlack';
  src: url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/eot');
  src: url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/eot') format(embedded-opentype),
       url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/woff') format(woff),
       url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/ttf') format(truetype),
       url('http://everythingfonts.com/font/face/HwlUPF6WEeKcF1DlSVDSjg/svg') format(svg);
}

Turns out the format specifiers need to be quoted like format('svg'). Some of the css stylesheets served by the sites don't quote the format specifiers. I have experimented with the path with both single and double quotes and that didn't make any difference. So I can say that it is the problem with unquoted format specifiers rather than the double/single quoted paths.

like image 73
dors Avatar answered Oct 24 '22 20:10

dors