a:txBody (Text Body)

Container for text content in DrawingML shapes, holding body properties and paragraphs.

Parent elements

Child elements

Description

a:txBody (Text Body) is the fundamental text container in DrawingML. It is defined in ECMA-376 Part 1 §20.1.2.6 and encapsulates all text content, formatting, and behavior for shapes, text boxes, placeholders, and other DrawingML objects.

Purpose and Scope

a:txBody serves three key functions:

  1. Text Container — Holds one or more paragraphs (a:p) that represent logical text units within a shape.
  2. Body Configuration — Via a:bodyPr, defines how text is rendered (wrapping, margins, rotation, anchoring, autofit).
  3. List Style Definition — Via optional a:lstStyle, provides bullet/numbering formats and default run/paragraph properties for the entire text body.

Content Hierarchy

a:txBody
├─ a:bodyPr (required, 1) — Text rendering configuration
├─ a:lstStyle (optional, 0–1) — Bullet/list styles and defaults
└─ a:p (required, 1+) — Paragraphs with text content

Integration with Shapes

a:txBody appears in:

  • Text Shapes (a:txSp) — Text is the primary content.
  • Regular Shapes (a:sp) — Text is optional secondary content.
  • Connection Shapes (a:cxnSp) — Text labels along connectors.
  • Placeholders (in presentations) — Title, body, subtitle, note placeholders.

Content Model

a:txBody
├─ a:bodyPr (Text Body Properties, 1)
│  ├─ a:spAutoFit | a:noAutofit | a:normAutofit | a:shrinkTxtToFit
│  ├─ a:prstTxWarp (preset text warp)
│  └─ ... (anchor, rotation, margin properties)
├─ a:lstStyle (List Style, 0–1)
│  ├─ a:defPPr (default paragraph properties)
│  ├─ a:lvl1pPr (level 1 paragraph properties)
│  ├─ a:lvl2pPr (level 2 paragraph properties)
│  └─ ... (up to level 9)
└─ a:p (Paragraphs, 1+)
   ├─ a:pPr (paragraph properties)
   ├─ a:r (text runs)
   └─ a:br (line breaks)

Attributes

Attribute Type Default Description
(none) — — The a:txBody element has no attributes; all configuration is via child elements.

Child Elements

Element Occurrence Purpose
a:bodyPr 1 (required) Controls text rendering: margins, wrapping, rotation, autofit, anchoring.
a:lstStyle 0–1 (optional) Defines default bullet/numbering formats and style defaults for all levels.
a:p 1+ (required) Paragraph elements containing actual text content and formatting.

a:bodyPr Child Elements

The a:bodyPr element can contain:

Element Occurrence Purpose
a:spAutoFit 0–1 Autofit: Resize shape to fit text (no wrapping).
a:noAutofit 0–1 No autofit: Overflow text is clipped or hidden.
a:normAutofit 0–1 Normal autofit: Word-wrap text; don’t resize shape.
a:shrinkTxtToFit 0–1 Shrink to fit: Reduce font size until text fits.
a:prstTxWarp 0–1 Preset text warp (curved, wavy, etc.).
a:scene3d 0–1 3D scene properties (extrusion, bevel).
a:extLst 0–1 Extension list.

a:lstStyle Child Elements

The a:lstStyle element contains:

Element Occurrence Purpose
a:defPPr 0–1 Default paragraph properties for all levels.
a:lvl1pPr–a:lvl9pPr 0–1 each Paragraph properties for levels 1–9.
a:defRPr 0–1 Default run properties for all levels.
a:extLst 0–1 Extension list.

Examples

Minimal Text Body (Single Paragraph)

<a:txBody>
  <a:bodyPr/>
  <a:p>
    <a:r>
      <a:t>Simple text content</a:t>
    </a:r>
  </a:p>
</a:txBody>

Text Body with Wrapping and Margins

<a:txBody>
  <a:bodyPr wrap="square" lIns="91440" tIns="91440" rIns="91440" bIns="91440" anchor="ctr"/>
  <a:p>
    <a:pPr algn="ctr"/>
    <a:r>
      <a:rPr lang="en-US" sz="2400">
        <a:latin typeface="Calibri"/>
      </a:rPr>
      <a:t>Centered text with margins, wrapped to shape width.</a:t>
    </a:r>
  </a:p>
</a:txBody>

Text Body with Multiple Paragraphs

<a:txBody>
  <a:bodyPr wrap="square"/>
  <a:p>
    <a:pPr algn="l"/>
    <a:r>
      <a:rPr lang="en-US" sz="2400" b="1">
        <a:latin typeface="Calibri"/>
      </a:rPr>
      <a:t>Paragraph 1: Bold heading</a:t>
    </a:r>
  </a:p>
  <a:p>
    <a:pPr algn="l"/>
    <a:r>
      <a:rPr lang="en-US" sz="2000">
        <a:latin typeface="Calibri"/>
      </a:rPr>
      <a:t>Paragraph 2: Regular body text continues here with normal formatting.</a:t>
    </a:r>
  </a:p>
  <a:p>
    <a:pPr algn="ctr"/>
    <a:r>
      <a:rPr lang="en-US" sz="1800" i="1">
        <a:latin typeface="Calibri"/>
      </a:rPr>
      <a:t>Paragraph 3: Centered italics for emphasis</a:t>
    </a:r>
  </a:p>
</a:txBody>

Text Body with Bullet List and Style

