UPDATE: The syntax has already been improved to favour IE9 loading WOFF instead of EOT, thanks to some sleuthing by the CSS Ninja.
UPDATE 2: The syntax now uses a ? instead of a # because local IE requests choked on the #.
Ethan Dunham of Font Squirrel and Fontspring fame has just released the definitive @font-face syntax. I’ve been hyping it up on my Twitter account, but this is too good to restrict to my followers there. The new syntax is clean, beautiful, and simple. It looks like:
@font-face {
font-family: 'MyFontFamily';
src: url('myfont-webfont.eot?') format('eot'),
url('myfont-webfont.woff') format('woff'),
url('myfont-webfont.ttf') format('truetype'),
url('myfont-webfont.svg#svgFontName') format('svg');
}
Here’s the magic he found:
The hack trick that makes this work is the ‘?’ following the EOT filename. Seriously.
Just awesome. Great work Ethan!
One Comment
Thanks for your trick. It’s so cool for use font on website.
I will study to take it now.
Thank you.