To whomever is still reading this, it’s 2011. Have a look at @typekit or @fontdeck or the likes, sIFR has gone unsupported for years.
Fortunately, we now have @font-face to put almost any font on a web page. There are two basic ways to accomplish this: 1. Serve your own font files from your own server, or 2. Use a service like TypeKit or Google Web Fonts.
Typekit has gotten pretty popular, but I’ve been pretty skeptical about those kind of services – why not just buy the fonts you need and serve them yourself? You don’t have to pay recurring costs, you don’t have to worry about exceeding pageview limits, you don’t have to worry about the service going down, and you can use as many fonts on as many sites as you like.
When I built this site, I included five embedded fonts (mostly variants of one typeface). I was feeling pretty good about it until I took a look at the ‘Net’ tab in Firebug. My five fonts were about 90KB spread across five HTTP requests. Not fantastic – especially for mobile devices and other slow connections. And this is where Typekit and Google have come up with something that might be worth paying for.
A neat CSS trick is that you can embed files right within the style sheet wherever you have a url property, like this:
You can do this with fonts as well – which means that I can encode all five of my fonts and stick them into one style sheet – removing five HTTP requests. Awesome!
But unfortunately, it’s a bit more complicated than that.
If you want your fonts to work in most browsers and in older versions of iOS, you need to include four different types of font files (like so), and the browser will download the first compatible font file. If I include all four versions encoded into in a single style sheet – I’m going to quadruple the size of the style sheet. Less HTTP requests, but much more data. Bummer.
What Typekit and Google Web Fonts do is dynamically send each browser only the compatible file type for that browser. Pretty cool. No matter how many fonts you have, they’re downloaded in a single, optimized style sheet.
On the bright side, WOFF is gaining widespread support: IE9+, FF 3.6+, Chrome, Safari 5.1+, Opera 11.1+, and iOS 5+. So if you can do with supporting just those browsers – encode your WOFF files into a single style sheet and rock on.