PDA

View Full Version : Detecting fonts in the user's computer


NathaliaMota
06-09-2005, 01:35 AM
How can I detect whether an user has a particular font on his computer?

glenngv
06-09-2005, 04:00 AM
No way to do this using javascript. Just specify alternative fonts in CSS.
<style>
body {
font-family: Verdana,Tahoma,Arial;
}
</style>
But if you're using uncommon fonts, then the only viable solution is to provide a download link and have a note in your page. Something like:

This page is best viewed using this font: <img src="verdana.gif" alt="Verdana font" />. If you see the font here different than that of the image, I recommend you to <a href="verdana.ttf">download</a> it and install in your system.

entint
06-09-2005, 04:48 AM
There's also a way to use dynamic text replacement (replaces text you specify with an image that utilizes the font of your choice), which you can find a tutorial for on A List Apart (http://www.alistapart.com/articles/dynatext/). Just presenting another option.