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 margins scale with font 
size is downright psychotic (enough so, that I’d advocate for redoing it with a 
useOldMarginBehavior property that can be set.).  Changing margin size can 
change what size font fits in the wrong direction, or by more points than the 
change, or . . .

But the approach of an initial mathematical computation , followed by the 
iterations—which must happen in both directions unless a hit is made.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: launch & quit

2019-10-13 Thread Robert Brenstein via use-livecode
I’d guess that quit command triggers some closeXxxx handlers to run 
and one causes the delay. The duration of delay sounds a bit like 
network timeout. Have you tried to switch off messages before quit?


On Oct 12, 2019, at 13:28, Paul Dupuis via use-livecode 
 wrote:


I have a stand alone with a card with a button with a mouseUp handler

on mouseUp

  -- some stuff

  -- tApplication variable contains a path to another standalone for 
OSX or Window depending upon what platform() this standalon is running 
on


  launch tApplication
  put the result into tError
  if tError is not empty then
answer error tErrormEssage
  end if
  quit
end mouseUp

On Windows, the designated application launches promptly and my app 
quits immediately.


On OSX, the designated application launches promptly and my app waits 
way too long (a minute or two) before quitting.


Standalone built for OSX and Windows on Windows under LC905

Anyone have any experience like this? Any ideas on what to do to get 
the OSX version to quit when told to quit?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: launch & quit

2019-10-13 Thread Paul Hibbert via use-livecode
I’ve used quit before on Mac with no problems, so I tried a few tests and it 
still seems to work fine for me (even with your mismatch variable 
tError/tErrormEssage).

I tried both with and without generating a deliberate error and it quit 
straight away, so I’d guess there may be something else causing the delay.

One thing I did notice was that when testing in the IDE the app being launched 
is brought to the front, but in a standalone the app being launched stayed in 
the background until I changed the quit command to:

   send “quit" to me in 10 ticks

This seems to give the app time to launch and come to the front, but the time 
seems to be be dependant on the size of the app, I tested with another 
standalone, and Apple Preview.

Tested in LC9.0.5 & LC9.5.0 - same results.

Hope you track down the issue.

Paul

> On Oct 12, 2019, at 13:28, Paul Dupuis via use-livecode 
>  wrote:
> 
> I have a stand alone with a card with a button with a mouseUp handler
> 
> on mouseUp
> 
>   -- some stuff
> 
>   -- tApplication variable contains a path to another standalone for OSX or 
> Window depending upon what platform() this standalon is running on
> 
>   launch tApplication
>   put the result into tError
>   if tError is not empty then
> answer error tErrormEssage
>   end if
>   quit
> end mouseUp
> 
> On Windows, the designated application launches promptly and my app quits 
> immediately.
> 
> On OSX, the designated application launches promptly and my app waits way too 
> long (a minute or two) before quitting.
> 
> Standalone built for OSX and Windows on Windows under LC905
> 
> Anyone have any experience like this? Any ideas on what to do to get the OSX 
> version to quit when told to quit?
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


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 textSize of lFldID < minSize then
  exit repeat
end if
  end repeat
end doShrinkToFit

Of course, the moment you start with this type of work, you'll immediately wish 
LiveCode would support fractional font sizes!

Hope that helps...

-Dan


On 10/12/19, 5:21 PM, "use-livecode on behalf of 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 scroll?

BR

Satchiai Iru - Be a Witness
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode