JavaScript: Image Headers
by Zildjian

HTML is so shite at lettering, although CSS allows you to make it 
less crap these days. What is the alternative to FONT tags for page 
headers? Well you could do a jpg for each page, but that's just a 
waste of web space to my mind. 

There is another alternative. Wouldn't it be great if you had a script 
that read a string and loaded a image for letter? Amazing, so that's 
what I wrote three or four years ago. 

// Programming by Marc Hall in October 2000 

function logo(msg) {
var times=(msg.length)
for (var i=0 ; i if (msg.charAt(i)==" ") {
document.write(' ')
}else
document.write('<IMG SRC="font/'+msg.charAt(i)+'.gif"> ')
}
}
// -->


Pretty snazzy that, but with a little modification we can go one better. 
Don't know if you remember the Anarchy Seeing is Believing demo, but it
 has a cool RGB font in it. I modified the script to have three colours :) 

// Coded by Marc Hall in October 2000 

function logorgb(msg) { var times=(msg.length)
var path="r"
for (var i=0 ; i if (msg.charAt(i)==" ") { document.write('') } else
if (msg.charAt(i)=="R") { path="r" } else
if (msg.charAt(i)=="G") { path="g" } else
if (msg.charAt(i)=="B") { path="b" } else
if (msg.charAt(i)=="Q") { document.write('
') } else
document.write('<IMG SRC="font' + path +'/'+msg.charAt(i)+'.gif">')
}
}


// --> 

Once you've loaded your script in, call it with something like this... 

Of course there is a problem with this script. Some servers will have 
problems with the filenames, try and get Windows to have !.gif. 

I've written one in PHP that uses the ASCII code of the letter which 
is much better, just takes a hell of a lot longer to cut and paste though. 

That's all. You can download the scripts here