paged.IDML Reference
Frames & paths

Text frames

The IDML TextFramePreference — columns and balancing, typed InsetSpacing, vertical justification, first baseline, and auto-sizing as InDesign fits a frame.

Tier: IntermediateIntermediateIIreference

A TextFrame holds a story; its TextFramePreference child decides how the text sits inside the frame.

In short A TextFrame names its story in ParentStory, and its outline is the room the text has. The optional TextFramePreference child sets how that room is used: the number of columns and the gutter, whether the columns are balanced, the inset between outline and text, where the text block sits vertically, where the first baseline falls, and whether the frame fits itself to its text. All of these are attributes, except the inset: InDesign writes InsetSpacing as a typed <Properties> child and ignores it as an attribute. A TextFramePreference in an object style or in Resources/Preferences.xml supplies the defaults a frame does not set.

Two columns 24 pt apart, balanced by line count, with the insets written as a typed list. Ten one-line paragraphs set five and five.

Spreads/Spread_uspread.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Spread xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0">
  <Spread Self="uspread" PageCount="1" BindingLocation="0" ShowMasterItems="true" AllowPageShuffle="true" ItemTransform="1 0 0 1 0 0">
    <Page Self="upage" Name="1" AppliedMaster="umaster" ItemTransform="1 0 0 1 0 0" GeometricBounds="0 0 841.89 595.276" MasterPageTransform="1 0 0 1 0 0"/>
    <TextFrame Self="uframe" ParentStory="ustory" PreviousTextFrame="n" NextTextFrame="n" ContentType="TextType" AppliedObjectStyle="ObjectStyle/$ID/[None]" Visible="true" Name="$ID/" ItemTransform="1 0 0 1 57.638 145.8237" FillColor="Swatch/None" StrokeColor="Color/Black" StrokeWeight="0.5">
      <Properties>
        <PathGeometry>
          <GeometryPathType PathOpen="false">
            <PathPointArray>
              <PathPointType Anchor="0 0" LeftDirection="0 0" RightDirection="0 0"/>
              <PathPointType Anchor="0 300" LeftDirection="0 300" RightDirection="0 300"/>
              <PathPointType Anchor="480 300" LeftDirection="480 300" RightDirection="480 300"/>
              <PathPointType Anchor="480 0" LeftDirection="480 0" RightDirection="480 0"/>
            </PathPointArray>
          </GeometryPathType>
        </PathGeometry>
      </Properties>
      <TextFramePreference TextColumnCount="2" TextColumnGutter="24" VerticalBalanceColumns="true" VerticalJustification="TopAlign" FirstBaselineOffset="AscentOffset" AutoSizingType="Off">
        <Properties>
          <InsetSpacing type="list">
            <ListItem type="unit">12</ListItem>
            <ListItem type="unit">18</ListItem>
            <ListItem type="unit">12</ListItem>
            <ListItem type="unit">18</ListItem>
          </InsetSpacing>
        </Properties>
      </TextFramePreference>
    </TextFrame>
  </Spread>
</idPkg:Spread>

Columns

  • TextColumnCount: the number of columns (default 1).
  • TextColumnGutter: the space between columns, in points.
  • UseFixedColumnWidth with TextColumnFixedWidth: columns of a fixed width, the frame width following from them. UseFlexibleColumnWidth with TextColumnMaxWidth: as many columns as fit under a maximum width.
  • VerticalBalanceColumns: balance the columns of the frame. InDesign levels the line count, not the height: each column takes at most ceil(lines / columns) lines, and the space below stays empty. Forty-four single-line paragraphs in a balanced two-column frame set 22 and 22; the same frame unbalanced sets 35 and 9.

Columns split the area inside the insets: the left and right insets apply once to the whole frame, not to every column.

InsetSpacing: the text inset

The inset pulls the text area in from the frame's outline. InDesign writes it inside the preference's <Properties>, in one of two forms:

  • a list of four type="unit" items in the order top, left, bottom, right, as in the example above, when the sides differ;
  • a single <InsetSpacing type="unit">6</InsetSpacing> when all four sides are equal.

Across 271 real-world packages there are 13,893 list forms, 45 single values and no InsetSpacing attribute at all. Opened in InDesign, a package that writes the insets as an attribute (InsetSpacing="6 8 10 12" on TextFramePreference) gets no insets.

A frame with a non-rectangular outline keeps its text inside the outline, pulled in by the inset.

VerticalJustification

Where the text block sits between the top and bottom insets when it does not fill the frame:

