Display custom fonts, using only html code

If I you want to use a font style which is not loaded in a user's system, normally you may convert the same text into graphics in .gif and .jpeg format and upload it as a image called into web page. Which adds to the size of the page and rendering time also increases. Till now, though there are many hacks to load custom fonts, they were mostly few browser specific. Here's an interesting solution, just by using javascript and HTML coding custom font written text can be rendered in a browser.

Instead of creating images or using flash just to show your site's graphic text in the font you want, you can use typeface.js and write in plain HTML and CSS, just as if your visitors had the font installed locally. This is a work in progress, but functional enough at least to render the the graphic text on this site. Here's what it takes to get going: load the typeface.js library and some typeface.js fonts, then proceed like normal here:

>> Using Custom fonts at Typeface.js

0 comments: