473,498 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

textextend

Hello,

is there a function that I can feed a string and returns the number of
pixels it is going to use to be displayed ?

thanks,

Ron
Dec 19 '07 #1
1 1146
Ron Croonenberg wrote on 19 dec 2007 in comp.lang.javascript:
is there a function that I can feed a string and returns the number of
pixels it is going to use to be displayed ?
No, because that depends on the font-family, the font-size, the font
weight, etc. and the browser implementation of that and the user override
settings.

You could measuer it programmaticly AFTER it is displayed.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.