1

My webfont isn't showing up.

Here's the @font-face declaration. I copypasted it from fontsquirrel. The directories are relative to the css file location.

@font-face{ 
    font-family: "DejaVu Sans Light";
    src: url("../fonts/DejaVuSans-ExtraLight-webfont.eot");
    src: url("../fonts/DejaVuSans-ExtraLight-webfont.eot?iefix") format('eot'),
         url("../fonts/DejaVuSans-ExtraLight-webfont.woff") format('woff'),
         url("../fonts/DejaVuSans-ExtraLight-webfont.ttf") format('truetype'),
         url("../fonts/DejaVuSans-ExtraLight-webfont.svg#webfont") format('svg');
}

CSS:

html { font-family:"DejaVu Sans Light", arial, sans-serif; }

Firebug's net panel says the font request is returning response code 200, but it's still showing the default font.

Edit: I also tested it in Chrome and IE, and it's not working there either.

zzxjoanw
  • 374
  • 4
  • 16
  • 1
    This http://stackoverflow.com/questions/14629382/font-face-not-loading-font and this http://stackoverflow.com/questions/14287465/font-face-not-loaded may be help you – Shehary Aug 16 '15 at 16:47
  • 1
    Are you using a local server for testing or the file system? – connexo Aug 16 '15 at 16:53
  • I'm using my local (WAMP) server. – zzxjoanw Aug 16 '15 at 16:57
  • What mime-type is your font delivered with? – connexo Aug 16 '15 at 17:05
  • 1
    Does it show in Chrome/IE? Check answer #2. http://stackoverflow.com/questions/2856502/css-font-face-not-working-with-firefox-but-working-with-chrome-and-ie/9570757#9570757 – connexo Aug 16 '15 at 17:07
  • application/x-font-ttf – zzxjoanw Aug 16 '15 at 17:08
  • It's not working in Chrome or IE either, but I added the lines to the htaccess file anyway. No luck :( – zzxjoanw Aug 16 '15 at 17:33
  • If you're developing for modern browsers, you don't need a million formats, [you just need the WOFF version](http://caniuse.com/#feat=woff). And with that said, are you testing from `http://`, or from `file:///`? And with *that* said, what does the network tab show for your webfont trying to get loaded. Does it even try to load it, is it a 404, etc? – Mike 'Pomax' Kamermans Aug 16 '15 at 20:09
  • I'm testing it using http; more precisely, I'm using my local (WAMP) server. Earlier it was returning a 200, but now it's not making the request at all, according to Firebug's net panel. – zzxjoanw Aug 16 '15 at 21:47
  • I'm a dumbass, bootstrap was overriding my css. Thanks for all your help. – zzxjoanw Aug 16 '15 at 22:03

0 Answers0