Expand description
Everything from the drawing crate — shape/text formatting shared by every format (fill,
line, geometry, text body…). Always available: unlike word/excel/powerpoint, not
gated by a feature, since it has no meaningful “opt out” — any format that has images or
shapes at all needs it.
Structs§
- Blip
Fill - An image fill (
<a:blipFill>,CT_BlipFillProperties). Confirmed againstdml-picture.xsd’sCT_Picture(nvPicPr/blipFill/spPr) that this is the same type PowerPoint/Word/Excel all use both for a real picture shape’s own always-present fill and for texturing an ordinary shape with an image (EG_FillProperties’sblipFillchoice, alongsidenoFill/solidFill/..) — one model,Fill::Image, covers both uses. - Crop
Rect <a:srcRect l=".." t=".." r=".." b=".."/>(CT_RelativeRect) — how much of aBlipFill’s source image to crop from each edge, before stretching/tiling the remainder into the shape. Each side is independently optional (ST_Percentage, thousandths of a percent of the image’s own width/height; can be negative, which zooms out rather than cropping — real PowerPoint uses this for “fill the shape, source image too small” cases). Grounded against a real fixture (e.g.<a:srcRect l="2878" t="2522" r="21582" b="46217"/>, and<a:srcRect t="52941" b="-17647"/>for the negative case).- Custom
Geometry <a:custGeom><a:pathLst><a:path w=".." h="..">’s own draw commands (CT_Path2D) — seeGeometry::Custom’s doc comment for scope.- Effect
List <a:effectLst>(CT_EffectList). Only the four effects real-world decks overwhelmingly use are modeled (outer shadow, glow, reflection, soft edge);CT_EffectList’s other choices (innerShdw/prstShdw,blur,fillOverlay, alpha/color/duotone/ luminance-modulation effect filters rather than genuine visual effects) are not, matching the “common case first” posture already used for e.g.Geometry::Custom’s draw-command subset. Grounded against real fixtures coveringouterShdw,glow/softEdge, andreflection.- Geometry
Adjustment - One
<a:gd name=".." fmla=".."/>(CT_GeomGuide) inside a preset shape’s<a:avLst>— an adjustment handle’s current value.nameis the handle’s identifier ("adj"for a shape with a single handle,"adj1"/"adj2"/. for shapes with several);formulais the raw guide formula string PowerPoint itself writes (almost always"val N"for a literal value — the small expression languageCT_GeomGuideotherwise allows, e.g. referencing other guides, is not interpreted here, only stored/round-tripped verbatim). - Glow
<a:glow rad="..">{color}</a:glow>(CT_GlowEffect) — a soft colored halo around the shape’s outline. UnlikeOuterShadow,radis required (CT_GlowEffect’s only attribute).- Gradient
Fill - A gradient fill (
<a:gradFill>,CT_GradientFillProperties). - Gradient
Stop - One color stop in a gradient (
<a:gs pos="..">,CT_GradientStop). - Hyperlink
- A clickable hyperlink (
<a:hlinkClick>,CT_Hyperlink). - Line
- A shape’s outline stroke (
<a:ln>,CT_LineProperties). - LineEnd
- One end of a line/connector (
<a:headEnd>/<a:tailEnd>,CT_LineEndProperties) — e.g. an arrowhead. - Outer
Shadow <a:outerShdw>(CT_OuterShadowEffect) — a drop shadow cast outward from the shape.algn/rotWithShape/kx/ky/sx/sy(fine-grained skew/scale/anchor controls) are not modeled — a scope reduction, not a fixture gap (allCT_OuterShadowEffect’s own attributes beyond the ones here are optional).color’s own alpha modifier (<a:alpha val="..">, seen alongside<a:srgbClr>/<a:schemeClr>in real fixtures, e.g.60810.pptx’s<a:srgbClr val="000000"><a:alpha val="41000"/></a:srgbClr>) is not preserved either —Coloritself has never modeled color transforms (see its own doc comment), not a new limitation.- Pattern
Fill - A two-color repeating pattern fill (
<a:pattFill>,CT_PatternFillProperties). - Reader
- Reads a sequence of generic XML events from an in-memory UTF-8 string.
- Reflection
<a:reflection>(CT_ReflectionEffect) — a faded mirror image below the shape.endPos/sx/sy/kx/ky/algn/fadeDir/rotWithShape(fine- grained scale/skew/anchor/fade-direction controls) are not modeled — the same scope-reduction posture asOuterShadow; only the four attributes that dominate real-world usage (blur, distance, direction, and the start/end fade transparency) are kept. Grounded against a real fixture (<a:reflection blurRad="12700" stA="48000" endA="300" endPos="55000" dir="5400000" sy="-90000" algn="bl" rotWithShape="0"/>).- Shape
Properties - A shape’s visual properties (
<a:spPr>,CT_ShapeProperties): local position/size, geometry, fill, and line. Everything about how a shape looks, independent of where it is anchored in its host document (that part is never modeled here — see the crate-level doc comment). - Soft
Edge <a:softEdge rad=".."/>(CT_SoftEdgesEffect) — blurs the shape’s own outline edge.radis required (its only attribute).- TabStop
- One explicit tab stop (
<a:tab pos="." algn=".">,CT_TextTabStop). Grounded against a real fixture, which confirmed thetabLst/tabelement shape and attribute names exactly as modeled here. - Text
Body - The text content of a shape (
<a:txBody>,CT_TextBody). Structurally a sibling ofShapeProperties, not a field on it: confirmed againstdml-spreadsheetDrawing.xsd’sCT_Shape(nvSpPr/spPr/style?/txBody?,txBodya sibling ofspPr, both direct children of the host’s own<*:sp>wrapper) — a future host crate combines the two itself,drawingnever nests one inside the other. - Text
Body Properties <a:bodyPr>’s attributes (CT_TextBodyProperties) — text wrapping, vertical anchor, horizontal centering, inset margins, and autofit. SeeTextBody’s doc comment for what elseCT_TextBodyPropertiesallows but isn’t modeled here (3D, preset text warp/WordArt).- Text
Paragraph - One paragraph of text (
<a:p>,CT_TextParagraph). - Text
Paragraph Properties <a:pPr>’s attributes (CT_TextParagraphProperties) — alignment, margins/indent, tab stops (tabLst), paragraph spacing, indent/outline level, default run formatting, and bullets.- Text
RunProperties - A run’s character formatting (
<a:rPr>/<a:defRPr>/<a:endParaRPr>,CT_TextCharacterProperties) — this crate only ever writes/reads it as<a:rPr>(on<a:r>/<a:br>), not the other two contexts. - Transform2D
- Position, size, rotation, and flipping (
<a:xfrm>,CT_Transform2D). Bothoffset/extentare optional in the schema (a shape can rely entirely on its host anchor for placement, e.g. a picture inside axdr:twoCellAnchorwith no localxfrmat all) —Nonehere means the element itself is either absent or written with only the attributes present, matching that flexibility rather than forcing a fixed size.
Enums§
- Blip
Fill Mode EG_FillModeProperties— how an image fill is fitted to its shape.- Bullet
Color - This paragraph’s bullet color (
EG_TextBulletColor). - Bullet
Font - This paragraph’s bullet font (
EG_TextBulletTypeface). - Bullet
Kind - This paragraph’s bullet/numbering marker (
EG_TextBullet). - Bullet
Size - This paragraph’s bullet size (
EG_TextBulletSize). - Color
- A color (
EG_ColorChoice): the choice DrawingML offers wherever a color is needed (fills, lines, gradient stops..). - Error
- Errors that can occur while reading or writing DrawingML content.
- Fill
- How a shape’s (or a line’s) interior is painted (
EG_FillProperties). - Geometry
- A shape’s outline (
EG_Geometry, the choice between<a:custGeom>and<a:prstGeom>). - LineCap
ST_LineCap— a stroke’s end-cap style.- Line
Compound ST_CompoundLine— a stroke’s compound-line style.- Line
EndSize ST_LineEndWidth/ST_LineEndLength— both share the same three-value small/medium/large scale.- Line
EndType ST_LineEndType— the shape of a line end decoration.- Line
Join EG_LineJoinProperties— how a stroke’s corners are drawn.- Path
Command - One draw command inside a custom path (
EG_Path2DList’s children within a single<a:path>—moveTo/lnTo/cubicBezTo/closeonly, seeGeometry::Custom’s doc comment for what else exists but isn’t modeled). Coordinates are in the enclosing<a:path>’s own coordinate space (0.=width_emu/0.=height_emu), not absolute EMUs. - Preset
Line Dash ST_PresetLineDashVal’s full set of 11 named dash patterns.- Preset
Pattern ST_PresetPatternVal’s full, finite set of 54 named patterns — unlikePresetShape/Color::Preset, small enough to enumerate exhaustively (noOtherescape hatch needed).- Preset
Shape - A useful subset of
ST_ShapeType’s ~185 preset shape names — the ones most commonly authored by real tools (basic shapes, arrows, a handful of callouts/symbols).PresetShape::Otherpreserves round-trip fidelity for any preset name not explicitly modeled here, the same “closed enum + escape hatch” posture this workspace already uses for open-ended, large-but-finite value sets (e.g. font family names) rather than exhaustively enumerating every value up front for a feature not yet needed. - TabAlignment
ST_TextTabAlignType.- Text
Align ST_TextAlignType.- Text
Anchor ST_TextAnchoringType— vertical anchor of a text body within its shape.Justified/Distributed(just/dist) stretch line spacing to fill the shape’s height rather than anchoring to one edge.- Text
Autofit EG_TextAutofit— how a text body reacts to content that doesn’t fit its shape. Grounded against real fixtures exercising all three variants.- Text
Caps ST_TextCapsType.- TextRun
- One run of text within a paragraph (
EG_TextRun’sr/br/fldchoices — seeTextRun::Field). - Text
Spacing - Paragraph-level spacing (
CT_TextSpacing, the choice behind<a:lnSpc>/<a:spcBef>/<a:spcAft>). Grounded against a real fixture exercising both variants side by side (<a:lnSpc><a:spcPct val="100000"/></a:lnSpc>,<a:spcBef><a:spcPts val="0"/></a:spcBef>). - Text
Strike ST_TextStrikeType.- Text
Underline ST_TextUnderlineType’s full set of 18 named underline styles.- Text
Vertical Type ST_TextVerticalType.- Text
Wrap ST_TextWrappingType.
Functions§
- is_
fill_ choice_ element - Parses one already-matched
EG_FillPropertieschoice element (<a:noFill/>,<a:solidFill>,<a:gradFill>,<a:pattFill>, or<a:blipFill>) into aFill, given the caller has already read its ownStart/Emptyevent and knows (e.g. viais_fill_choice_element) that it is one — for a host that mixes a bare fill choice among other, individually-matched sibling elements at the same nesting level, so can’t hand the whole scan over toread_fill(which skips anything that isn’t a fill choice, silently discarding those other siblings). PresentationML table cell properties (<a:tcPr>’s own trailing fill choice, sitting alongside<a:lnL>/<a:lnR>/<a:lnT>/<a:lnB>—powerpoint-ooxml’s ownTableCellProperties, point 8) is exactly this case. - read_
color - Parses a single bare
EG_ColorChoiceelement (<a:srgbClr>/<a:scrgbClr>/<a:hslClr>/<a:sysClr>/<a:prstClr>) from a reader positioned wherever the caller expects to find it, skipping over any other, unrelated children along the way — the same “bare choice, not wrapped in<*:spPr>” posture asread_fill, for a host embedding a bare color choice outside DrawingML’s own fill/line vocabulary (e.g.powerpoint-ooxml’s custom table styles, point 8). ReturnsNoneif no recognized color child is found before the firstEnd/Eofat this nesting level. A theme-relative<a:schemeClr>reference isn’t modeled — seeColor’s own doc comment. - read_
fill - Parses a single bare
EG_FillPropertieschoice (<a:noFill/>,<a:solidFill>,<a:gradFill>,<a:pattFill>, or<a:blipFill>) from a reader positioned wherever the caller expects to find it, skipping over any other, unrelated children along the way — unlikeread_shape_properties(which parses a whole<*:spPr>’s worth ofxfrm/geometry/fill/line), this is for a host embedding a bare fill choice on its own, outside any<*:spPr>wrapper (e.g.powerpoint-ooxml’s own<p:bgPr>slide background, point 4). ReturnsNoneif no recognized fill child is found before the firstEnd/Eofat this nesting level. - read_
fill_ choice - See
is_fill_choice_element’s own doc comment for when to reach for this instead ofread_fill. - read_
line - Parses a
CT_LineProperties-typed element (<a:ln>, or the same type under a different name, e.g. PresentationML’s table cell borders<a:lnL>/<a:lnR>/<a:lnT>/<a:lnB>— seecrate::write_line_namedfor the writer-side symmetric case), from a reader positioned right at its ownStart/Emptyevent — unlikeread_fill/read_color, which scan forward looking for a bare choice, the caller here has already matched the element by name (its own name isn’t fixed, unlike<a:solidFill>/<a:srgbClr>) and hands over itsstart/is_startdirectly, the same contractread_shape_properties’s own internal<a:xfrm>/<a:ln>handling uses. - read_
shape_ properties - Parses
CT_ShapeProperties’s content (<a:xfrm>/EG_Geometry/EG_FillProperties/<a:ln>, in any order, each optional) from a reader positioned right after the wrapper element’s own opening tag was consumed by the caller. See the module doc comment for the exact contract. - read_
text_ body - Parses
<a:bodyPr>../<a:p>..</a:p>*— the content of<a:txBody>(CT_TextBody) — from a reader positioned right after the caller already consumed the wrapper’s own opening tag, mirroringread_shape_properties’s exact contract (see the module doc comment). - write_
blip_ fill - Writes
<a:blipFill>— (<a:blip>/stretch-or-tile), (<a:srcRect>). SeeBlipFill’s doc comment for what else isn’t modeled (no per-mode tiling/stretching sub-rects). - write_
color - Writes
EG_ColorChoice— a single<a:srgbClr../>,<a:scrgbClr../>,<a:hslClr../>,<a:sysClr../>, or<a:prstClr../>element, with no wrapping element of its own (the caller —<a:solidFill>,<a:fgClr>,<a:gs>. — provides that). - write_
effect_ list - Writes
<a:effectLst>. Self-closing when every effect is unset (schema-valid:CT_EffectList’s own effect choices are allminOccurs="0"), otherwise wraps whichever of<a:outerShdw>/<a:glow>/<a:reflection>/<a:softEdge>are set, in that schema order (EG_EffectProperties’s own group definition). - write_
fill - Writes
EG_FillProperties—<a:noFill/>,<a:solidFill>..,<a:gradFill>..,<a:pattFill>.., or<a:blipFill>... - write_
geometry - Writes
EG_Geometry—<a:prstGeom prst="..">or<a:custGeom>..(seeGeometry’s doc comment for whatcustGeomscope is modeled). - write_
geometry_ fill_ line_ effects - Writes
EG_Geometry/EG_FillProperties/<a:ln>/<a:effectLst>, in that schema order — likewrite_shape_properties, minus<a:xfrm>, and with one difference that matters in practice: whenproperties.geometryis unset, this writes a fixed<a:prstGeom prst="{default_preset}"><a:avLst/></a:prstGeom>fallback instead of omitting the geometry element entirely. - write_
line - Writes
<a:ln w="..">EG_LineFillProperties, EG_LineDashProperties, EG_LineJoinProperties, headEnd?, tailEnd?</a:ln>. - write_
line_ named - Writes a
CT_LineProperties-typed element under a caller-chosen name — same content model aswrite_line(which is just this called with"a:ln"), for the handful of other elements in the wider OOXML vocabulary that reuseCT_LinePropertiesunder a different name, e.g. PresentationML table cell borders (<a:lnL>/<a:lnR>/<a:lnT>/<a:lnB>,powerpoint-ooxml’s owncrate-externalTableCellProperties, point 8). - write_
shape_ properties - Writes
<a:xfrm>/EG_Geometry/EG_FillProperties/<a:ln>, in that schema order — the content ofCT_ShapeProperties, i.e. what a host crate’s own<*:spPr>wrapper should contain. - write_
text_ body - Writes
<a:bodyPr>../<a:p>..</a:p>*— the content of<a:txBody>(CT_TextBody). Likewrite_shape_properties, never writes the<a:txBody>wrapper itself (a sibling of<a:spPr>inside a host’s own<*:sp>, not this crate’s concern — seecrate::TextBody’s doc comment). - write_
text_ body_ properties - Writes
<a:bodyPr>(self-closing unlessautofitis set — no 3D/preset warp modeled, seeTextBody’s doc comment), matching the schema’s ownminOccurs="1"on this element even when everything is unset (<a:bodyPr/>). - write_
text_ paragraph - Writes
<a:p><a:pPr../>EG_TextRun*</a:p>(CT_TextParagraph). - write_
text_ paragraph_ properties - Writes
<a:pPr>— self-closing when nothing beyond its own attributes is set, otherwise wraps<a:lnSpc>/<a:spcBef>/<a:spcAft>/bullet elements/<a:tabLst>/<a:defRPr>children, in that order — the same child sequence confirmed on a real fixture (<a:lnSpc>..<a:spcBef>..<a:spcAft>..<a:buClrTx/><a:buSzTx/> <a:buFontTx/><a:buNone/><a:tabLst/><a:defRPr/>). - write_
text_ run - Writes one
EG_TextRunchoice —<a:r>..</a:r>forTextRun::Regular,<a:br../>/<a:br>..</a:br>forTextRun::LineBreak. - write_
transform - Writes
<a:xfrm rot=".." flipH=".." flipV=".."><a:off../><a:ext../></a:xfrm>.