Cufon
Flash text solution sIFR may currently be the web developers favoured choice when it comes to font replacement, but the developers of Cufón aim to change that with this fast, flexible alternative.
Cufón’s website provides a font conversion program which converts fonts in to (encrypted) JavaScript files. Simply include the Cufón library and font JavaScript on your page, specify what you would like to convert and Cufón will do the rest.
In order to achieve popularity among the masses, the developers of Cufón set themselves some goals, all of which have now been met:
- No plug-ins required – it can only use features natively supported by the client
- Compatibility – it has to work on every major browser on the market
- Ease of use – no or near-zero configuration needed for standard use cases
- Speed – it has to be fast, even for sufficiently large amounts of text
By default Cufón uses CSS rules, but combined with popular frameworks such as jQuery, MooTools, Dojo or Prototype it can use the same selector statements automatically. The code for using Cufón is incredibly straightforward, proving it really does require near-zero configuration. The following code will render all H1 elements in Calibri:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="cufon-yui.js" type="text/javascript"></script>
<script src="Calibri_700.font" type="text/javascript"></script>
<script type="text/javascript">
Cufon.replace('h1');
</script>
</head>
<body>
<h1>This header is in Calibri.</h1>
</body>
</html>
Cufón has a few advantages over Typeface.js, such as support for a greater number of browsers and font types. If you want to check out a sample of the two techniques output side-by-side, Kilian Valkhof has provided a comparison.



Related demos