Set font dynamically to fit text

Paul Dupuis paul at researchware.com
Sat Oct 12 20:33:15 EDT 2019


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 scroll?
>
> BR
>
> Satchiai Iru - Be a Witness
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

your essentially want a repeat loop where you reduce the textSize of 
char 1 to -1 of the field until the formattedHeight of the field is less 
than or equal to the height of the field

You probably will need a condition in the loop to prevent the textSize 
from going below 9




More information about the use-livecode mailing list