Problem: Changing text size in a layout legend with Avenue is not permanent
Resizing legend text with the Symbol Window Font Manager works permanently. Text size changes made to the legend with Avenue, however, revert to the original size when closing and reopening the project.
This is a known issue.
Solution or Workaround
Reset the bounds for the LegendFrame with the SetBounds request. The example below demonstrates how to incorporate this request into a script that resizes legend text.
- Open a new script window. A. Activate the Project window.
B. Click the Scripts icon.
C. Click New.
- Copy the following code into the new window:
theLayout = av.GetActiveDoc
theGraphics = theLayout.GetGraphics
for each g in theGraphics
if (g.Is(LegendFrame)) then
oldrect = g.getbounds
oldrectorigin = oldrect.returnorigin
oldrectsize = oldrect.returnsize
theSymbols = g.ReturnSymbols
for each s in theSymbols
if (s.Is(TextSymbol)) then
oldtextsize = s.getsize
newpointsize = msgbox.input(
"Enter desired point text size","",oldtextsize.asstring)
conversionfactor = newpointsize.asnumber/oldtextsize
newrectsize = (oldrectsize*(conversionfactor@conversionfactor))
myrect = rect.make(oldrectorigin,newrectsize)
- Attach the script to a button on the Layout GUI. A. Compile the script.
B. Switch to the Project window.
C. Select Customize from the Project menu.
D. On the Customize dialog, select Layout under Type dropdown.
E. Select Buttons under Category.
F. Click the New button.
G. Double-click the Click property in the Customize dialog box.
H. Enter the name of the script in the Script Manager and click Select.
I. Close the Customize dialog box.
For more information, see 'Customize dialog box' in ArcView Help.
- Open the layout and click the new button