Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula for textbox size/lines/fontsize?

Status
Not open for further replies.

Leozack

MIS
Oct 25, 2002
867
0
0
GB
hi all - I was wondering if there was a formula for textbox size/lines/fontsize. eg given a textboxes size and the fontsize could you calculate how many lines would fit, for deciding whether you show a scrollbar etc? Or given an amount of lines and a fontsize know how big to make the textbox? I hope there is one, I'm using custom bodgejob stuff atm x.x'

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
I made a table comparing verdana fontsize with the minimum lineheight in flash incase anyone can make any formulas from this data? I can't see any patterns :/
Code:
verdana :
Fontsize	Minimum height	size->height	height% of size
100	=	125	=	+25	=	125%
50	=	64	=	+14	=	128%
25	=	34	=	+9	=	136%
10	=	16	=	+6	=	160%
5	=	10	=	+5	=	200%

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
Which value do you mean? And yeah I can't work this out, but surely somewhere there is a formula? Or at least just a way to know how big textboxes will be by the text in them etc? Or fitting text to fill a textbox etc?

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
I've tried some more and still can't work this out. Surely someone somewhere knows of a way or has tested it manually and made a cahrt/table or something? Anything at all would help - both with "how big would a textbox need to be based on amounts of text of known size" and "what size should this text be to fit inside a box of known size" etc o_O

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
Would .textHeight or .scroll be helpful for this issue?

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top