Bad idea. Why would you want to do this? Like you know how a particular font is gonna look on every machine in the world that's running XP. I think not!
Design your site to look OK in any browser or OS, only use a fudge if absolutely required, and then base it upon a browser's self identified capabilities, not upon some report from the navigator object.
That said, here's a link to a navigator object tool I wrote that will show you what you get:
http://home.comcast.net/~jscheuer1/side/nav_obj/
Everything in the property column can be got as:
So you could do like:
Code:
alert(navigator.userAgent);
to get the string. Or (looks like from here this may work):
Code:
<script type="text/javascript">
var osVer = /^.*Windows NT (\d\.\d+).*/.exec(navigator.userAgent);
if(osVer && osVer[1] < 6 && osVer[1] > 5.09){
do whatever;
}
</script>
It looks for 'Windows NT #.#' and pulls the number for testing if its there. According to:
http://msdn.microsoft.com/en-us/libr...spx#UATokenRef
Testing the range to be between 5.09 and 6 will get you
Windows Server 2003; Windows XP x64 Edition; Windows XP
all presumably XP or XP-ish.
But - Be aware, the default for XP is Clear Type off, though I would think most folks have turned it on by now. You cannot control or determine this. It will change most any font's appearance. And various browsers will render things differently even on the same XP machine using the same font. And the font you want might not be available on a given XP system and/or given browser on that system.
Bookmarks