HTML5 and @font-face with IE
I've been trying to get @font-face to render for the last 2 hours using a kit from font-squirrel. Check out this link and you'll see开发者_开发问答 that in all non-IE browsers everything is peachy, but in IE it fails to render entirely...
Here's my font-face code:
@font-face {
font-family: 'CartoGothicStdBook';
src: url('../cartogothicstd-book-webfont.eot');
src: url('../cartogothicstd-book-webfont.eot?#iefix') format('embedded-opentype'),
url('../cartogothicstd-book-webfont.woff') format('woff'),
url('../cartogothicstd-book-webfont.ttf') format('truetype'),
url('../cartogothicstd-book-webfont.svg#cartogothicstdbook') format('svg');
font-weight: normal;
font-style: normal;
}
What am I missing? The fonts are in the root directory, as well as the stylesheet (although I don't think it makes a difference). Is it because HTML5 tags (I'm using HTML5 shiv) can't use @font-face pre-IE9?
Hope to hear from the jedi-coders out there soon,
Have you tried using the polyfill - modernizer2.js from http://www.modernizr.com/ instead of the html5 shiv. @font-face is a css feature that is detected by Modernizer see http://www.modernizr.com/docs/#features-css
精彩评论