Google Font Replacement API
Designers of web content, rejoice! Tired of using the same six web safe fonts for all of your websites? Another solution to the boring web fonts problem is now being offered by a collaboration between Google & TypeKit.
For many years, web browsers have actually supported custom font embedding in web pages using simple CSS rules -- even IE6 supports it! But there were always two major roadblocks to universal adoption of the technique: 1) Internet Explorer only supports embedding the proprietary EOT font format, which is designed to convert and embed a regular font file into a format that discourages unlicensed use of the font. Other browsers (like Firefox) only support embedding TTF or OTF files. 2) Web administrators were weary of serving the font file raw, because they could be sought after for illegally distributing the font. Font foundries were weary of allowing designers to embed due to possible widespead distribution and unlicensed use.
Google Font API solves Problem 1. Because the two browser groups support different font formats, it really comes down to a server based solution which detects the user’s browser and serves the appropriate CSS and font format (TTF or EOT). All you have to do is put 1 line of HTML which grabs a CSS file from Google and you’ll have access to apply the font in all browsers including Firefox, Chrome, Safari, Opera, and IE6/7/8.
Google has sort of approached Problem 2 by creating a free font directory which will serve up 18 stylish fonts under an open source license so there will never be a problem using them legally. If you would like to use another font that is not in the Google Font Directory, you can check if it is in the TypeKit directory, and change a few lines of code to point to that provider -- but you have to pay a nominal fee for access to the TypeKit library fonts.
Here is how the Google Font API differs from other techniques:
- sIFR allows you to use any font you want, and loads everything from your own server. But it does require you to convert your font into a SWF file using a free tool, and it requires Flash support which might slow down the user's browser. Also, sometimes sIFR just doesn’t look right, or parts of the page blink when loading.
- Roll your own - You can serve up your own raw TTF or EOT file from a PHP or other server based script, doing some basic browser sniffing to send the correct CSS & font to the user. This is like what Google & TypeKit are doing but instead you'd be doing it from your own server. But be warned, you aren’t legally allowed to do this for most proprietary font files!
This just in! Google has now added a Font Previewer page so you can dynamically play with the font faces, sizes, and styles right in the browser. When you're satisfied, simply copy & paste the code to use it on your website!