Serving web fonts from IIS
I’ve just started playing with web fonts for a site redesign. I came across the following gotcha (thanks, Firebug, for alerting me to it!).
If you are running IIS 6 or higher on your web server, some of the fonts will be disabled by default.
Your typical @font-face declaration might look like this:
@font-face {
font-family: 'VegurRegular';
src: url('Vegur-R_0500.eot');
src: local('Vegur'),
local('Vegur-Regular'),
url('Vegur-R_0500.woff') format('woff'),
url('Vegur-R_0500.ttf') format('truetype'),
url('Vegur-R_0500.svg#Vegur-Regular') format('svg');
}
This will deliver one of four different font formats, depending on your browser’s capabilities. (The font is Vegur, a really nice-looking free font I found over at Font Squirrel).
By default, the MIME types in IIS 6 are configured to deliver EOT (as used by IE) and TTF files. But WOFF (Firefox) and SVG (iPhone, iPad & others) will not be served.
Simply add the following MIME type declarations via IIS Manager (HTTP Headers tab of website properties):
.woff application/x-woff .svg image/svg+xml
…and everything should work fine.
Comments
- L
-
Very helpful. Thanks!
- 13 January 2011, 21:08
- Reply
- chetan
-
thank you so much....
- 12 April 2011, 11:06
- Reply
- alibaba
-
thanks!!!
- 14 May 2011, 02:49
- Reply
- Llad
-
Thank you!
- 21 June 2011, 16:04
- Reply
- ahorn
-
thank you!
- 25 June 2011, 18:55
- Reply
- Keith
-
This just saved my night. Thanks man. Now you can see the website that benefited from me fixing this config at: http://www8.healthcare.philips.com/events/astonishtf/
- 29 July 2011, 02:20
- Reply