Everything on a slide is a shape inside the draw:page: text boxes,
pictures and charts are frames, and the rest are drawing shapes. Shapes on a master
slide appear on every slide that uses it. This page covers sections 10.3 to 10.6 of
OpenDocument 1.3 part 3 and the attributes they use from chapter 19. Presentation
objects (title, outline, notes and so on) are frames or shapes with a
presentation:class, described on the
slides page; how shapes look is
set by their graphic style (see styles
and formatting).
Attributes every shape has
| Attribute | Values | Meaning |
|---|---|---|
draw:name | text | A name to refer to the shape. |
draw:style-name | style name | A style of family graphic. |
draw:class-names | list of style names | More graphic styles, applied after draw:style-name. |
presentation:style-name, presentation:class-names | style names | Styles of family presentation, for presentation objects. |
draw:text-style-name | style name | A paragraph style for text in the shape. |
draw:layer | layer name | The layer the shape is on. |
draw:z-index | integer | Drawing order, back to front; without it, document order. Not written for shapes inside a group or 3D scene. |
draw:transform | list of transforms | Applied in order, separated by white space or commas: matrix(a b c d e f) (3×2 matrix in column order, e f the translation), rotate(angle) (degrees about the origin), scale(sx [sy]), skewX(angle), skewY(angle), translate(tx [ty]). |
draw:caption-id | IDREF | The text box holding the shape’s caption (used as its accessible name if there is no svg:title). |
xml:id, draw:id | ID | Identifier; animations target shapes by it. draw:id is deprecated and must equal xml:id when both are given. |
Most shapes may contain text:p and text:list (text in the
shape), draw:glue-point, office:event-listeners (click
actions), svg:title (a short name) and svg:desc (a
description). Shapes also accept the anchoring and spreadsheet attributes
(text:anchor-type, table:end-cell-address and so on), which
matter only in text documents and spreadsheets.
Drawing shapes
| Element | Shape | Own attributes |
|---|---|---|
draw:rect | Rectangle. | svg:x, svg:y, svg:width, svg:height; svg:rx, svg:ry (corner rounding; one alone sets both) or draw:corner-radius (ignored if either is present) |
draw:line | Straight line. | svg:x1, svg:y1, svg:x2, svg:y2 |
draw:polyline | Open line through points. | draw:points (pairs x,y separated by white space, in view-box units), svg:viewBox (four integers: left, top, width, height), position and size (readers may take the size from the points) |
draw:polygon | Closed polygon. | as polyline |
draw:regular-polygon | Regular polygon or star. | draw:corners; draw:concave (false: convex; true: a star with twice as many corners, alternately on two circles); draw:sharpness (for stars: percentage s; the inner points are at distance (1 − s%) from the centre along the line to the outer circle; 0% gives a plain polygon, 100% brings the inner points to the centre; may be negative or above 100%). With an odd number of corners the first is at the top of the outer circle, with an even number at the top of the inner one. |
draw:path | Any outline. | svg:d (SVG path data), svg:viewBox, position and size |
draw:circle | Circle or part of one. | svg:cx, svg:cy, svg:r, or position and size (radius from the smaller of width and height, centred); draw:kind = full (default), section (pie slice), cut (chord), arc; draw:start-angle, draw:end-angle |
draw:ellipse | Ellipse or part of one. | svg:cx, svg:cy, svg:rx, svg:ry, or position and size; draw:kind, draw:start-angle, draw:end-angle |
draw:connector | Lines joining two shapes. | draw:type = standard (default: right-angled lines that keep clear of the shapes), lines (straight leaving lines joined by a straight line), line (one straight line), curve; draw:start-shape, draw:end-shape (IDs), draw:start-glue-point, draw:end-glue-point (glue point numbers); svg:x1…svg:y2 (may be left out when connected); draw:line-skew (one to three lengths moving the middle lines of a standard connector, positive to the right); svg:d and svg:viewBox (the path, which writers should give; without it the path is up to the reader) |
draw:caption | A box with lines to a point it describes. | position and size, draw:caption-point-x, draw:caption-point-y, draw:corner-radius |
draw:measure | A dimension line. Two extension lines run from the reference points svg:x1,svg:y1 and svg:x2,svg:y2; the dimension line with arrows lies between them at draw:line-distance from the reference line, above or below by draw:placing. The style gives the guide distance, overhang and text settings. | svg:x1, svg:y1, svg:x2, svg:y2 |
draw:control | A form control’s visible shape. | draw:control (the control’s ID), position and size |
draw:page-thumbnail | A picture of a slide (used on notes pages and handouts). | draw:page-number (on a notes page, fixed to its slide; on a handout, the order of the previews), position and size, presentation:class, presentation:placeholder, presentation:user-transformed |
draw:g | A group. Inside a draw:a every shape in it links to the target unless it has its own link. | svg:y; children: any shapes, frames, 3D scenes, links |
draw:frame | A frame: see Frames. | |
dr3d:scene | A 3D scene: see 3D. | |
draw:custom-shape | A shape built from a geometry description: see Custom shapes. |
Glue points
Connectors attach to glue points. Every shape has four standard ones, at the
middle of each edge of its bounding box, numbered 0 to 3 clockwise from the top
(IDs 0 to 3 are reserved for them). draw:glue-point adds more:
| Attribute | Values | Meaning |
|---|---|---|
draw:id | number | The glue point’s number. |
svg:x, svg:y | percent or distance | A percentage from the shape’s centre, or with draw:align a distance from that edge. |
draw:align | top-left, top, top-right, left, center, right, bottom-left, bottom-right | The edge or corner the position is measured from. |
draw:escape-direction | auto, left, right, up, down, horizontal, vertical | Which way a connector leaves the point. |
Frames
A draw:frame holds content: a text box (draw:text-box),
an image (draw:image), an embedded object (draw:object,
such as a chart, or draw:object-ole), a plugin (draw:plugin,
for example a video), an applet (deprecated), a floating frame or a table. It may hold
several versions of the same content, preferred first; a reader shows the first it
supports. Frames take the common attributes plus svg:x,
svg:y, svg:width, svg:height,
draw:copy-of (show another frame’s content) and the presentation
attributes presentation:class, presentation:placeholder and
presentation:user-transformed. Child elements also include contours,
an image map and glue points.
| Content | Attributes |
|---|---|
draw:text-box | draw:chain-next-name (the next box in a chain), fo:min-width, fo:min-height, fo:max-width, fo:max-height, draw:corner-radius |
draw:image | xlink:href (usually a file in the package), draw:mime-type, draw:filter-name; or an office:binary-data child in Base64. Vector images should be SVG and bitmaps PNG. |
draw:object | xlink:href to a sub-document folder in the package or another document, or an office:document or MathML child; draw:notify-on-update-of-ranges |
draw:object-ole | draw:class-id, xlink:href or office:binary-data |
draw:plugin | xlink:href, draw:mime-type; draw:param children (draw:name, draw:value) |
draw:floating-frame | draw:frame-name, xlink:href |
Links: draw:a wraps a shape to make it a hyperlink
(xlink:href, office:target-frame-name, office:title,
office:name, office:server-map). Image maps
(draw:image-map) hold draw:area-rectangle,
draw:area-circle and draw:area-polygon, scaled with the
image. Contours (draw:contour-polygon, draw:contour-path)
outline an image or object.
3D scenes
3D coordinate systems are right-handed. A dr3d:scene is the only
element that may hold 3D shapes; it groups them like draw:g and also
sets projection and lighting. Scenes may nest; only the outermost scene’s
svg:x, svg:y, svg:width and
svg:height count, giving the rectangle the projection is drawn into
(scaled to fit, not necessarily evenly).
| Element | Attributes and values |
|---|---|
dr3d:scene | dr3d:projection = parallel or perspective; dr3d:distance (camera to object), dr3d:focal-length; dr3d:vrp (view origin), dr3d:vpn (view direction), dr3d:vup (up vector), which together give the viewing volume; dr3d:shade-mode = flat (one normal per surface), phong (normals interpolated), gouraud (colours interpolated), draft (wireframe); dr3d:lighting-mode (true/false: use lighting); dr3d:ambient-color (light from all directions); dr3d:shadow-slant (angle to the virtual paper the shadow falls on); dr3d:transform; children: lights, 3D shapes, scenes |
dr3d:light | dr3d:diffuse-color (colour of the light), dr3d:direction (a 3D vector), dr3d:enabled (true/false), dr3d:specular (causes highlights; readers may only use this on the first light). Readers may allow only 8 lights per scene. |
dr3d:cube | dr3d:min-edge, dr3d:max-edge (opposite corners as x, y, z), dr3d:transform |
dr3d:sphere | dr3d:center, dr3d:size (3D values), dr3d:transform |
dr3d:extrude | svg:d, svg:viewBox: a polygon pushed out by the style’s dr3d:depth, making front, back and side faces (sides always closed; front and back by dr3d:close-front/-back, back size by dr3d:back-scale) |
dr3d:rotate | svg:d, svg:viewBox: a polygon in the XY plane turned about the Y axis through dr3d:end-angle (default 360°, closed with no end faces) in dr3d:horizontal-segments steps |
dr3d:transform is a list of: matrix(a b c d e f g h i j k l)
(a 4×4 homogeneous matrix written by columns, with j k l the
translation), rotatex(angle), rotatey(angle),
rotatez(angle) (degrees), scale(sx sy sz),
translate(tx ty tz). The material, shadow, texture and segment settings
are in the graphic style.
Custom shapes
A draw:custom-shape is a complex figure described by geometry, which
may also have font effects (text on a path) and extrusion. It takes the common
attributes, position and size, draw:engine (a rendering engine’s name,
which must not change the geometry) and draw:data (data for that
engine). Without an engine its geometry is the child
draw:enhanced-geometry, which holds draw:equation and
draw:handle elements.
| Attribute of draw:enhanced-geometry | Values | Meaning |
|---|---|---|
svg:viewBox | four integers | The coordinate system of the path and formulas. |
draw:enhanced-path | path (below) | The outline. |
draw:type | non-primitive (default) or a name | A shape type name for the program’s user interface (such as an arrow class); it must not change the geometry. |
draw:modifiers | numbers separated by spaces | Adjustable values, used as $0, $1… in paths and formulas; handles change them. |
draw:text-areas | one or two groups of four positions | Text rectangle(s): left, top, right, bottom; the second is used for vertical writing (tb-rl or tb). Missing: the whole shape. |
draw:glue-points | pairs of positions | Object-defined glue points, which may use formulas and modifiers. |
draw:glue-point-type | none (default), segments, rectangle | When draw:glue-points is empty: no glue points at all; one at each path point; one in the middle of each side of the bounding box. |
draw:glue-point-leaving-directions | angles separated by commas | Leaving direction of each object-defined glue point. |
draw:path-stretchpoint-x, draw:path-stretchpoint-y | number | When the shape is wider (or taller) than the view box’s proportions, cut the path at this x (or y) and move the right (or bottom) part to the edge, rather than scaling. |
draw:mirror-horizontal, draw:mirror-vertical | true, false (default) | Mirror the geometry. |
draw:text-rotate-angle | angle, default 0 | Extra rotation of the text. |
draw:concentric-gradient-fill-allowed | true, false (default) | Concentric gradients follow the custom path. |
draw:text-path | true, false (default) | Text drawn along the path (fontwork). |
draw:text-path-allowed | true, false (default) | Whether the user may switch text-path on and off. |
draw:text-path-mode | normal (default), path, shape | Text along the path unscaled; fitted to the path; fitted to the shape’s box. |
draw:text-path-scale | path (default), shape | Text scaled by the path’s length or the shape’s width. |
draw:text-path-same-letter-heights | true, false (default) | All letters the same height. |
draw:extrusion | true, false (default) | Show the shape as a 3D extrusion. |
draw:extrusion-allowed | true, false (default) | The shape may be extruded. |
draw:extrusion-depth | length and a fraction 0–1, default 36pt 0 | Depth, and the part of it in front of the shape. |
draw:extrusion-color | true, false (default) | Use the style’s draw:secondary-fill-color for the sides. |
dr3d:projection | parallel (default), perspective | Projection of the extrusion. |
dr3d:shade-mode | flat (default), phong, gouraud, draft | Shading. |
draw:extrusion-skew | amount (percent) and angle, default 50 45 | Skew; parallel projection only. |
draw:extrusion-viewpoint | 3D point, default (3.5cm -3.5cm 25cm) | Viewer position. |
draw:extrusion-origin | two numbers −0.5 to 0.5, default 0.5 -0.5 | Origin in the shape’s box: −0.5 left/top, 0 centre, 0.5 right/bottom. |
draw:extrusion-rotation-angle | two angles, default 0 0 | Rotation about x and y (z is the shape’s own transform); applied z, then y, then x. |
draw:extrusion-rotation-center | 3D point | Rotation centre in shape fractions; default the shape’s centre. |
draw:extrusion-brightness | percent, default 33% | Brightness of the scene. |
draw:extrusion-diffusion | percent, default 0% | Diffuse reflection. |
draw:extrusion-specularity | percent, default 0% | Specularity. |
draw:extrusion-shininess | percent, default 50% | Reflectivity. |
draw:extrusion-metal | true, false (default) | Metal look: grey (200, 200, 200) highlights instead of white, 15% more specularity. |
draw:extrusion-light-face | true (default), false | The front face responds to lighting. |
draw:extrusion-first-light-direction, draw:extrusion-second-light-direction | 3D vectors, defaults (5 0 1) and (-5 0 1) | Directions of the two lights. |
draw:extrusion-first-light-level, draw:extrusion-second-light-level | percent, default 66% | Light intensities. |
draw:extrusion-first-light-harsh, draw:extrusion-second-light-harsh | true (default), false | Harsh (an undiffused point source) or softened. |
draw:extrusion-number-of-line-segments | integer, default 30 | Segments for curved surfaces. |
Enhanced path
Commands are single letters followed by parameters, separated by white space or
commas (which may be left out where not needed); a repeated command letter may be
left out after the first. A parameter is a number, $n (the nth
modifier) or ?name (the result of the named equation). The syntax is
based on SVG path data.
| Command | Name | Parameters | Meaning |
|---|---|---|---|
M | moveto | (x y)+ | Start a sub-path; further pairs are lineto. |
L | lineto | (x y)+ | Straight lines. |
C | curveto | (x1 y1 x2 y2 x y)+ | Cubic Bézier with two control points. |
Q | quadratic-curveto | (x1 y1 x y)+ | Quadratic Bézier. |
A | arcto | (x1 y1 x2 y2 x3 y3 x4 y4)+ | Ellipse in the box (x1,y1)–(x2,y2): a line to the start angle given by (x3,y3), then an arc anticlockwise to the end angle given by (x4,y4). |
B | arc | as A | As A with a moveto to the start point instead of a line. |
W | clockwise-arcto | as A | As A, clockwise. |
V | clockwise-arc | as A | As B, clockwise. |
T | angle-ellipseto | (x y wR hR t0 t1)+ | Clockwise part of an ellipse with centre (x,y), width 2·wR, height 2·hR, from t0 to t1 degrees. |
U | angle-ellipse | as T | As T with a moveto to the start. |
X | elliptical-quadrantx | (x y)+ | Quarter ellipse starting tangent to the x axis; each further one alternates axis. |
Y | elliptical-quadranty | (x y)+ | Quarter ellipse starting tangent to the y axis; alternates. |
Z | closepath | – | Line back to the sub-path’s start. |
N | endpath | – | End this set of sub-paths, filled with the even-odd rule; later ones are filled separately. |
F | nofill | – | Do not fill this set of sub-paths. |
S | nostroke | – | Do not stroke this set of sub-paths. |
The standard spells the names with typing slips (“elliptical-quatrantx”).
Equations and handles
A draw:equation has draw:name and draw:formula.
Formulas use numbers, + - * /, brackets, ?name (another
equation), $n (a modifier), these identifiers and these functions:
| Identifier | Value |
|---|---|
left, top, right, bottom, width, height | From svg:viewBox. |
logwidth, logheight | The shape’s svg:width or svg:height in 1/100 mm. |
xstretch, ystretch | draw:path-stretchpoint-x or -y. |
hasstroke, hasfill | 1 if the shape has a line (fill) style, else 0. |
pi | π (listed in the grammar). |
Functions: abs(n), sqrt(n), sin(n),
cos(n), tan(n) (radians), atan(n),
min(x,y), max(x,y), atan2(y,x) (angle of the
vector (x,y) with the x axis) and if(c,x,y) (x if c > 0, else y).
A draw:handle is a point the user drags to change a modifier.
| Attribute | Values | Meaning |
|---|---|---|
draw:handle-position | two positions: number, ?name, $n or an identifier as above | x and y; for a polar handle, angle and radius. |
draw:handle-polar | two positions | Makes the handle polar about this centre; the x/y ranges are then ignored. |
draw:handle-range-x-minimum, -x-maximum, -y-minimum, -y-maximum | one position | Limits of movement. |
draw:handle-radius-range-minimum, -maximum | one position | Radius limits of a polar handle. |
draw:handle-mirror-horizontal | true, false (default) | Mirror the handle’s y position. |
draw:handle-mirror-vertical | true, false (default) | Mirror its x position. |
draw:handle-switched | true, false (default) | Swap directions when the shape is taller than wide. |
<draw:custom-shape draw:style-name="gr1" svg:x="2cm" svg:y="2cm" svg:width="6cm" svg:height="3cm">
<draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:modifiers="5400"
draw:enhanced-path="M ?f0 0 L 21600 0 ?f1 21600 0 21600 Z N">
<draw:equation draw:name="f0" draw:formula="$0"/>
<draw:equation draw:name="f1" draw:formula="21600-$0"/>
<draw:handle draw:handle-position="$0 top" draw:handle-range-x-minimum="0"
draw:handle-range-x-maximum="21600"/>
</draw:enhanced-geometry>
</draw:custom-shape>
A parallelogram whose slant the user can drag: the top edge starts at modifier 0 and the bottom edge ends at 21600 minus it.
Source
OpenDocument Version 1.3, OASIS Standard, 27 April 2021, part 3 (schema), sections 10.2.5, 10.3 to 10.6 and the attributes they use in chapter 19 (including Tables 10 to 13); read in full for this page.