textarea automatic resize and proportional fonts

P

petermichaux

Hi,

I have been experimenting with some textarea automatic resize scripts.
Most that I have found count the number of characters in the textarea
and divide by the number of columns. This works will with monospaced
fonts or with just wide letters like 'M'. However if I fill the text
area with proportional font 'i' characters then a lot of white space
builds up at the end of the text area. Is there a way to account for
proportional fonts to avoid this whitespace?

Thanks,
Peter
 
I

Ivo

I have been experimenting with some textarea automatic resize scripts.
Most that I have found count the number of characters in the textarea
and divide by the number of columns. This works will with monospaced
fonts or with just wide letters like 'M'. However if I fill the text
area with proportional font 'i' characters then a lot of white space
builds up at the end of the text area. Is there a way to account for
proportional fonts to avoid this whitespace?

Sounds not very userfriendly to me. You could try creating a selection of
the text in the area, read the boundingwidth, -height, -left and -top of the
selection range object thing, that would give you the exact dimension of the
textblock, at least in some browsers, but I 'd rather you leave my textarea
alone, frankly. Or provide a means for me to drag it to the size I like.
Like some other scripts out there demonstrate.
hth
ivo
 

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,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top