Fun With Text Fitting in InDesign

One of the most tedious jobs is fitting text to the space it is supposed to take up. A little bigger, a little smaller, wait! the text is different sizes… sigh… Well, here’s a few scripts to help with a couple of different situations…


Before we go on, make sure you download the scripts from here.

Situation #1

You have a headline which must fit to the margin widths. It may even be a two line heading. What to do?

“Fit Text To Frame” to the rescue!

Before

Before

After

After

There’s two scripts which are used in this situation: FitTextPrefs, and FitTextToFrame.

FitTextPrefs allows you to set some simple preferences for the Fit Text to Frame script. When you run FitTextPrefs, you get presented with a dialog with four options:

text_fit_prefs

The first two options will expand the text frame down to the bottom baseline or descender respectively only if necessary.

The last two options will move the frame bottom either up or down to fit the frame bottom ensuring that the frame bottom always fits the text.

Once we set the preferences, a simple double-click on the FitTextToFrame script will fit the text of the current frame.

Some quick pointers on using Fit Text to Frame:

  • Fit Text to Frame will attempt to bring any overset text back into the text frame. This might result in more than one line.
  • If there are multiple lines in the text frame, the text of the longest line will be fit to the frame. All other text will be scaled proportionally.
  • Text of different sizes will all be scaled proportionally.
  • If all the text cannot be fit, Fit Text to Frame will abort.
  • Fit Text to Frame does not adjust leading. If there are multiple lines, it usually works best if the leading is set to “Auto”.

Situation #2

You have the unlucky job of fitting a story into a predefined space. You tried to explain to the client that to properly fit text takes a lot of finesse and very often copy-editing, but they won’t hear of it. You will need to fit the text exactly to the text frame precisely 30 seconds before it goes to press. ;)

Fill Text Frame to the rescue!

Before Fill

Before Fill

After Fill

After Fill

Fill Text Frame is really very basic. It will scale all the text currently in the frame to the maximum size that will fit in the frame without spilling out of the frame.

  • Fill Text Frame will not bring back any text which is overset.
  • Fill Text Frame scales all the text proportionally.
  • Fill Text Frame does not adjust leading. It usually works best if the leading is set to “Auto”.
Tags: , ,

14 Comments

  1. michael Bäumer says:

    Hey, what about a little window with preview and the possibility to make defined text with different pt sizes smaller or larger by clicking on arrows in defined steps of point, pica, % ???
    That is a situation i regular have.

    But anyway big thanx for this usefull and awaited scripts!!

  2. [...] First, a script that lets you enlarge text to fit a frame. This is great for headings. (It is similar to a feature in the Blatner Tools “Text Controls” plug-in.) [...]

  3. Samuel Moreno says:

    When will be update this script for CS5. please!

  4. DSS says:

    FYI: Works for setting text up a size to fit but will not fit overruns down to fit.

  5. Will says:

    As DSS said, the FitTextToFrame part of the script doesn’t work for InDesign CS5.

  6. Harbs says:

    Yes. There was a problem with the script in CS5.

    I just looked into it and I believe I’ve fixed the problem. You can download the new version from the same download link.

  7. Kat says:

    So excited to find these scripts, but I need them to work with a data merge. Is this possible?

    • Harbs says:

      I’m not sure what you mean by working with data merge. Can you explain a bit more?

      • Kat says:

        I frequently work with data merges to bring in several entries of text with varying number of characters from Excel docs. I was hoping there were scripts available just like the ones above that I could apply to my defined text space before or after selecting my data source and creating my merge so that the text would automatically scale itself (for each entry) to fit the text space. Does this make sense?

  8. Mark says:

    Hi, was wondering if you amend the script to allow for each line of text to fit the the frame?

    If you have the following text:

    Fenchurch
    3-drawer
    base unit

    I want each line to fit to the width of the frame, I know they would be different sizes, but that is what we want.

    Is this possible?

  9. [...] Text fitting scripts by Harbs One of the most tedious jobs is fitting text to the space it is supposed to take up. A little bigger, a little smaller, wait! the text is different sizes… sigh… Well, here’s a few scripts to help with a couple of different situations… [...]

Leave feedback