views:

422

answers:

3

This is CSS code

@font-face {
    font-family: 'FuturaStdBook';
    src: url('site/font-face/futurastd-medium-webfont.eot');
    src: local('☺'), url('site/font-face/futurastd-medium-webfont.woff') format('woff'), url('site/font-face/futurastd-medium-webfont.ttf') format('truetype'), url('site/font-face/futurastd-medium-webfont.svg#webfont') format('svg');
    font-weight: normal;
    font-style: normal;
}

h2 {font-family:'FuturaStdBook', sans-serif}

Can it be related to mime type?

How can i ensure my path is right?

+1  A: 

The problem are the definitions of font-weight and font-style in your font-face declaration. Since h2 elements are defined in a bold face by default, the font-face rule is not taken into account for these elements (because the browser thinks, the font file is for normal weighted weight only, which is most probably true).

Solution: You need a second font-face declaration with font-weight: bold in it or you set h2 elements to have font-weight:normal and font-style: normal.

Boldewyn
still not working. How can i confirm path is correct and font-face is loading properly , problem is something else?
metal-gear-solid
Do you use Firebug? If yes, in the "network" tab, is the font ever downloaded? Is it the right URL?
Boldewyn
...and what are the response headers? You could update your question accordingly to help finding answers.
Boldewyn
@Boldwyn - how to know using firebug net tab , font is downloading or not?
metal-gear-solid
@Boldewyn - No info about font in response headers
metal-gear-solid
+1  A: 

Try using Font Squirrel to get a bullet-proof CSS declaration for your custom font.

Tim Hettler
I'm already using.
metal-gear-solid
+1  A: 

If you're using IIS, you'll need to register a MIME type for the .eot extension.

  1. In IIS Manager, in the IIS section, open the MIME Types configuration
  2. Under "Actions", click "Add..."
  3. Enter .otf in the extension box, and application/octet-stream in the MIME type box.
  4. Click OK

You'll need to do this for each non-standard extension you use (.ttf is already registered, .woff is not), but that should do it!

Daniel Schaffer
+1 Thanks for this info. yes i'm using IIS
metal-gear-solid
I actually just went through this last week... IIS doesn't know how to serve the file, so the request just ends up a 404.
Daniel Schaffer