Text frames
The IDML TextFramePreference block — InsetSpacing, VerticalJustification, FirstBaselineOffset, and AutoSizingType.
A TextFrame is the page item that holds text, and its TextFramePreference child controls how that text sits inside the frame.
In short: A TextFrame is the IDML page item bound to a story: it points at
the story through its ParentStory, and the frame's outline sets where the text
can go. A single optional child element, TextFramePreference, controls how
the text sits inside that outline — through four attributes: InsetSpacing (the
text inset box), VerticalJustification (where the block sits in the column
height), FirstBaselineOffset (where the first line lands), and AutoSizingType
(whether the frame may grow). This page is the reference for all four.
A TextFrame is the page item that holds text: it points at a story through its
ParentStory, and its ContentType is TextType. The frame's outline (from
its PathGeometry) sets where text
can go; a single optional child element, TextFramePreference, controls how
the text sits inside that outline.
<TextFrame Self="uframe" ParentStory="ustory" ContentType="TextType" ...>
<Properties>
<PathGeometry>...</PathGeometry>
</Properties>
<TextFramePreference
InsetSpacing="6 8 10 12"
VerticalJustification="CenterAlign"
FirstBaselineOffset="CapHeight"
AutoSizingType="HeightOnly"/>
</TextFrame>All four attributes are optional; when absent the frame uses InDesign's
defaults. The parser reads them off TextFramePreference only while a
TextFrame is the open element — the same attributes on a non-text shape are
ignored.
InsetSpacing — the text inset box
InsetSpacing shrinks the area text may occupy inside the frame outline. It is a
space-separated list of four numbers in points, in IDML's
top left bottom right order. The parser stores them as a (top, left, bottom, right) tuple; the composer lays text out against the inset box rather than the
raw outline.
| Attribute · TextFramePreference — InsetSpacing | Type / values | Support | Notes |
|---|---|---|---|
| InsetSpacing | "top left bottom right" (pt) | Supported | Four points of padding pulled in from each edge. Omitted → no inset. |
VerticalJustification — text within the column height
VerticalJustification decides where the composed text block sits between the
top and bottom insets when it does not fill the frame. Top is the default.
| Attribute · TextFramePreference — VerticalJustification | Type / values | Support | Notes |
|---|---|---|---|
| TopAlign | enum | Supported | Default. First line at the top inset. |
| CenterAlign | enum | Supported | Text block centred between the insets. |
| BottomAlign | enum | Supported | Last line at the bottom inset. |
| JustifyAlign | enum | Supported | Inter-paragraph gaps grow so the last baseline reaches the bottom; within-paragraph leading is preserved. |
FirstBaselineOffset — where the first line lands
FirstBaselineOffset sets how far below the top inset the first line's baseline
falls. AscentOffset is the IDML default. The renderer honours each policy at
layout time; the metric-driven ones (CapHeight, XHeight) need the frame's
font, and the LeadingOffset / FixedHeight pair reads the companion
MinimumFirstBaselineOffset value (in points).
| Attribute · TextFramePreference — FirstBaselineOffset | Type / values | Support | Notes |
|---|---|---|---|
| AscentOffset | enum | Supported | Default. Baseline one ascender below the top inset. Used for any unrecognised value too. |
| CapHeight | enum | Supported | One cap-height below the inset (needs font metrics). |
| XHeight | enum | Supported | One x-height below the inset (needs font metrics). |
| EmBoxHeight | enum | Supported | One em-box-height below the inset. |
| LeadingOffset | enum | Supported | Distance comes from MinimumFirstBaselineOffset (pt). |
| FixedHeight | enum | Supported | Same source as LeadingOffset — the MinimumFirstBaselineOffset value. |
AutoSizingType — letting the frame grow
AutoSizingType lets a frame's bounds grow at composition time so a display
headline or dynamic copy does not clip against an undersized authored box. Off
is the default — a static frame whose bounds are authoritative.
| Attribute · TextFramePreference — AutoSizingType | Type / values | Support | Notes |
|---|---|---|---|
| Off | enum | Supported | Default. Static frame; the authored bounds win. |
| WidthOnly | enum | Supported | The renderer estimates the longest line and widens the wrap column to fit (honouring MinimumWidthForAutoSizing). |
| HeightOnly | enum | Parsed, not yet rendered | Parsed; the width-growth pass does not act on height-only growth yet. |
| HeightAndWidth | enum | Parsed, not yet rendered | Only the width component is applied; height growth is not yet honoured. |
| HeightAndWidthProportionally | enum | Parsed, not yet rendered | As HeightAndWidth — only width growth takes effect today. |
Insets, justification, and the first baseline together
The frame outline, the inset box, the vertical justification, and the first baseline stack up in that order: the outline is the room, the insets pull a margin in, the first-baseline policy places the top line, and vertical justification distributes whatever slack is left. Get the inset wrong and every later number shifts with it.
Frequently asked questions
What is the TextFramePreference element in IDML?
TextFramePreference is an optional child of a TextFrame that controls how text
sits inside the frame outline. It carries four attributes — InsetSpacing,
VerticalJustification, FirstBaselineOffset, and AutoSizingType — and when it
is absent the frame falls back to InDesign's defaults.
What order does InsetSpacing use?
InsetSpacing is a space-separated list of four points in IDML's
top left bottom right order. The parser stores them as a
(top, left, bottom, right) tuple, and the composer lays text out against the
resulting inset box rather than the raw frame outline.
Does the renderer support auto-sizing text frames?
Only partially. WidthOnly is honoured — the renderer estimates the longest line
and widens the wrap column to fit — but the height-growth variants (HeightOnly,
HeightAndWidth, HeightAndWidthProportionally) are parsed and only their width
component is applied; vertical growth is still on the roadmap.
Page-item types
The six IDML page-item elements — TextFrame, Rectangle, Oval, GraphicLine, Polygon, and Group — the key attributes of each, and which ones the renderer honours.
Groups
How an IDML Group clusters page items, how its transform and transparency reach the members, and what the renderer does inside one.