English

Problem: Legend text does not retain new scale when increased

Description

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

Cause

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:

    Code:
    '-- 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)
    s.SetSize(newpointsize.asnumber)

    '-- 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)
    s.SetFont(theFont)
    end
    conversionfactor = newpointsize.asnumber/oldtextsize
    newrectsize = (oldrectsize*(conversionfactor@conversionfactor))
    myrect = rect.make(oldrectorigin,newrectsize)
    g.setbounds(myrect)
    end
    g.Invalidate
    end
    end
    theLayout.invalidate

  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.