Textbox width according to the characters present in the textbox.

26 views
Skip to first unread message

P

unread,
Dec 17, 2013, 1:35:11 AM12/17/13
to google-we...@googlegroups.com
Hi,

I need to set the size of the text box according to the length of the text inside that box, it may contain localized characters like Chinese. Is any we can calculate the length in pixels for this?

Thank you,
Parag   

Andrei

unread,
Dec 17, 2013, 8:40:04 AM12/17/13
to google-we...@googlegroups.com
You can only approximate.

(1) Users may not have a specified font. Browsers will try to substitute this font, and the width of characters maybe different for a substitute font.

(2) Users can zoom in or out, changing the font size from the one you set.
Reply all
Reply to author
Forward
0 new messages