For years web developers have bemoaned the state of typography on the web. We don't have much control and we have to choose between a small handful of fonts. The only real guarantee is whether our text is serif or sans-serif.
A new JavaScript library solves the problem in a way similar to the long popular sIFR, but without requiring Flash. Called typeface.js, the library reproduces truetype fonts by converting glyphs to JSON. It uses canvas, SVG graphics, or VML, depending on the browser.
Like sIFR, it lets you keep your content in your HTML, but replaces the text with the appropriate shapes. That means that screen readers and search spiders can still get at your content.
The download weight appears slightly larger than sIFR, but still a reasonable size considering the information it holds. The main JavaScript file is 16K, with most fonts weighing in at about 50K.
Original sIFR creator Shaun Inman doesn't appear all that impressed. In his link blog, Inman wrote:
Yes, it's not as perfect a solution as a built-in standard. The library has three fonts available, plus a tool to convert other truetype fonts to JSON, as long as you have the right to embed the font. The tool won't convert certain fonts it knows are restricted.
See also: