Dynamically Matching Fontsize In Two Text Boxes
I am creating a label with a regulatory requirement that the item description on the top and the sub description on the bottom match in font size. The issue is that I need to dynamically size the font in the top box and make the font in the bottom box match. I have tried the document level script to set the font of the bottom box to that of the autosized top box, but it always pulls the fontsize of the top box based on its design time point size. It seems as though the script is firing before the text/box is resized. I have tried the script in the new record and pre print events.
I have also tried to script a loop from 16 to 72 points and increase the font in the document level event to keep increasing until to text box reaches a certain size. It goes to the full 72 points even though the size limits are greatly exceeded.
Any thoughts, or any plans to add the ability to "link" text box properties?
-
Are you able to size both text objects dynamically via VBScript, rather than having the first one auto-sizing via the "Autosize" feature? You might need to first read the content for the upper text object and then decide what font size you need to select for both the upper and bottom text object...
0 -
As long as I can get both boxes to be the same font size based off the first box font size. The text in the first box will always be longer, that is why it is the one driving the font size of the second.
There is no measuretext option is vbscript. How would I determine the maximum font size I can use to fix inside a specific area.
0 -
What I meant is to count the number of characters the text will have, then make a predefined decision. E.g. if number of characters is between 10 and 15, set font size to 42. Not the best of solutions, but worth to try...
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare