Client-side font list
Client-side font list
(OP)
I remember someone recently asked how to find out if a user had a certain font installed on their computer.
Unfortunately, I can't find the post anymore, but here's more information on how to do this on a webpage (when viewed using IE 6).
This information comes from Microsoft's MSDN library at:
http://msdn.microsoft.com/library/default.asp?url=/libr...
<HTML>
<SCRIPT>
function getFonts()
{
var nFontLen = dlgHelper.fonts.count;
var rgFonts = new Array();
for ( var i = 1; i < nFontLen + 1; i++ )
{
rgFonts[i] = dlgHelper.fonts(i);
}
rgFonts.sort();
for ( var j = 0; j < nFontLen; j++ )
{
document.write( rgFonts[j] + "<BR>" );
}
}
</SCRIPT>
<BODY onload="getFonts()">
<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-
00aa00bdce0b" width="0px" height="0px">
</OBJECT>
</BODY>
</HTML>
Dan
Unfortunately, I can't find the post anymore, but here's more information on how to do this on a webpage (when viewed using IE 6).
This information comes from Microsoft's MSDN library at:
http://msdn.microsoft.com/library/default.asp?url=/libr...
<HTML>
<SCRIPT>
function getFonts()
{
var nFontLen = dlgHelper.fonts.count;
var rgFonts = new Array();
for ( var i = 1; i < nFontLen + 1; i++ )
{
rgFonts[i] = dlgHelper.fonts(i);
}
rgFonts.sort();
for ( var j = 0; j < nFontLen; j++ )
{
document.write( rgFonts[j] + "<BR>" );
}
}
</SCRIPT>
<BODY onload="getFonts()">
<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-
00aa00bdce0b" width="0px" height="0px">
</OBJECT>
</BODY>
</HTML>
Dan
RE: Client-side font list
CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b"
Isn't that cheating? LOL
Do they have a reference to all the possible clsid: on msdn? :/
----------
I'm willing to trade custom scripts for... [see profile]
RE: Client-side font list
It was me that started the original post, I have a use for this - the only problem is it don't work for me - I get an error
dlgHelper.fonts.count is null or not an object.
I am using ie6 on xp pro - any ideas why it wont work?
Thanks
Simon
RE: Client-side font list
You need to make sure the clsid has no line break in it... It should be one long continuous string:
"clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b"
Hope this helps!
Dan (although everyone seems to call me Billy despite the fact I always sign my posts off as Dan! *shrug*)
RE: Client-side font list
Thanks, fantastic - exactly what I was looking for - I've given you a star - but you deserve more!!
Simon