Reputation: 5257
I'm having a problem getting font-face to work correctly. I'm defining it as such:
@font-face {
font-family: "creampuff";
src: local("☺"), url(/fonts/CREAMPUF.TTF) format('truetype');
}
This works completely fine if this font is installed on the machine (I have 3 machines here, one has the font installed and it works, the other two do not, and it renders a different font.) It only renders incorrectly in Firefox and Chrome, Safari is able to render it just fine:
Both Chome and Firefox render it like this:
However, if I disable the style in Chrome's web inspector (defined as: 'font-family: creampuff;') it definitely has an effect, changing the font to:
I can't really even figure out where to start debugging. I've checked the network tab in Chrome, and it definitely loads the font successfully. Opening the font file shows everything correct, and on my other machine where I have the font installed locally, it functions correctly across all browsers.
Any idea how to go about resolving this?
Upvotes: 2
Views: 4474
Reputation: 1
Didn't work for me either but what finally did work was changing the name of the font-family from the long name to the short name: from "Swiss 721 Black Extended BT" to "Swis721 BlkEx BT".
Upvotes: -1
Reputation: 486
Perhaps try to add font-style: normal
to the css:
@font-face {
font-family: "creampuff";
src: local("☺"), url(/fonts/CREAMPUF.TTF) format('truetype');
font-style: normal;
}
If that doesn't work you can alway try to convert the font into other formats. FontSquirrel has a handy tool to do this: http://www.fontsquirrel.com/fontface/generator. It will even generate the css for you if you want.
Upvotes: 4