Text frames
The IDML TextFramePreference — columns and balancing, typed InsetSpacing, vertical justification, first baseline, and auto-sizing as InDesign fits a frame.
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.
Columns
TextColumnCount: the number of columns (default 1).TextColumnGutter: the space between columns, in points.UseFixedColumnWidthwithTextColumnFixedWidth: columns of a fixed width, the frame width following from them.UseFlexibleColumnWidthwithTextColumnMaxWidth: 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 mostceil(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:
| Value | Effect |
|---|---|
TopAlign | The default. Text starts at the top inset. |
CenterAlign | The block is centred between the insets. |
BottomAlign | The last line sits on the bottom inset. |
JustifyAlign | Space 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:
| Value | First baseline at |
|---|---|
AscentOffset | The default. The ascent of the first line's font. |
CapHeight | The cap height of the first line. |
XHeight | The x-height of the first line. |
EmBoxHeight | The em-box height. |
LeadingOffset | The first line's leading. |
FixedHeight | Exactly 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.
| Value | What changes |
|---|---|
Off | The default. The written size is final. |
HeightOnly | The height becomes what the text needs; the width stays. |
WidthOnly | The height stays, so the frame keeps its number of lines; the width becomes the smallest at which the text fits in them. |
HeightAndWidth | The width becomes the smallest at which no line overflows a column, and the height follows the lines. |
HeightAndWidthProportionally | Both 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 · TextFramePreference | Values | Paged | paged.set |
|---|---|---|---|
| AutoSizingReferencePoint | CenterPoint | read · written | |
| AutoSizingType | Off | HeightOnly | WidthOnly | HeightAndWidth | HeightAndWidthProportionally | read · written | textFrameAutoSizing |
| FirstBaselineOffset | AscentOffset | CapHeight | XHeight | EmBoxHeight | LeadingOffset | FixedHeight | read | textFrameFirstBaseline |
| InsetSpacing | bounds (pt) | read | frameInsetSpacing |
| TextColumnCount | number (count) | read | textFrameColumnCount |
| TextColumnGutter | length (pt) | read | textFrameColumnGutter |
| VerticalJustification | TopAlign | CenterAlign | BottomAlign | JustifyAlign | read | textFrameVerticalJustification |
| IgnoreWrap | false | not read | |
| MinimumFirstBaselineOffset | integer | read | |
| TextColumnFixedWidth | integer / real | not read | |
| UseFixedColumnWidth | false | not read | |
| VerticalThreshold | integer | not read | |
| MinimumHeightForAutoSizing | integer | read · written | |
| MinimumWidthForAutoSizing | integer | read · written | |
| TextColumnMaxWidth | integer / real | not read | |
| UseFlexibleColumnWidth | false | not read | |
| UseMinimumHeightForAutoSizing | false | read · written | |
| UseMinimumWidthForAutoSizing | false | not read | |
| UseNoLineBreaksForAutoSizing | false | not read | |
| VerticalBalanceColumns | false | true | read | textFrameColumnBalance |
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.
Page-item types
The six IDML page-item elements — TextFrame, Rectangle, Oval, GraphicLine, Polygon, Group — their shared attributes and the fields that set each apart.
Groups
How an IDML Group holds its members as child elements, how its transform, transparency and layer apply to them, and how groups nest and paint.