views:

167

answers:

2

Is there a way to determine over the web if a user has a particular font installed?

+2  A: 

There is no way to do this from the server.

Your best chance will be to perform a check client side (e.g. in JavaScript). See this article for example

Edit:

I did a little more digging and found a better thought through implementation of the same technique by Luke Smith.

Treb
Interesting solution, the only problem is it relies on Comic Sans. I know it's not on most Linux installs by default, and I doubt it comes with a Mac...
DisgruntledGoat
Oops - yes, too Windows centric.
Treb
I don't have this font on my machine
Dmitri Nesteruk
+3  A: 

It's probably best to stick to the most common fonts, using fallbacks. The following CSS snippet uses Helvetica (Mac) if available, then FreeSans (Linux), then Arial (Windows), then the user's default sans-serif font if none of those are present (a very rare occurrence).

.class1 { font-family: helvetica, freesans, arial, sans-serif; }

Another option is to use progressive enhancement with @font-face with your chosen font, which is supported by Firefox 3.5, Opera 10, and (I think) Safari. See this article at Mozilla for details.

DisgruntledGoat
I agree, both methods (progressive enhancement and the one proposed by me) are not reliable on the variety of browsers and OS's out there. Better to use fallbacks, it's a technique that has proven to work under most circumstances.
Treb