Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font-face does not work on firefox. Works well on others

I have a project that's been using font-face without problem for some time. Today I checked and font face is not working on firefox v14 and v15 provably also not working on v12+ as is the case in this thread: http://css-tricks.com/forums/discussion/17337/font-face-problem-with-firefox-v-12/p1 My problem is exactly the same as in the previous thread.

To summarize. I'm using font face to load web fonts like this:

@font-face {
    font-family: 'TradeGothicLTStdCnBold';
    src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot');
    src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot?#iefix') format('embedded-opentype'),
         url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.woff') format('woff'),
         url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.ttf') format('truetype'),
         url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.svg#TradeGothicLTStdCnBold') format('svg');
    font-weight: normal;
    font-style: normal;

and then

#bea .bea {
    font-family: 'TradeGothicLTStdCnBold';
    font-size: 14px;
}

The fonts are loading correctly according to firebug. It works on safari, chrome, IE and some firefoxs. I've tried 6 firefoxs (v13-15) and it worked in some of them and not on others. I haven't been able to establish any reason why.

I've also looked for the firefox configuration value gfx.font_rendering.cleartype.always_use_for_content; And i've noticed is set to false in all the firefoxs I tested, even the ones that work correctly.

Live example: http://comoquierascolacao.com/jovenestalentos/

How it should look: http://postimage.org/image/n2r9fxdsv/how it should look

To summarize: - The routes work. - The routes are in the same domain, no cross-domain issues. - It does work in some firefoxs and it doesn't in others (no reason that i can figure out). - It did work in my own firefox before, maybe prior to v12.

Thank you all, any help will be greatly appreciated because this is driving me nuts.

like image 436
Miquel Adell Avatar asked Feb 19 '23 04:02

Miquel Adell


1 Answers

Well, my fault. It was a crossdomain problem after all. The fonts where loaded from www.domain...even when accessing http://domain... Reddirecting everyone to www.domain should solve the problem and I think will be a good practice from now on. Another solution would be to load the fonts with relative routes.

like image 153
Miquel Adell Avatar answered Mar 05 '23 18:03

Miquel Adell