...

View Full Version : Check for font face?



Reno CF
02-04-2004, 04:25 PM
Does anyone know if there is a script that could be placed on a webpage so a person could check to see if they have a specific font face installed on their system?

For example, let's say there is this line:

"This page is best viewed in Tahoma Bold -- you can [check to see] if that font is installed in your fonts folder"

If a person clicked "[check to see]" they'd get a simple alert that would either say "Font is installed" or "Font is not installed".

Is something like that even possible??

Thanks for any feedback....

Roy Sinclair
02-04-2004, 05:15 PM
There are some "font checking" scripts available but they've got limitations which might preclude them be being able to do exactly what you want. The question that comes to mind though is how such a script would be of benefit to an end user (to be honest, I don't think most end users care what font is used as long as everything's legible).

Reno CF
02-04-2004, 07:46 PM
The question that comes to mind though is how such a script would be of benefit to an end user
I agree that it has limited use, but here's how I see using it....

The people who frequent this forum are computer savvy so they know what fonts they're using. However much of the populace at large doesn't have a clue what is on their machine. Every now and then someone will ask me to work on their web page and will want some exotic font. I of course go through the whole routine about cross platform fonts, but they think if they can see it in Dragonswick, surely everyone else can as well.

With the js I was wondering about, I'd put up a simple small page that they and their friends/family could access. I'd ask them to have 10 people go to that page and check to see if "Dragonswick" was on their machine -- when 10 people said "no", they'd understand that sticking with arial, verdana, helvetica, courier, etc is the only thing that makes sense.

So it would be a tool that anyone who frequents CodingForums.com could utilize for the same purpose.

If anyone has an idea where such a script could be found (I looked without any luck), I'd appreciate it.....

Roy Sinclair
02-04-2004, 09:26 PM
Excellent reasoning. Here's one place I can remember quickly that'll get you started: http://www.webreference.com/dhtml/column30/index.html

Here's a discussion (with code) that's right here on this forum: http://www.codingforums.com/showthread.php?s=&threadid=16704&highlight=installed+font

Roy Sinclair
02-04-2004, 10:01 PM
I took the code from the other thread and created the following simple page:



<html>
<head>
<title>Lists all Fonts (IE 6+ Only)</title>
</head>
<body onload="List_All_Fonts();">
<object id="dlgocx" height="0" width="0" classid=clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b>
</object>
<script type="text/javascript">
var fontFound = false;
function List_All_Fonts()
{
var txt = '';
var dlghelper = document.getElementById("dlgocx");
if (typeof(dlghelper.fonts) != "undefined")
{
var fontObj=dlghelper.fonts;
var fontCount;
if (typeof(dlghelper.fonts) != "undefined")
{
fontCount=dlghelper.fonts.count;
for (var i=1;i<fontCount;i++)
{
txt += "<p>" + dlghelper.fonts(i) + "</p>"
}
}
}
document.getElementById('fontcheck').innerHTML=txt;
return true;
}
</script>
<span id="fontcheck">
Testing ...
</span>
</body>
</html>

Willy Duitt
02-04-2004, 10:24 PM
Hi Roy;

It crashed my browser (IE6.2) when I tried to run the codes.

Just thought you would like to know. :)

.....Willy

Reno CF
02-04-2004, 10:35 PM
Thanks Roy -- that works perfectly! I really appreciate you putting this together... hopefully it will help make it clear that "your font is not necessarily my font"!

Roy Sinclair
02-05-2004, 02:46 PM
Originally posted by Willy Duitt
Hi Roy;

It crashed my browser (IE6.2) when I tried to run the codes.

Just thought you would like to know. :)

.....Willy

That's what you get for riding a Longhorn.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum