a:txSp (Text Shape)

Represents a specialized shape designed primarily for text content, combining drawing properties with text body formatting.

Description

a:txSp is the DrawingML text shape element designed as a shape optimized for text content. It is defined in ECMA-376 Part 1 §20.1.2.6.1.

Text shapes are specialized shapes that prioritize text rendering over geometric complexity. Key features:

  • Designed for text-heavy content with complex formatting
  • Supports all text formatting options (paragraphs, runs, styles)
  • Can have shape fills, outlines, and effects
  • Auto-fit options for text sizing and layout
  • Common in text boxes, callouts, and text-focused diagrams

Text shapes are useful for:

  • Text boxes and callouts in diagrams
  • Structured text containers with visual styling
  • Title and heading shapes
  • Comment and annotation shapes
  • Complex text layouts with graphics

Attributes

Attribute Type Possible Values Description
(none) - - All properties defined through child elements.

Examples

Simple Text Box

<p:txSp xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
  <p:nvTxSpPr>
    <p:cNvPr id="1" name="Text Box 1"/>
    <p:cNvTxSpPr/>
    <p:nvPr/>
  </p:nvTxSpPr>
  <p:txSpPr>
    <a:xfrm>
      <a:off x="1000" y="1000"/>
      <a:ext cx="2000000" cy="1000000"/>
    </a:xfrm>
    <a:prstGeom prst="rect">
      <a:avLst/>
    </a:prstGeom>
    <a:solidFill>
      <a:srgbClr val="E7E6E6"/>
    </a:solidFill>
    <a:ln w="9525">
      <a:solidFill>
        <a:srgbClr val="595959"/>
      </a:solidFill>
    </a:ln>
  </p:txSpPr>
  <p:txBody>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:r>
        <a:rPr lang="en-US" sz="2400" b="0"/>
        <a:t>Sample Text</a:t>
      </a:r>
    </a:p>
  </p:txBody>
</p:txSp>

Styled Text Box with Formatting

<p:txSp xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
  <p:nvTxSpPr>
    <p:cNvPr id="2" name="Formatted Text"/>
    <p:cNvTxSpPr/>
    <p:nvPr/>
  </p:nvTxSpPr>
  <p:txSpPr>
    <a:xfrm>
      <a:off x="2000000" y="2000000"/>
      <a:ext cx="3000000" cy="1500000"/>
    </a:xfrm>
    <a:prstGeom prst="rect">
      <a:avLst/>
    </a:prstGeom>
    <a:gradFill>
      <a:gsLst>
        <a:gs pos="0">
          <a:srgbClr val="0070C0"/>
        </a:gs>
        <a:gs pos="100000">
          <a:srgbClr val="002060"/>
        </a:gs>
      </a:gsLst>
      <a:lin ang="5400000" scaled="1"/>
    </a:gradFill>
  </p:txSpPr>
  <p:txBody>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:pPr algn="ctr"/>
      <a:r>
        <a:rPr lang="en-US" sz="3200" b="1" color="FFFFFF"/>
        <a:t>Title Text</a:t>
      </a:r>
    </a:p>
  </p:txBody>
</p:txSp>

Notes

  • Text shapes combine properties of regular shapes with full text formatting capabilities
  • Useful for text-heavy content that needs visual styling
  • Support auto-fit options for text sizing and word-wrapping
  • Text body can contain multiple paragraphs with complex formatting
  • Can apply effects (glow, shadow, reflection) to text shapes
  • Font sizes in hundredths of points (2400 = 12pt)
  • Text alignment options: left, center, right, justify