View Full Version : accurate dynamic imagettftext "size"

08-06-2007, 11:19 PM
I've been trying to come up with a formula to give me a good "size" value for my dynamic image I'm creating.

(In case you don't know, the size is measured in points)

The image needs to fit into a 220x50 box.

I've found out that if the string is 6 characters or less, a "size" of 55 is good.
Anything greater then that, I just can't find a good formula to use to get the size.

I've tried to just use if length=x then size=y, but there would be way to many of those.

How could I get the size at a good value, so that the dynamic image fits in the 220x50 box?