Dynamically detect text-size?

T

The Plankmeister

Hi...

Is there a way of calculating the pixel value of the width/height of a
string, taking into account the font being used?
For example, in Arial 14px, the following is 100 pixels wide and 10 pixels
high:

this is some text


Plankmeister.
 
E

Evertjan.

The Plankmeister wrote on 19 aug 2003 in comp.lang.javascript:
Is there a way of calculating the pixel value of the width/height of a
string, taking into account the font being used?
For example, in Arial 14px, the following is 100 pixels wide and 10
pixels high:

7th of August in this NG:

<http://tinyurl.com/kgi0>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top