Set font dynamically to fit text

Ralph DiMola rdimola at evergreeninfo.net
Mon Oct 14 11:36:59 EDT 2019


I use the same technique as BR with a couple of diffs. I originally went down by 1's like BR but changed it for increased performance. I set the textsize to a large number(I like BR's initial size option) I then go down by 8s, add 7, down by 4s, add 3, down by 2s, add 1 finally down by ones until it fits. Each of the 4 loops has a check for min size so it down not go down below 2. I guess 2 is too low but it's been working.
I also have an option to fit either by height or width. 

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net





More information about the use-livecode mailing list