<a:txBody>
  <a:bodyPr wrap="square"/>
  <a:lstStyle/>
  <a:p>
    <a:pPr lvl="0">
      <a:buChar char="•"/>
      <a:buFont typeface="Arial"/>
    </a:pPr>
    <a:r>
      <a:rPr lang="en-US" sz="2400">
        <a:latin typeface="Calibri"/>
      </a:rPr>
      <a:t>First level bullet point</a:t>
    </a:r>
  </a:p>
  <a:p>
    <a:pPr lvl="1">
      <a:buChar char="◦"/>
      <a:buFont typeface="Arial"/>
    </a:pPr>
    <a:r>
      <a:rPr lang="en-US" sz="2400">
        <a:latin typeface="Calibri"/>
      </a:rPr>
      <a:t>Second level sub-bullet</a:t>
    </a:r>
  </a:p>
  <a:p>
    <a:pPr lvl="0">
      <a:buChar char="•"/>
      <a:buFont typeface="Arial"/>
    </a:pPr>
    <a:r>
      <a:rPr lang="en-US" sz="2400">
        <a:latin typeface="Calibri"/>
      </a:rPr>
      <a:t>Back to first level</a:t>
    </a:r>
  </a:p>
</a:txBody>

Text Body with Autofit (No Wrapping)

<a:txBody>
  <a:bodyPr wrap="none">
    <a:spAutoFit/>
  </a:bodyPr>
  <a:p>
    <a:pPr algn="l"/>
    <a:r>
      <a:rPr lang="en-US" sz="2400">
        <a:latin typeface="Calibri"/>
      </a:rPr>
      <a:t>Text will resize the shape to fit; no wrapping.</a:t>
    </a:r>
  </a:p>
</a:txBody>

Text Body with Rotation and Vertical Centering

<a:txBody>
  <a:bodyPr rot="2700000" anchor="ctr" anchorCtr="1"/>
  <a:p>
    <a:pPr algn="ctr"/>
    <a:r>
      <a:rPr lang="en-US" sz="2400">
        <a:latin typeface="Calibri"/>
      </a:rPr>
      <a:t>Rotated 90° and vertically centered</a:t>
    </a:r>
  </a:p>
</a:txBody>

Text Wrapping Modes

Wrap Value Behavior Use Case
square Word-wrap text within shape bounds Default; most shapes
none No wrapping; single line Labels, short text
none + autofit No wrap, resize shape to text Autosizing containers

Text Anchoring Points

Anchor Value Position Use Case
t Top Default; text starts at top
ctr Center Vertically centered text
b Bottom Text anchored to bottom
just Justified Full-height text (rare)
dist Distributed Uniform distribution (rare)

Autofit Modes

Mode Behavior Element
No Autofit Overflow text clipped or hidden a:noAutofit
Shape Autofit Resize shape to fit text (no wrapping) a:spAutoFit
Normal Autofit Wrap text; don’t resize shape a:normAutofit (default if omitted)
Shrink to Fit Reduce font size until text fits a:shrinkTxtToFit

Margin Inset Reference (in EMU)

EMU Value Inches Points Common Usage
0 0” 0pt No inset
45720 0.05” 3.6pt Minimal
91440 0.1” 7.2pt Small margin
228600 0.25” 18pt Standard
457200 0.5” 36pt Large margin
914400 1” 72pt Extra large

Text Rendering Workflow

  1. Read a:bodyPr → Determine wrapping mode, margins, rotation, anchor
  2. Read a:lstStyle (if present) → Load bullet styles and defaults
  3. Process paragraphs → For each a:p:
    • Apply paragraph properties (alignment, indentation, spacing)
    • Render text runs with run properties (font, size, color, effects)
    • Apply line breaks and paragraph breaks
  4. Apply layout and overflow → Wrap text per wrapping mode; resize the shape when autofit is enabled or clip overflow when required.
  5. Render → Paint text within shape bounds with all effects applied.

Notes

Element Relationships

  • Parents (direct container elements):
    • a:txSp (text shape): Dedicated text-only shape for slide text, labels, captions.
    • a:sp (shape): General shape that may contain text (rectangles, circles, connectors with labels).
    • a:cxnSp (connection shape): Connector line that can have text along or beside it.
  • Children (required sequence):
    • a:bodyPr (body properties): Defines text anchor, wrapping, auto-fit, rotation, margins. Essential for text layout.
    • a:lstStyle (list style, optional): Reusable bullet/numbering styles and text formatting defaults.
    • a:p (paragraphs, 1+): At least one paragraph must exist. Contains actual text runs and formatting.

General Notes

  • Required Child: a:bodyPr and at least one a:p are required; a:lstStyle is optional.
  • Single Text Container: Each shape, picture, or connector has at most one a:txBody per object type. Text cannot span multiple shapes.
  • Body Properties Essential: The a:bodyPr child element controls text anchor point, wrapping behavior, auto-fit settings, rotation, and margins. Critical for layout.
  • List Style Optional: a:lstStyle defines reusable bullet/numbering styles and text formatting for the entire text body. If omitted, uses theme defaults.
  • Inheritance Chain: Formatting precedence is run properties → paragraph properties → a:lstStyle defaults → master/theme defaults.
  • Autofit Behavior: Only one autofit mode (a:spAutoFit, a:normAutofit, a:noAutofit, or a:shrinkTxtToFit) is active at a time. Most applications default to a:normAutofit if none is specified.
  • Rotation Units: Rotation is in 60,000ths of a degree (5400000 = 90°, 2700000 = 270°, etc.).
  • Right-to-Left: Set rtlCol="true" in a:bodyPr for RTL text direction (Arabic, Hebrew).
  • Performance: Large text bodies with many paragraphs increase file size and parsing time; consolidate where possible.
  • Compatibility: Text body structure is consistent across PresentationML (slides), DrawingML (shapes), and SpreadsheetML (cell text), ensuring uniform text handling.