display text in different font
- Started
- Last post
- 7 Responses
- ldww
know how most type websites let you write a sample word and then see it in the font you choose? how can i do this, but on a smaller scale (like 5 fonts)
- mitsu0
a simple way is to put every character of each font in its own image and then when a user enters a word, you just show the corresponding image to create the word... you can do this server or client side..
- n_m0
whoa mitsu, that's simple?
all you need to do is write the text out dynamically. when the user types the work, and wants to see it in, for example, times new roman (!), simple do:
document.write('<span style="font-family: times new roman;">'+form.userinput.valu...
you can do this for as many fonts as you like. just get the user to choose the font, and you would do something like:
document.write('<span style="font-family: '+form.userfont.value+';">'+f...
easy as falling off a log
- n_m0
whoops, forgot to say that you would embed these fonts obviously.
- mitsu0
n_m, my solution is for clients that don't have the font being displayed on their system...
good for sites where you can purchase fonts..
- n_m0
yeah, fair enough mitsu, wasn't thinking straight
- ldww0
can't you link a ttf file to a html? (if the user does not have the font) i think i remember being able to do this years ago...
- n_m0
http://hotwired.lycos.com/webmon…
dunno whether this will help