For a very long time, the web was filled with very plain fonts.
Unpleased with this lack of variety, a group of developers invented
sIFR had a problem: not everyone liked or used Flash. It was also slow.
Then, David Chester created
typeface.js was slow to load and required large files.
And most recently from Simo Kinnunen came
cufón, which we will look at here.
cufón‘s full size is ~26kb, while the default download, which is compressed with YUI, is 14kb. It is supported by most modern browsers, and Internet Explorer 6 as well.
One of the best things about
cufón is it’s incredible speed. Before it, mass text replacement wasn’t very practical, as both
typeface.js took a while to work their magic. With
cufón, huge blocks of text are rendered in less than half the speed of the other two. You can take a look at our demo, in which we have several medium and long paragraphs replaced using
Compare this process to
sIFR which requires you to convert the font to a flash movie. Not only does this take more time than necessary,
sIFR also needs the font to be downloaded again and again for different sections of replaced text, increasing load time.
cufón, uses a Javacript font file, but these are quite a bit larger, usually start around 60kb.
After generating the font file, you simply import both the
After that, you call
cufón to replace your desired selector:
cufón can take advantage of its selectors. For example, if you had jQuery imported, you could do:
Cufón also supports multiple fonts. For example, let’s say you wanted your
h1 to have
ABC font and your
ps to have
XYZ font. You would do the following:
How it Works
canvas element in modern browsers, and
VML in Internet Explorer. These elements allow the generation of text in non-standard fonts. However, a downside of this is that text highlighting is not supported.
Cufón is very cool, small, and fast. It is supported by most browsers that users will use, and supports multiple font formats. However, it’s implementation does not support text highlighting as of yet. Overall, it is a very nice piece of work and is very easy to use. It shows a lot of promise and should only improve with time.
Go ahead and give cufón a try. I do believe that you will be pleasantly surprised. Feel free to leave any suggestions or experiences in the comments.