Blog, blog, blog.

No, you won't find any navel gazing, political talk or Hollywood gossip here. But we are always searching the Internet for the newest trends and technologies in web development. So in addition to news about Quo Vadimus, also be sure to stop by our blog for regular contributions about the latest web techniques, tips and resources. (Hey, we did mention we're geeks.)

Cufon:An Alternative Font Replacement

Info

Author:Jose

Date:Mar 27, 2009 - 11:38 PM

Categories: Development, Javascript, Tutorials

Over the last few years, I've enjoyed using the excellent sIFR technology to enhance the typography of headers and certain links.In fact, the headers on the home page of this site for the last year or so have been rendered with it. But I have to admit it's never been terribly easy to implement. As of today, I've started using a new solution called Cufon.

Which uses SVG and VML along with the <canvas> element to render the font. The one major drawback for me is that text isn’t selectable, but the developers are working on it and there should be a fix soon. It’s ridiculously easy to implement:

First, download the javascript files from gitHub. Next, you can use their font generator to create the neccesary code. Once you have those two files, simply link to them in the head of your document:

<script src="cufon.js" type="text/javascript"></script>

<script src="your_font_generated_javascript_file.js" type="text/javascript"></script>

And then simply activate it as follows:

 Cufon.replace('h2');

Easy, right?

Your name is required.
A valid email is required.