2 Replies Latest reply on May 6, 2014 2:55 PM by fmpro_novice

    Automatic resizing fonts



      Automatic resizing fonts


           I have a text field that is used for Name tags.  The field could have one name, or it could have up to 4 names.

           I want the font size to be as large as possible. But as more names are added, the font size would need to reduce to make sure all 4 names are still visible. Can someone please tell me how to do this?


        • 1. Re: Automatic resizing fonts

               A calculation field that uses the TextSize function can alter the size of the text shown on your label. But that's the easy part. If you want a script to automatically size the text in each label perfectly, this gets pretty complex, (but it can be done). But if you want to set up a layout where you see a field sized to fit the label with a pair of buttons that change the size of the text until they perfectly fit, this can be quite simple to set up.

               Say your text field is called "LabelText". Then a calculation field can be set up as:

               TextSize ( LabelText ; SizeField ]

               SizeField can be defined to auto-enter the most commonly used  text size as a starting value when the label record is created.

               A button can use:

               Set Field [YourTable::SizeField ; YourTable::SizeField + 1 ]

               To increase the size of the text shown in the calculation field.

               A second button can use:

               Set Field [YourTable::SizeField ; YourTable::SizeField - 1 ]

               to decrease the size of the text.

               You'd put the calculation field on your layout in place of your labelText field.

          • 2. Re: Automatic resizing fonts

                 Thanks, Phil. I'll try this.