[Solved] Re: Looking for an idea to ....
rolf.kocherhans at id.uzh.ch
Wed Feb 24 09:43:43 CST 2010
I finally had time to try out all the suggestions i got to shrink text automatically
so that it fits into a field of a fixed with.
Saharas method (which is the same as Andre G. suggested) works
best for my purpose. I like the repeat loop which makes the font smaller
but only to a certain size :-)
I am very happy with this solution thanks Sarah and oll the others
for your help.
Here is the script again:
-- shrink font until it fits, down to a minimum of (original size minus 5 <- see at the repeat loop)
set the textSize of fld "fldMailAddress" to 14
put 14 into tStartSize
repeat 5 times
if the formattedWidth of fld "fldMailAddress" > the width of fld "fldMailAddress" then
subtract 1 from tStartSize
set the textSize of fld "fldMailAddress" to tStartSize
show fld "fldMailAddress"
More information about the use-livecode