Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
let's assume you can use a font which renders exactly the same in all browsers and is per default installed on all OSes...
You can use Javascript to determine the pixel length of this font! E.g. by reading the coordinates of embracing links, this already worked with Netscape4-"DOM" and I used it this way to get font-width. So just send a HTML-Page to your browser with the font and the JS and read out the results. You can do it via a webserver and a form-submit (or AJAX's XmlHttpRequest) with the results or even by remotely telling a local Firefox to load and save the (enriched) local webpage (-remote option)
Cheers Rolf UPDATE: Should even be possible to send the JS-Code via telnet to a MozRepl AddOn in FF. NOTA BENE:This solution implies at least one running webbrowser, but gives you real control and testing over the resulting page. UPDATE2: Well seems NS4 was also the last browser to support link-coordinates, but I'm sure that standard DOM has even much richer possibilities. ... indeed style.left, style.top or offsetLeft, offsetTop In reply to Re: Pixel length of strings (Javascript+DOM)
by LanX
|
|