ValueEffect
TopAlignThe default. Text starts at the top inset.
CenterAlignThe block is centred between the insets.
BottomAlignThe last line sits on the bottom inset.
JustifyAlignSpace is added between paragraphs (up to VerticalThreshold, then between lines) so the text fills the height.

FirstBaselineOffset

How far below the top inset the first baseline falls:

ValueFirst baseline at
AscentOffsetThe default. The ascent of the first line's font.
CapHeightThe cap height of the first line.
XHeightThe x-height of the first line.
EmBoxHeightThe em-box height.
LeadingOffsetThe first line's leading.
FixedHeightExactly MinimumFirstBaselineOffset points.

MinimumFirstBaselineOffset is also a floor for the other values: the baseline never sits higher than it.

Auto-sizing

AutoSizingType makes a frame fit its text. It is a fit, not a growth: the frame shrinks below its written size as readily as it grows past it.

ValueWhat changes
OffThe default. The written size is final.
HeightOnlyThe height becomes what the text needs; the width stays.
WidthOnlyThe height stays, so the frame keeps its number of lines; the width becomes the smallest at which the text fits in them.
HeightAndWidthThe width becomes the smallest at which no line overflows a column, and the height follows the lines.
HeightAndWidthProportionallyBoth sides scale by one factor until the text fits, keeping the proportions.

AutoSizingReferencePoint names the point that stays put while the frame changes: TopLeftPoint, TopCenterPoint, TopRightPoint, CenterLeftPoint, CenterPoint (what InDesign writes by default), CenterRightPoint and the three bottom points. MinimumHeightForAutoSizing and MinimumWidthForAutoSizing, switched on by UseMinimumHeightForAutoSizing and UseMinimumWidthForAutoSizing, set a floor. UseNoLineBreaksForAutoSizing keeps paragraphs on one line where the width can grow.

The frame's path in the file is the size it was written at. A reader that composes the text computes the fitted size from it.

In Paged: auto-sizing is a fit with the real composer, honouring the reference point and both minimums; the frame paints at its fitted size and neighbouring frames wrap around it. Columns, balancing, vertical justification and every first-baseline value are applied. Fixed and flexible column widths are not read.

Supported · verified Supported · verified Supported · verified

All attributes

Attribute · TextFramePreferenceValuesPagedpaged.set
AutoSizingReferencePointCenterPointread · written
AutoSizingTypeOff | HeightOnly | WidthOnly | HeightAndWidth | HeightAndWidthProportionallyread · writtentextFrameAutoSizing
FirstBaselineOffsetAscentOffset | CapHeight | XHeight | EmBoxHeight | LeadingOffset | FixedHeightreadtextFrameFirstBaseline
InsetSpacingbounds (pt)readframeInsetSpacing
TextColumnCountnumber (count)readtextFrameColumnCount
TextColumnGutterlength (pt)readtextFrameColumnGutter
VerticalJustificationTopAlign | CenterAlign | BottomAlign | JustifyAlignreadtextFrameVerticalJustification
IgnoreWrapfalsenot read
MinimumFirstBaselineOffsetintegerread
TextColumnFixedWidthinteger / realnot read
UseFixedColumnWidthfalsenot read
VerticalThresholdintegernot read
MinimumHeightForAutoSizingintegerread · written
MinimumWidthForAutoSizingintegerread · written
TextColumnMaxWidthinteger / realnot read
UseFlexibleColumnWidthfalsenot read
UseMinimumHeightForAutoSizingfalseread · written
UseMinimumWidthForAutoSizingfalsenot read
UseNoLineBreaksForAutoSizingfalsenot read
VerticalBalanceColumnsfalse | truereadtextFrameColumnBalance
The 20 attributes real documents use most. All 34 attributes of TextFramePreference →

IgnoreWrap makes the frame's text ignore text wrap from other objects. The Footnotes… and ColumnRule… attributes set footnote placement and rules between columns for this frame.

Frequently asked questions

How is InsetSpacing written? As a typed child: <TextFramePreference><Properties><InsetSpacing type="list"> with four <ListItem type="unit"> values in the order top, left, bottom, right, or one <InsetSpacing type="unit"> value for all four sides. InDesign ignores an InsetSpacing attribute.

What does VerticalBalanceColumns balance? The number of lines. Each column takes at most the total line count divided by the number of columns, rounded up; the columns are not stretched to equal heights.

Does auto-sizing only make frames bigger? No. Every auto-sizing mode fits the frame to its text, so a frame with little text shrinks. AutoSizingReferencePoint decides which point of the frame stays where it is.

Where do the defaults come from when a frame has no TextFramePreference? From the frame's object style, and from the TextFramePreference in Resources/Preferences.xml.

On this page