I stumbled upon a rather useful Javascript library the other day. Cufon allows you to use any font on your system, and use it in an HTML document.

How it does this is it takes the font you have specified, and generates a Javascript file containing the data for the font, which it then uses to replace the text on your page in a specified HTML tag with a canvas object containing the text rendered in the font which you encoded.



This text is in another font using Cufon.

The code to render the above text is given by

<script src="cufon-yui.js" type="text/javascript"></script>
<script src="Harrington_400.font.js" type="text/javascript"></script>
<script type="text/javascript">
	Cufon.replace('h6');
</script>
<h6 style="font-size: 20px;">This text is in another font using Cufon.</h6>

You can find out more at their site.

Share