Work in progress — this reference is being written in the open. Unfinished pages are excluded from search engines.
Paged · IDML Reference
Frames & paths

Text frames

The IDML TextFramePreference block — InsetSpacing, VerticalJustification, FirstBaselineOffset, and AutoSizingType.

Intermediate· reference

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 — InsetSpacingType / valuesSupportNotes
InsetSpacing"top left bottom right" (pt)SupportedFour 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 — VerticalJustificationType / valuesSupportNotes
TopAlignenumSupportedDefault. First line at the top inset.
CenterAlignenumSupportedText block centred between the insets.
BottomAlignenumSupportedLast line at the bottom inset.
JustifyAlignenumSupportedInter-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 — FirstBaselineOffsetType / valuesSupportNotes
AscentOffsetenumSupportedDefault. Baseline one ascender below the top inset. Used for any unrecognised value too.
CapHeightenumSupportedOne cap-height below the inset (needs font metrics).
XHeightenumSupportedOne x-height below the inset (needs font metrics).
EmBoxHeightenumSupportedOne em-box-height below the inset.
LeadingOffsetenumSupportedDistance comes from MinimumFirstBaselineOffset (pt).
FixedHeightenumSupportedSame 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 — AutoSizingTypeType / valuesSupportNotes
OffenumSupportedDefault. Static frame; the authored bounds win.
WidthOnlyenumSupportedThe renderer estimates the longest line and widens the wrap column to fit (honouring MinimumWidthForAutoSizing).
HeightOnlyenumParsed, not yet renderedParsed; the width-growth pass does not act on height-only growth yet.
HeightAndWidthenumParsed, not yet renderedOnly the width component is applied; height growth is not yet honoured.
HeightAndWidthProportionallyenumParsed, not yet renderedAs HeightAndWidth — only width growth takes effect today.
Parsed, not yet renderedOnly width growth is applied. The companion AutoSizingReferencePoint and MinimumHeightForAutoSizing are parsed but not yet acted on for vertical growth.

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.

On this page