Legend text does not retain new scale when increased

Last Published: April 25, 2020


The text of the Legend Frame does not retain the new text scale if it is increased.


The new text graphics exceed the limits of the bounding rectangle for the Legend Frame.

Solution or Workaround

Increase the size of the bounding rectangle to be larger than the text graphic size.

The following script will change the size of the text to a set size and then reset the bounding rectangle to accommodate the new text graphics.

  1. Open a new script window.

    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.

  2. Copy the following code into the new window:

    '-- Script
    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)

    '-- Make a different font
    font_family_list = FontManager.THE.ReturnFamilies
    font_family = MsgBox.Listasstring(font_family_list,"","")
    font_styles_list = FontManager.THE.Returnstyles(font_family)
    font_style = MsgBox.Listasstring(font_styles_list,"","")
    theFont = Font.Make(font_family,font_style)
    conversionfactor = newpointsize.asnumber/oldtextsize
    newrectsize = (oldrectsize*(conversionfactor@conversionfactor))
    myrect = rect.make(oldrectorigin,newrectsize)

  3. Click the Compile button.
    [O-Image] Script compile button
  4. Arrange your windows so you can see the script and layout windows at the same time.
  5. Click the layout, then click the script window.
  6. Click the Run button.
    [O-Image] Run compiled script button
  7. Type the desired point text size and click OK.
  8. Select the font type and style, and click OK.

Article ID:000004203

  • Legacy Products

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options