RE: Set font dynamically to fit text

2019-10-16 Thread Ralph DiMola via use-livecode
Brahmanathaswami Subject: Re: Set font dynamically to fit text Dan: Thanks for the handler! Ralph: Actually that last solution offered was fromr Dan Friedman not mine. Can you put your two handlers on the list? " I also have an option to fit either by height or width." Doc Haw

RE: Set font dynamically to fit text

2019-10-15 Thread Ralph DiMola via use-livecode
] On Behalf Of Sannyasin Brahmanathaswami via use-livecode Sent: Monday, October 14, 2019 3:21 PM To: How to use LiveCode Cc: Sannyasin Brahmanathaswami Subject: Re: Set font dynamically to fit text Dan: Thanks for the handler! Ralph: Actually that last solution offered was fromr Dan Friedman

Re: Set font dynamically to fit text

2019-10-14 Thread Sannyasin Brahmanathaswami via use-livecode
Dan: Thanks for the handler! Ralph: Actually that last solution offered was fromr Dan Friedman not mine. Can you put your two handlers on the list? " I also have an option to fit either by height or width." Doc Hawk: I give in , " Font scaling itself is nonlinear enough, but the way

RE: Set font dynamically to fit text

2019-10-14 Thread Ralph DiMola via use-livecode
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

Re: Set font dynamically to fit text

2019-10-13 Thread doc hawk via use-livecode
On Oct 12, 2019, at 8:05 PM, Brian Milby via use-livecode wrote: > > You probably could get close with math but line breaks would not be uniform > and will introduce variability. You could probably get it down to 2 or 3 > checks. This. Font scaling itself is nonlinear enough, but the way

Re: Set font dynamically to fit text

2019-10-13 Thread Dan Friedman via use-livecode
Sannyasin, I've been doing this for years. Works well... on doShrinkToFit lFldID,startingSize,minSize set the textSize of lFldID to startingSize repeat until the formattedHeight of lFldID <= the height of lFldID set the textSize of lFldID to (the textSize of lFldID - 1) if the

Re: Set font dynamically to fit text

2019-10-12 Thread hh via use-livecode
In the repeat loop set the attributes of the empty field and use measureText (or measureUnicodeText) to compute the textSize. As a last step fill the field. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe,

Re: Set font dynamically to fit text

2019-10-12 Thread Sannyasin Brahmanathaswami via use-livecode
But "line breaks" is another known factor, based on X… which still leaves us on variable to find. Brian wrote: You probably could get close with math but line breaks would not be uniform and will introduce variability. You could probably get it down to 2 or 3 checks. BR: Hmm I figured that a

Re: Set font dynamically to fit text

2019-10-12 Thread Brian Milby via use-livecode
You probably could get close with math but line breaks would not be uniform and will introduce variability.  You could probably get it down to 2 or 3 checks. Thanks, Brian On Oct 12, 2019, 11:02 PM -0400, Sannyasin Brahmanathaswami via use-livecode , wrote: > BR: Hmm I figured that a repeat

Re: Set font dynamically to fit text

2019-10-12 Thread Sannyasin Brahmanathaswami via use-livecode
BR: Hmm I figured that a repeat loop would do that, but was look for a "one-off-equation" According to the "laws of math" (ha... algebrait has been such a long time; I could be wrong) if you have single unknown variable , X, and all others are known factors, you would,

Re: Set font dynamically to fit text

2019-10-12 Thread Paul Dupuis via use-livecode
On 10/12/2019 8:20 PM, Sannyasin Brahmanathaswami via use-livecode wrote: Assuming one is not putting whole pages into small fields, does any one have an efficient run time LC algorithm that will set the font size so that the formatted text will all appear in the field without needing to