March 31, 201016 yr Hi everyone, I have only just come across typeface.js and cufon as options for text replacement. They seem pretty cool. Are there any major drawbacks (aside from needing javascript enabled). Is it possible to style the elements alternatively with CSS as well (so that if JS is turned off, you can get it to degrade semi-gracefully with other fonts)? Cheers! Martin
March 31, 201016 yr As far as I know you just code a cross-browser font-family like arial or sans-serif in the body style (or a div style) and that's what shows if Javascript is disabled. Some alternatives here:- http://www.dezinerfolio.com/2009/03/31/dynamic-font-replacement-solutions but few comments on how they work but if you click a blue name it will take you to the website where some have a forum and knowledge base. typeface.js says Supported browsers include Firefox 1.5+, Safari 2+, and Internet Explorer 6+. Things will degrade gracefully for other browsers. Users browsing with their PDA's, for example, will still see your text there--it just won't be quite as pretty. Search engines will see your graphic text now too, without having to rely on OCR or "alt" properties.
March 31, 201016 yr Author Thanks! Looking through the options available, javascript font replacement seems to be the best all-round solution (especially for navigation/headings etc, where text-selection isn't such an issue). I wonder if there is a way to add security (so people can't download the JS file and use it themselves) by having the javascript in a PHP file in a if(defined('BASEPATH')) { } block to ensure that only index.php (or whatever) can access it. M
March 31, 201016 yr When you generate a font file with cufon, http://cufon.shoqolate.com/generate/ you can specify which domain your using the font, for added security.
March 31, 201016 yr I've detailed a bit of how I used cufon in a project here: http://superpositionkitty.com/2010/03/cicada/ Text selection for body text isn't so much of an issue as much as the fact that over 1000 characters being replaced will really slow your site down and isn't recommended.
Create an account or sign in to comment