RTF has two ways of writing drawings. Word 6.0 and 95 use \do drawing
objects, built from simple primitives: lines, rectangles, ellipses, arcs, polylines,
text boxes and callouts. Word 97 and later use \shp shapes, described by a
list of named properties taken from Office’s drawing layer; they also write the old form
inside the shape’s \shprslt for older readers.
Drawing objects (Word 6.0 and 95)
<do> = '{\*' \do <dohead> <dpinfo> '}'
<dohead> = <dobx> <doby> <dodhgt> <dolock>?
<dobx> = \dobxpage | \dobxcolumn | \dobxmargin
<doby> = \dobypage | \dobypara | \dobymargin
<dpinfo> = <dpgroup> | <dpcallout> | <dpsimple>
<dpgroup> = \dpgroup \dpcount <dphead> <dpinfo>+ \dpendgroup <dphead>
<dpcallout> = \dpcallout <cotype> <coangle>? <coaccent>? <cosmartattach>? <cobestfit>? <cominusx>?
<cominusy>? <coborder>? <codescent>? \dpcooffset \dpcolength <dphead> <dppolyline>
<dphead> <dpprops> <dptextbox> <dphead> <dpprops>
<dpsimple> = <dpsimpledpk> <dphead> <dpprops>
<dpsimpledpk> = <dpline> | <dprect> | <dptextbox> | <dpellipse> | <dppolyline> | <dparc>
<dpline> = \dpline <dppt> <dppt>
<dprect> = \dprect (\dproundr)?
<dptextbox> = \dptxbx (\dptxlrtb | \dptxtbrl | \dptxbtlr | \dptxlrtbv | \dptxtbrlv)? \dptxbxmar
'{' \dptxbxtext <para>+ '}'
<dpellipse> = \dpellipse
<dparc> = \dparc \dparcflipx? \dparcflipy?
<dppolyline> = \dppolyline (\dppolygon)? \dppolycount <dppt>+
<dppt> = \dpptx \dppty
<dphead> = \dpx \dpy \dpxsize \dpysize
<cotype> = \dpcotright | \dpcotsingle | \dpcotdouble | \dpcottriple
<codescent> = \dpcodtop | \dpcodcenter | \dpcodbottom | \dpcodabs
<dpprops> = <lineprops>? <fillprops>? <endstylestart>? <endstyleend>? <shadow>?
<lineprops> = <linestyle> <linecolor> \dplinew
<linestyle> = \dplinesolid | \dplinehollow | \dplinedash | \dplinedot | \dplinedado | \dplinedadodo
<linecolor> = \dplinegray | (\dplinecor \dplinecog \dplinecob \dplinepal?)
<fillprops> = <fillcolorfg> <fillcolorbg> \dpfillpat
<fillcolorfg> = \dpfillfggray | (\dpfillfgcr \dpfillfgcg \dpfillfgcb \dpfillfgpal?)
<fillcolorbg> = \dpfillbggray | (\dpfillbgcr \dpfillbgcg \dpfillbgcb \dpfillbgpal?)
<endstylestart> = (\dpastartsol | \dpastarthol) \dpastartl \dpastartw
<endstyleend> = (\dpaendsol | \dpaendhol) \dpaendl \dpaendw
<shadow> = \dpshadow \dpshadx \dpshady
In a group the number of <dpinfo> equals \dpcount;
in a polyline the number of points equals \dppolycount. Colours are 0 to
255, distances are in twips.
Anchor and primitives
| Control word | Meaning |
|---|---|
\do | Destination: a drawing object, inserted at this point in the text. |
\dolock | The anchor is locked. |
\dobxpage | Horizontal position relative to the page. |
\dobxcolumn | Horizontal position relative to the column. |
\dobxmargin | Horizontal position relative to the margin. |
\dobypage | Vertical position relative to the page. |
\dobypara | Vertical position relative to the paragraph. |
\dobymargin | Vertical position relative to the margin. |
\dodhgtN | Position in the z-order. |
\dpgroup | Start of a group of primitives. |
\dpcountN | Number of primitives in the group. |
\dpendgroup | End of the group. |
\dparc | Arc. |
\dpcallout | Callout: a polyline and a text box. |
\dpellipse | Ellipse. |
\dpline | Line. |
\dppolygon | The polyline is closed (a polygon). |
\dppolyline | Polyline. |
\dprect | Rectangle. |
\dptxbx | Text box. |
\dpxN | Horizontal offset from the anchor. |
\dpyN | Vertical offset from the anchor. |
\dpxsizeN | Width. |
\dpysizeN | Height. |
\dproundr | The rectangle has round corners. |
\dptxbxmarN | Inner margin of the text box. |
\dptxbxtext | Group holding the text of the text box. |
\dptxlrtb | Text box text runs left to right, top to bottom (default). |
\dptxtbrl | Right to left, top to bottom. |
\dptxbtlr | Left to right, bottom to top. |
\dptxlrtbv | Left to right, top to bottom, vertical. |
\dptxtbrlv | Top to bottom, right to left, vertical. |
\dpptxN | X of the current point of a line or polyline. Each point is written x then y. |
\dpptyN | Y of the current point. |
\dppolycountN | Number of points in the polyline. |
\dparcflipx | The arc’s end point is to the right of its start. Arcs are drawn anticlockwise. |
\dparcflipy | The arc’s end point is below its start. |
Callouts
| Control word | Meaning |
|---|---|
\dpcoaN | Angle of the diagonal line: 0, 30, 45, 60 or 90. Absent: any angle, given by the points. |
\dpcoaccent | Accent bar (a vertical bar between line and text box). |
\dpcobestfit | Best fit: the lines have similar lengths. |
\dpcoborder | The text box has a visible border. |
\dpcodabs | The line attaches at an absolute distance. |
\dpcodbottom | The line attaches at the bottom. |
\dpcodcenter | The line attaches at the centre. |
\dpcodtop | The line attaches at the top. |
\dpcodescentN | The callout’s descent. |
\dpcolengthN | Length of the callout. |
\dpcominusx | The text box is in quadrant II or III from the line’s origin. |
\dpcominusy | The text box is in quadrant III or IV. |
\dpcooffsetN | Gap between the end of the line and the text box. |
\dpcosmarta | Auto-attach: the line joins the top or bottom of the box depending on the quadrant. |
\dpcotright | Right-angle callout. |
\dpcotsingle | One-line callout. |
\dpcotdouble | Two-line callout. |
\dpcottriple | Three-line callout. |
Line, arrows, fill and shadow
| Control word | Meaning |
|---|---|
\dplinesolid | Solid line. |
\dplinehollow | No line. |
\dplinedash | Dashed line. |
\dplinedot | Dotted line. |
\dplinedado | Dash-dot line. |
\dplinedadodo | Dash-dot-dot line. |
\dplinewN | Line thickness in twips. |
\dplinegrayN | Line colour as grey, in half-percentages. |
\dplinecorN, \dplinecogN, \dplinecobN | Line colour red, green and blue. |
\dplinepal | Draw the line colour with Windows’ PALETTERGB rather than RGB. |
\dpastartsol, \dpastarthol | Solid or hollow arrow at the start (lines only). |
\dpastartlN, \dpastartwN | Start arrow length and width relative to the pen: 1 small, 2 medium, 3 large. |
\dpaendsol, \dpaendhol | Solid or hollow arrow at the end (lines only). |
\dpaendlN, \dpaendwN | End arrow length and width: 1 small, 2 medium, 3 large. |
\dpfillfggrayN | Fill foreground as grey, in half-percentages. |
\dpfillfgcrN, \dpfillfgcgN, \dpfillfgcbN | Fill foreground red, green and blue. |
\dpfillfgpal | Draw the fill foreground with PALETTERGB. |
\dpfillbggrayN | Fill background as grey, in half-percentages. |
\dpfillbgcrN, \dpfillbgcgN, \dpfillbgcbN | Fill background red, green and blue. |
\dpfillbgpal | Draw the fill background with PALETTERGB. |
\dpfillpatN | Fill pattern: see below. |
\dpshadow | The primitive has a shadow. |
\dpshadxN, \dpshadyN | Horizontal and vertical offset of the shadow. |
Fill patterns
| N | Pattern | N | Pattern |
|---|---|---|---|
| 0 | Clear (none) | 13 | 90% |
| 1 | Solid (100%) | 14 | Dark horizontal lines |
| 2 | 5% | 15 | Dark vertical lines |
| 3 | 10% | 16 | Dark left diagonal lines (\\\) |
| 4 | 20% | 17 | Dark right diagonal lines (///) |
| 5 | 25% | 18 | Dark grid |
| 6 | 30% | 19 | Dark trellis |
| 7 | 40% | 20 | Light horizontal lines |
| 8 | 50% | 21 | Light vertical lines |
| 9 | 60% | 22 | Light left diagonal lines (\\\) |
| 10 | 70% | 23 | Light right diagonal lines (///) |
| 11 | 75% | 24 | Light grid |
| 12 | 80% | 25 | Light trellis |
{\*\do\dobxcolumn\dobypara\dodhgt8192\dprect\dpx0\dpy0\dpxsize1440\dpysize720
\dplinesolid\dplinecor0\dplinecog0\dplinecob0\dplinew15
\dpfillfgcr255\dpfillfgcg255\dpfillfgcb0\dpfillbgcr255\dpfillbgcg255\dpfillbgcb255\dpfillpat1}
A one-inch by half-inch rectangle at the anchor, with a black line and a solid yellow fill.
Shapes (Word 97 and later)
{\shp <shape keywords> {\*\shpinst <shape keywords> {\sp{\sn Name}{\sv Value}} … {\shptxt …}}
{\shprslt <Word 6 drawing object or picture>}}
The shape keywords may come in any order after {\shp; Word also repeats
them inside \shpinst. Then each property is one \sp group with
a name and a value; only properties that differ from the default are written.
Shape keywords
| Control word | Meaning |
|---|---|
\shp | Destination: a shape. |
\shpinst | Destination: the shape’s properties. |
\sp | One property: a \sn group and a \sv group. |
\sn | Destination: the property’s name. |
\sv | Destination: the property’s value. |
\shpleftN | Left edge, in twips from the anchor. |
\shptopN | Top edge, in twips from the anchor. |
\shprightN | Right edge, in twips from the anchor. |
\shpbottomN | Bottom edge, in twips from the anchor. |
\shplidN | Unique ID of the shape, a long integer; used for linked text boxes. |
\shpzN | Z-order: 0 for the back-most shape. Shapes in headers have their own z-order, also from 0. |
\shpfhdrN | 0: the shape is in the main document. 1: in the header document. |
\shpbxpage | Horizontal position relative to the page. |
\shpbxmargin | Relative to the margin. |
\shpbxcolumn | Relative to the column. |
\shpbxignore | Ignore the three above and use the posrelh property; they are still written for old readers. |
\shpbypage | Vertical position relative to the page. |
\shpbymargin | Relative to the margin. |
\shpbypara | Relative to the paragraph. |
\shpbyignore | Ignore the three above and use posrelv (the specification prints posrelh). |
\shpwrN | Wrapping: 1 top and bottom (no text beside the shape), 2 around the shape, 3 none (as if the shape were not there), 4 tight, 5 through. |
\shpwrkN | Sides to wrap, for types 2 and 4: 0 both, 1 left only, 2 right only, 3 the larger side. |
\shpfblwtxtN | 0: the text is below the shape. 1: the shape is below the text. |
\shplockanchor | The anchor is locked. |
\shptxt | Destination: the text of a text box, after all properties. In a set of linked text boxes, the first holds the whole story and the others have none. |
\shprslt | Destination: the Word 6/95 form of the shape, for older readers. |
\shpgrp | Destination: a group of shapes. Takes the same keywords as \shp; the shapes inside are listed from bottom to top, and only the outermost group has a \shprslt. Groups can nest. |
\background | Destination: the document background, holding a \shp. |
\hl | In a property value: a hyperlink, {\hl {\hlloc …}{\hlsrc …}{\hlfr …}}, the groups in any order. |
\hlloc | Location string of the hyperlink. |
\hlsrc | Source string of the hyperlink. |
\hlfr | Friendly name of the hyperlink. |
Except for \shplid, the keywords do not apply to shapes inside a
group, which use the group properties below.
Value types
| Type | Written as |
|---|---|
| Boolean | 1 true, 0 false. |
| EMU | English Metric Units: 12,700 to the point, 914,400 to the inch, 360,000 to the centimetre. |
| Fixed | A fraction in 65,536ths: 65,536 is 1.0. |
| Angle | Degrees as a fraction (in practice 16.16 fixed point: 90° is 5,898,240). |
| Colour | A 24-bit colour value, red in the low byte (0x00BBGGRR). |
| Array | Numbers separated by semicolons: element size in bytes (2, 4 or 8), number of elements, then the elements; 8-byte elements are pairs in braces. A square: {\sv 8;4;{0,0};{100,0};{100,100};{0,100}}. |
| String | Text. |
| Picture | A \pict group. |
| Hyperlink | An \hl group. |
The specification says only that angles are “fractions of a degree” and colours “24-bit”; the fixed-point reading of angles and the byte order of colours are how Word writes them, not stated in the 1.6 text.
Shape properties
Every property the 1.6 specification lists, in its groups, with its type and default.
A few appear twice in the specification (fHidden,
lineBackColor, fillShadeColors, fillWidth,
fCalloutTextBorder); they are listed once.
Position
| Property | Type | Meaning | Default |
|---|---|---|---|
posh | Number | Horizontal alignment, overriding \shpleft and \shpright: 1 left, 2 centre, 3 right, 4 inside, 5 outside. | Absolute position |
posrelh | Number | Horizontal position relative to: 0 margin, 1 page, 2 column, 3 character. | 2, if posh is present |
posv | Number | Vertical alignment, overriding \shptop and \shpbottom. Printed as 1 centre, 2 column, 3 bottom, 4 inside, 5 outside; by comparison with posh 1 is probably top and 2 centre. | Absolute position |
posrelv | Number | Vertical position relative to: 0 margin, 1 page, 2 paragraph, 3 line. | 2, if posv is present |
fLayoutInCell | Boolean | The shape may anchor and be positioned inside table cells. | False |
fAllowOverlap | Boolean | The shape may overlap others. A shape with no wrapping (\shpwr3) can always overlap one with wrapping, and the reverse. | True |
fChangePage | Boolean | The anchor may change page. | False |
Object type
| Property | Type | Meaning | Default |
|---|---|---|---|
fIsBullet | Boolean | The picture was inserted as a picture bullet. | False |
rotation | Angle | Rotation of the shape. | 0 |
fFlipV | Boolean | Flip vertically, after the rotation. | False |
fFlipH | Boolean | Flip horizontally, after the rotation. | False |
shapeType | Number | The kind of shape: see shape types. 0 is a freeform drawn by the user. | – |
wzName | String | Shape name (set only through Visual Basic for Applications). | None |
pWrapPolygonVertices | Array | Points of the wrapping polygon. | None |
dxWrapDistLeft | EMU | Distance from text on the left. | 114,305 |
dyWrapDistTop | EMU | Distance from text above. | 0 |
dxWrapDistRight | EMU | Distance from text on the right. | 114,305 |
dyWrapDistBottom | EMU | Distance from text below. | 0 |
fBehindDocument | Boolean | Put the shape behind the text. | False |
fIsButton | Boolean | Clicking performs an action; set for shapes with a hyperlink or macro. | False |
fHidden | Boolean | Do not show or print (set only through VBA). | False |
pihlShape | Hyperlink | The shape’s hyperlink. | None |
fArrowheadsOK | Boolean | Arrowheads allowed. | False |
fBackground | Boolean | This is the background shape. | False |
fDeleteAttachedObject | Boolean | Delete the object attached to the shape. | False |
fEditedWrap | Boolean | The wrapping polygon has been edited. | False |
fHitTestFill | Boolean | Hit-test the fill. | True |
fHitTestLine | Boolean | Hit-test the lines. | True |
fInitiator | Boolean | Set by the solver. | None |
fNoFillHitTest | Boolean | Hit-test as though filled. | False |
fNoHitTestPicture | Boolean | Do not hit-test the picture. | False |
fNoLineDrawDash | Boolean | Draw a dashed line if there is no line. | False |
fOleIcon | Boolean | An OLE object shown as an icon. | False |
fOnDblClickNotify | Boolean | Tell the client about double clicks. | False |
fOneD | Boolean | One-dimensional adjustment. | False |
fPreferRelativeResize | Boolean | Prefer relative resizing (user interface only). | False |
fPrint | Boolean | Print the shape. | True |
hspMaster | Shape ID | Master shape. | None |
hspNext | Shape ID | Next shape, for linked text boxes. | None |
xLimo | Long | X of the “limo” stretch point. | – |
yLimo | Long | Y of the stretch point. | – |
Lock
| Property | Type | Meaning | Default |
|---|---|---|---|
fLockRotation | Boolean | Lock rotation. | False |
fLockAspectRatio | Boolean | Lock the aspect ratio. | False |
fLockAgainstSelect | Boolean | Cannot be selected. | False |
fLockCropping | Boolean | Cannot be cropped. | False |
fLockVerticies | Boolean | Points cannot be edited (spelt so). | False |
fLockText | Boolean | Text cannot be edited. | False |
fLockAdjustHandles | Boolean | Adjust handles locked. | False |
fLockAgainstGrouping | Boolean | Cannot be grouped. | False |
fLockShapeType | Boolean | The shape type cannot be changed. | False |
Text box
| Property | Type | Meaning | Default |
|---|---|---|---|
dxTextLeft | EMU | Left inner margin. | 91,440 |
dyTextTop | EMU | Top inner margin. | 45,720 |
dxTextRight | EMU | Right inner margin. | 91,440 |
dyTextBottom | EMU | Bottom inner margin. | 45,720 |
WrapText | Number | Wrap text at the shape’s margins: 0 square, 1 tight, 2 none, 3 top and bottom, 4 through. | 0 |
anchorText | Number | Text anchor: 0 top, 1 middle, 2 bottom, 3 top centred, 4 middle centred, 5 bottom centred, 6 bottom centred on the baseline. | 0 |
txflTextFlow | Number | Text flow: 0 horizontal (non-ASCII font), 1 top to bottom (ASCII font), 2 bottom to top (non-ASCII), 3 top to bottom (non-ASCII), 4 horizontal (ASCII). | 0 |
cdirFont | Direction | Font rotation: 0 right, 1 down, 2 left, 3 up. | 0 |
fAutoTextMargin | Boolean | Use the host’s margins. | False |
scaleText | Long | Text zoom. | 0 |
lTxid | Long | ID of the text, set by the host. | 0 |
fRotateText | Boolean | Rotate the text with the shape. | False |
fSelectText | Boolean | True: one click selects the text; false: two. | True |
fFitShapeToText | Boolean | Resize the shape to fit the text. | False |
fFitTextToShape | Boolean | Resize the text to fit the shape. | False |
WordArt
| Property | Type | Meaning | Default |
|---|---|---|---|
gtextUNICODE | String | The text. | None |
gtextRTF | String | The text as RTF. | None |
gtextAlign | Number | Alignment on the curve: 0 stretch each line to the width, 1 centre, 2 left, 3 right, 4 spread letters, 5 spread words. | 1 |
gtextSize | Fixed | Default point size. | 2,359,296 (36 pt) |
gtextSpacing | Fixed | Character spacing, 1.0 normal. | 65,536 |
gtextFont | String | Font name. | None |
fGtext | Boolean | The gtext… properties are used. | False |
fGtextOK | Boolean | WordArt is supported. | False |
gtextFVertical | Boolean | Use an @ (vertical) font if there is one, otherwise rotate each character 90° anticlockwise. | False |
gtextFKern | Boolean | Use the font’s pair kerning. | False |
gtextFTight | Boolean | Change the spacing between characters, not their advance, by gtextSpacing. | False |
gtextFStretch | Boolean | Stretch the text to the shape. | False |
gtextFShrinkFit | Boolean | Lay out using glyph bounding boxes, not the font’s character bounds. | False |
gtextFBestFit | Boolean | Scale text on a path to fit the path. | False |
gtextFNormalize | Boolean | Stretch each character’s height on its own. | False |
gtextFDxMeasure | Boolean | Measure distances along the x axis, not along the path. | False |
gtextFBold | Boolean | Bold. | False |
gtextFItalic | Boolean | Italic. | False |
gtextFUnderline | Boolean | Underline. | False |
gtextFShadow | Boolean | Shadow. | False |
gtextFSmallcaps | Boolean | Small capitals. | False |
gtextFStrikethrough | Boolean | Strikethrough. | False |
gtextFReverseRows | Boolean | Reverse the order of the rows. | False |
Picture
| Property | Type | Meaning | Default |
|---|---|---|---|
cropFromTop | Fixed | Crop from the top, as a fraction. | 0 |
cropFromBottom | Fixed | Crop from the bottom. | 0 |
cropFromLeft | Fixed | Crop from the left. | 0 |
cropFromRight | Fixed | Crop from the right. | 0 |
pib | Picture | The picture. | None |
pibName | String | File name of a linked picture. | None |
pibFlags | Number | Link flags: 0 not linked, 10 linked and saved with the document, 14 linked and not saved with it. | 0 |
pibPrint | Picture | Picture to use when printing. | None |
pibPrintName | String | Its file name. | None |
pibPrintFlags | Number | Its link flags (0, 10, 14 as pibFlags). | 0 |
pictureTransparent | Colour | Transparent colour. | 0 |
pictureContrast | Fixed | Contrast. | 65,536 |
pictureBrightness | Fixed | Brightness. | 0 |
pictureGamma | Fixed | Gamma correction. | 0 |
pictureGray | Boolean | Show in greyscale. | 0 |
pictureBiLevel | Boolean | Show in black and white. | 0 |
pictureActive | Boolean | The server is active (OLE objects only). | False |
pictureDblCrMod | Colour | Change used when the shape has a double shadow. | No change |
pictureFillCrMod | Colour | Change for black-and-white views. | Undefined |
pictureLineCrMod | Colour | Change for black-and-white views. | Undefined |
pictureId | Long | Host’s ID for OLE objects. | 0 |
Geometry
| Property | Type | Meaning | Default |
|---|---|---|---|
geoLeft | Long | Left of the coordinate space of a user-drawn shape. | 0 |
geoTop | Long | Top. | 0 |
geoRight | Long | Right. | 21,600 |
geoBottom | Long | Bottom. | 21,600 |
pVerticies | Array | The shape’s points (spelt so). | None |
pSegmentInfo | Array | How the points are joined into segments. | None |
pFragments | Array | Extra paths and parts of the shape. | None |
pGuides | Array | Guide formulas, as in the VML <formulas> element, one <f> per entry. | None |
pInscribe | Array | The inscribed rectangle (where text goes). | None |
pAdjustHandles | Array | Adjust handles, as in the VML <handles> element. | None |
adjustValue | Integer | First adjust value; its meaning depends on the shape type. | 0 |
adjust2Value to adjust10Value | Long | Second to tenth adjust values. | 0 |
Coordinates in pVerticies are in the space set by geoLeft
to geoBottom, which is stretched over the shape’s rectangle.
Grouped shapes
| Property | Type | Meaning | Default |
|---|---|---|---|
groupLeft | Twips | Left of the group’s coordinate rectangle; groupRight − groupLeft should match \shpright − \shpleft. Not a position on the page. | 0 |
groupTop | Twips | Top of the group rectangle. | 0 |
groupRight | Twips | Right of the group rectangle. | 20,000 |
groupBottom | Twips | Bottom of the group rectangle. | 20,000 |
relLeft | Twips | Left of a shape inside its group, in the group’s coordinates. | 0 |
relTop | Twips | Top inside the group. | 0 |
relRight | Twips | Right inside the group. | 1 |
relBottom | Twips | Bottom inside the group. | 1 |
relRotation | Fixed | Rotation inside the group. | 0 |
fRelFlipH | Boolean | Flip inside the group, after rotation. The specification describes it as the vertical flip. | False |
fRelFlipV | Boolean | Flip inside the group; described as the horizontal flip. | False |
fRelChangePage | Boolean | The anchor may change page. | False |
lidRegroup | Long | Regroup ID. | 0 |
Fill
| Property | Type | Meaning | Default |
|---|---|---|---|
fFilled | Boolean | The shape is filled. | True |
fillType | Number | 0 solid colour, 1 pattern (bitmap), 2 texture (pattern with its own colours), 3 picture centred in the shape, 4 shade from start to end points, 5 shade from the bounding rectangle to the end point, 6 shade from the outline to the end point, 7 shade at fillAngle. | 0 |
fillColor | Colour | Foreground colour. | White |
fillOpacity | Fixed | Opacity. | 65,536 |
fillBackColor | Colour | Background colour. | White |
fillBackOpacity | Fixed | Background opacity, for shades. | 65,536 |
fillCrMod | Colour | Change for black-and-white views. | Undefined |
fillBlip | Picture | Pattern or texture picture. | None |
fillBlipName | String | Its file name. | None |
fillblipflags | Number | Link flags: 0, 10 or 14 as pibFlags. | 0 |
fillWidth | EMU | Size the pattern or tile (or a metafile texture) is expanded to. | 0 |
fillHeight | EMU | Height of the same. | 0 |
fillDztype | Number | How fillWidth and fillHeight are read: see measurement types. | 0 |
fillAngle | Fixed | Angle of the shade, in degrees. | 0 |
fillFocus | Number | Focus of a linear shade, per cent. | 0 |
fillToLeft, fillToTop, fillToRight, fillToBottom | Fixed | The focus rectangle of a concentric shade, as fractions of the outer rectangle. | 0 |
fillRectLeft, fillRectTop, fillRectRight, fillRectBottom | EMU | Rectangle that sets the size of a shade instead of the shape’s bounds. | 0 |
fillUseRect | Boolean | Use that rectangle. | False |
fillShadeColors | Array | Colour ramp of a graded fill, custom or preset. | None |
fillShadePreset | Long | Preset shade. | 0 |
fillShadeType | Shade type | Type of shading of a graded fill. | Default |
fillOriginX, fillOriginY | Fixed | Point of a texture, as a fraction of its width and height from the top left, that is aligned with… | 0 |
fillShapeOriginX, fillShapeOriginY | Fixed | …this point of the shape, as a fraction of its bounding box. | 0 |
fillShape | Boolean | Register the pattern on the shape. | True |
fFillOK | Boolean | The fill may be changed in the user interface or VBA. | True |
fFillShadeShapeOK | Boolean | A concentric shade (the shape drawn again smaller and smaller) is allowed. | False |
Measurement types
Values of fillDztype and lineFillDztype: 0 default size,
ignore the values; 1 EMUs; 2 pixels; 3 fractions of the shape’s size; 4 aspect ratio
fixed; 5 EMUs, aspect ratio fixed; 6 pixels, aspect ratio fixed; 7 proportion of the
shape, aspect ratio fixed; 8 aspect ratio fixed, favour the larger size; 9 to 11 as 5
to 7 (the specification gives the same descriptions; presumably also favouring the
larger size).
Line
| Property | Type | Meaning | Default |
|---|---|---|---|
fLine | Boolean | The shape has a line. | True |
lineColor | Colour | Line colour. | Black |
lineBackColor | Colour | Background colour of a patterned line. | White |
lineCrMod | Colour | Change for black-and-white views. | Undefined |
lineType | Number | 0 solid colour, 1 pattern, 2 texture, 3 picture (the last three from lineFillBlip). | 0 |
lineFillBlip | Picture | Pattern of the line. | None |
lineFillBlipName | String | Its file name. | None |
lineFillBlipFlags | Number | Link flags: 0, 10 or 14. | 0 |
lineFillWidth | EMU | Width of the pattern. | 0 |
lineFillHeight | EMU | Height of the pattern. | 0 |
lineFillDztype | Number | How to read those: measurement types. | 0 |
lineWidth | EMU | Line width. | 9,525 (0.75 pt) |
lineStyle | Number | 0 single, 1 double (equal), 2 double (thick then thin), 3 double (thin then thick), 4 triple (thin, thick, thin). | 0 |
lineDashing | Number | 0 solid, 1 dash, 2 dot, 3 dash dot, 4 dash dot dot (all four as Windows draws them), 6 dot, 7 dash, 8 long dash, 9 dash dot, 10 long dash dot, 11 long dash dot dot. | 0 |
lineDashStyle | Array | Custom dash pattern. | None |
lineStartArrowhead | Number | 0 none, 1 arrow, 2 stealth arrow, 3 diamond, 4 oval, 6 open arrow, 7 chevron, 8 double chevron. | 0 |
lineEndArrowhead | Number | The same values, at the end. | 0 |
lineStartArrowWidth | Number | 0 narrow, 1 medium, 2 wide. | 1 |
lineStartArrowLength | Number | 0 short, 1 medium, 2 long. | 1 |
lineEndArrowWidth | Number | As lineStartArrowWidth. | 1 |
lineEndArrowLength | Number | As lineStartArrowLength. | 1 |
lineEndCapStyle | Number | 0 round, 1 square, 2 flat. | 2 |
lineJoinStyle | Number | 0 bevel (join edges with a straight line), 1 mitre (extend the edges), 2 round. | 2 |
lineMiterLimit | Fixed | Mitre limit, as a ratio of the width. | 524,288 (8.0) |
fLineOK | Boolean | The line style may be set. | True |
Shadow
| Property | Type | Meaning | Default |
|---|---|---|---|
fShadow | Boolean | Shadow on. | False |
shadowType | Number | 0 offset, 1 double offset, 2 perspective relative to the shape, 3 perspective in shape space, 4 perspective in drawing space, 6 emboss or engrave. | 0 |
shadowColor | Colour | Shadow colour. | RGB(128,128,128) |
shadowHighlight | Colour | Emboss colour. | RGB(203,203,203) |
shadowCrMod | Colour | Change for black-and-white views. | Undefined |
shadowOpacity | Fixed | Opacity. | 65,536 |
shadowOffsetX | EMU | Offset to the right. | 0 |
shadowOffsetY | EMU | Offset downwards. | 0 |
shadowSecondOffsetX | EMU | Second offset of a double shadow, to the right. | 25,400 |
shadowSecondOffsetY | EMU | Second offset, downwards. | 25,400 |
shadowScaleXToX | Fixed | Transform matrix applied to the shape to make the shadow, with the next six. | 65,536 |
shadowScaleYToX | Fixed | Matrix. | 0 |
shadowScaleXToY | Fixed | Matrix. | 0 |
shadowScaleYToY | Fixed | Matrix. | 65,536 |
shadowPerspectiveX | Fixed | Matrix. | 0 |
shadowPerspectiveY | Fixed | Matrix. | 0 |
shadowWeight | Fixed | Scale of the perspective terms. | 32,768 |
shadowOriginX, shadowOriginY | Fixed | Origin of the transform from the shape’s centre, as fractions of its rotated width and height. | 0 |
fshadowObscured | Boolean | Excel 5-style shadow. | False |
fShadowOK | Boolean | The shadow may be set. | True |
3-D effects
| Property | Type | Meaning | Default |
|---|---|---|---|
f3D | Boolean | The shape has a 3-D effect. | False |
f3DOK | Boolean | 3-D may be set. | True |
c3DSpecularAmt | Fixed | Specular amount of the material. | 0 |
c3DDiffuseAmt | Fixed | Diffusion of the material. | 65,536 |
c3DShininess | Long | Shininess. | 5 |
c3DEdgeThickness | EMU | Specular edge thickness. | 12,700 |
c3DExtrudeForward | EMU | Extrusion forwards. | 0 |
c3DExtrudeBackward | EMU | Extrusion backwards. | 457,200 |
c3DExtrusionColor | Colour | Colour of the extrusion. | – |
fc3DUseExtrusionColor | Boolean | The extrusion colour is set. | False |
fc3DMetallic | Boolean | Metallic specularity. | False |
fc3DLightFace | Boolean | Light the face of the shape. | True |
fc3DConstrainRotation | Boolean | True: rotate by c3DYRotationAngle about the y axis, then by c3DXRotationAngle. False: rotate by c3DRotationAngle about the axis c3DRotationAxisX/Y/Z. | True |
c3DYRotationAngle | Angle | Degrees about the y axis. | 0 |
c3DXRotationAngle | Angle | Degrees about the x axis. | 0 |
c3DRotationAxisX, c3DRotationAxisY, c3DRotationAxisZ | Long | Rotation axis; only the ratios matter. | 100, 0, 0 |
c3DRotationAngle | Angle | Rotation about that axis. | 0 |
fC3DRotationCenterAuto | Boolean | Rotate about the centre of the 3-D bounding cube instead of the given centre. | False |
c3DRotationCenterX, c3DRotationCenterY | Fixed | Rotation centre as 16.16 fractions of the geometry’s width and height, (0,0) at its centre. | 0 |
c3DRotationCenterZ | EMU | Rotation centre depth, absolute. | 0 |
c3DRenderMode | Long | 0 full detail, 1 wire frame, 2 bounding cube. | – |
c3DXViewpoint | EMU | Viewpoint x. | 1,250,000 |
c3DYViewpoint | EMU | Viewpoint y. | −1,250,000 |
c3DZViewpoint | EMU | Viewing distance. | 9,000,000 |
c3DOriginX, c3DOriginY | Fixed | Origin the viewpoint is measured from, as 16.16 multiples of the bounding box from its centre; uses the transformed path, not the geometry box. | 32,768, −32,768 |
c3DSkewAngle | Fixed | Skew angle. | −8,847,360 (−135°) |
c3DSkewAmount | Long | Skew amount, per cent. | 50 |
c3DAmbientIntensity | Fixed | Ambient light; keep low (0 to 0.1). | 20,000 |
c3DKeyX, c3DKeyY, c3DKeyZ | Long | Direction of the key light; only the ratios matter. | 50,000, 0, 10,000 |
c3DKeyIntensity | Fixed | Key light intensity; nominal maximum 1. | 38,000 |
c3DFillX, c3DFillY, c3DFillZ | Long | Direction of the fill light, a second, dimmer light usually 90° to 180° from the key light. | −50,000, 0, 10,000 |
c3DFillIntensity | Fixed | Fill light intensity. | 38,000 |
fc3DParallel | Boolean | Parallel projection (a skew of 0 then gives orthographic). | True |
fc3DKeyHarsh | Boolean | Harsh key light. | True |
fc3DFillHarsh | Boolean | Harsh fill light. | False |
c3DCrMod | Colour | Change for black-and-white views. | Undefined |
c3DTolerance | Fixed | 3-D tolerance. | 30,000 |
Perspective
| Property | Type | Meaning | Default |
|---|---|---|---|
fPerspective | Boolean | Perspective on. | – |
perspectiveType | Number | Where the transform applies: 0 absolute, 1 shape, 2 drawing. | 1 |
perspectiveScaleXToX, perspectiveScaleYToX, perspectiveScaleXToY, perspectiveScaleYToY | Fixed | Transform matrix, each term scaled by perspectiveWeight. | 65,536, 0, 0, 65,536 |
perspectiveOffsetX, perspectiveOffsetY | Fixed | Matrix offsets. | 0 |
perspectivePerspectiveX, perspectivePerspectiveY | Fixed | Matrix perspective terms. | 0 |
perspectiveOriginX, perspectiveOriginY | Fixed | Origin of the transform. | 32,768 |
perspectiveWeight | Fixed | Scale factor. | 256 |
Callout
| Property | Type | Meaning | Default |
|---|---|---|---|
fCallout | Boolean | The shape is a callout. | False |
spcot | Number | Callout type: 1 right angle, 2 one segment, 3 two segments, 4 three segments. | 3 |
spcoa | Number | Angle: 1 any, 2 30°, 3 45°, 4 60°, 5 90°. | 1 |
spcod | Number | Drop: 0 top, 1 centre, 2 bottom, 3 given by dxyCalloutDropSpecified. | 3 |
dxyCalloutGap | EMU | Distance from the box to the first point. | 76,200 |
dxyCalloutDropSpecified | EMU | The drop distance when spcod is 3. | 114,300 |
dxyCalloutLengthSpecified | EMU | The length when fCalloutLengthSpecified is true. | 0 |
fCalloutLengthSpecified | Boolean | True: use the given length. False: best fit. | False |
fCalloutAccentBar | Boolean | Accent bar. | False |
fCalloutTextBorder | Boolean | Border round the text. | True |
fCalloutDropAuto | Boolean | Auto-attach; a converter should sometimes invert the drop distance. | False |
fCalloutMinusX | Boolean | The callout’s line is to the right. | False |
fCalloutMinusY | Boolean | The callout’s line goes down. | False |
Connectors and black-and-white modes
| Property | Type | Meaning | Default |
|---|---|---|---|
cxk | Number | Connection sites: 0 none, 1 segments, 2 custom, 3 rectangle. | 1 |
cxstyle | Number | Connector style: 0 straight, 1 bent, 2 curved, 3 none. | 3 |
bWMode | Number | How to draw in black-and-white mode: 0 colour, 1 automatic, 2 greyscale, 3 light greyscale, 4 inverse grey, 5 grey outline, 6 black text and line, 7 high contrast, 8 black, 9 white, 10 do not show, 11 (the number of modes). | 1 |
bWModeBW | Number | Same values as bWMode. | 1 |
bWModePureBW | Number | Same values as bWMode. | 1 |
The specification gives one description, “settings for modifications to be made when in different forms of black-and-white mode”, for all three, and does not say which form each one is for.
The specification prints a few names with a capital first letter
(Rotation, ShapeType, PictureBrightness,
ShadowOriginY, FillOriginY); Word writes them with a
lower-case one, as listed here.
Shape types
Values of the shapeType property. 32 to 40 and 189 to 200 are not
listed.
| N | Shape | N | Shape | N | Shape |
|---|---|---|---|---|---|
| 0 | Freeform or non-AutoShape | 1 | Rectangle | 2 | Round rectangle |
| 3 | Ellipse | 4 | Diamond | 5 | Isosceles triangle |
| 6 | Right triangle | 7 | Parallelogram | 8 | Trapezoid |
| 9 | Hexagon | 10 | Octagon | 11 | Plus sign |
| 12 | Star | 13 | Arrow | 14 | Thick arrow |
| 15 | Home plate | 16 | Cube | 17 | Balloon |
| 18 | Seal | 19 | Arc | 20 | Line |
| 21 | Plaque | 22 | Can | 23 | Donut |
| 24 | Text simple | 25 | Text octagon | 26 | Text hexagon |
| 27 | Text curve | 28 | Text wave | 29 | Text ring |
| 30 | Text on curve | 31 | Text on ring | 41 | Callout 1 |
| 42 | Callout 2 | 43 | Callout 3 | 44 | Accent callout 1 |
| 45 | Accent callout 2 | 46 | Accent callout 3 | 47 | Border callout 1 |
| 48 | Border callout 2 | 49 | Border callout 3 | 50 | Accent border callout 1 |
| 51 | Accent border callout 2 | 52 | Accent border callout 3 | 53 | Ribbon |
| 54 | Ribbon 2 | 55 | Chevron | 56 | Pentagon |
| 57 | No smoking | 58 | Seal 8 | 59 | Seal 16 |
| 60 | Seal 32 | 61 | Wedge rectangle callout | 62 | Wedge round rectangle callout |
| 63 | Wedge ellipse callout | 64 | Wave | 65 | Folded corner |
| 66 | Left arrow | 67 | Down arrow | 68 | Up arrow |
| 69 | Left-right arrow | 70 | Up-down arrow | 71 | Irregular seal 1 |
| 72 | Irregular seal 2 | 73 | Lightning bolt | 74 | Heart |
| 75 | Picture frame | 76 | Quad arrow | 77 | Left arrow callout |
| 78 | Right arrow callout | 79 | Up arrow callout | 80 | Down arrow callout |
| 81 | Left-right arrow callout | 82 | Up-down arrow callout | 83 | Quad arrow callout |
| 84 | Bevel | 85 | Left bracket | 86 | Right bracket |
| 87 | Left brace | 88 | Right brace | 89 | Left-up arrow |
| 90 | Bent-up arrow | 91 | Bent arrow | 92 | Seal 24 |
| 93 | Striped right arrow | 94 | Notched right arrow | 95 | Block arc |
| 96 | Smiley face | 97 | Vertical scroll | 98 | Horizontal scroll |
| 99 | Circular arrow | 100 | Notched circular arrow | 101 | U-turn arrow |
| 102 | Curved right arrow | 103 | Curved left arrow | 104 | Curved up arrow |
| 105 | Curved down arrow | 106 | Cloud callout | 107 | Ellipse ribbon |
| 108 | Ellipse ribbon 2 | 109 | Flowchart process | 110 | Flowchart decision |
| 111 | Flowchart input/output | 112 | Flowchart predefined process | 113 | Flowchart internal storage |
| 114 | Flowchart document | 115 | Flowchart multidocument | 116 | Flowchart terminator |
| 117 | Flowchart preparation | 118 | Flowchart manual input | 119 | Flowchart manual operation |
| 120 | Flowchart connector | 121 | Flowchart punched card | 122 | Flowchart punched tape |
| 123 | Flowchart summing junction | 124 | Flowchart or | 125 | Flowchart collate |
| 126 | Flowchart sort | 127 | Flowchart extract | 128 | Flowchart merge |
| 129 | Flowchart offline storage | 130 | Flowchart online storage | 131 | Flowchart magnetic tape |
| 132 | Flowchart magnetic disk | 133 | Flowchart magnetic drum | 134 | Flowchart display |
| 135 | Flowchart delay | 136 | Text plain text | 137 | Text stop |
| 138 | Text triangle | 139 | Text triangle inverted | 140 | Text chevron |
| 141 | Text chevron inverted | 142 | Text ring inside | 143 | Text ring outside |
| 144 | Text arch up curve | 145 | Text arch down curve | 146 | Text circle curve |
| 147 | Text button curve | 148 | Text arch up pour | 149 | Text arch down pour |
| 150 | Text circle pour | 151 | Text button pour | 152 | Text curve up |
| 153 | Text curve down | 154 | Text cascade up | 155 | Text cascade down |
| 156 | Text wave 1 | 157 | Text wave 2 | 158 | Text wave 3 |
| 159 | Text wave 4 | 160 | Text inflate | 161 | Text deflate |
| 162 | Text inflate bottom | 163 | Text deflate bottom | 164 | Text inflate top |
| 165 | Text deflate top | 166 | Text deflate inflate | 167 | Text deflate inflate deflate |
| 168 | Text fade right | 169 | Text fade left | 170 | Text fade up |
| 171 | Text fade down | 172 | Text slant up | 173 | Text slant down |
| 174 | Text can up | 175 | Text can down | 176 | Flowchart alternate process |
| 177 | Flowchart off-page connector | 178 | Callout 90 | 179 | Accent callout 90 |
| 180 | Border callout 90 | 181 | Accent border callout 90 | 182 | Left-right-up arrow |
| 183 | Sun | 184 | Moon | 185 | Bracket pair |
| 186 | Brace pair | 187 | Seal 4 | 188 | Double wave |
| 201 | Host control | 202 | Text box |
Example
A text box 1.5 inches wide and half an inch high, placed relative to the column and paragraph, with a red line 1 point wide:
{\shp{\*\shpinst\shpleft0\shptop0\shpright2160\shpbottom720\shpfhdr0\shpbxcolumn\shpbypara
\shpwr2\shpwrk0\shpfblwtxt0\shpz0\shplid1025
{\sp{\sn shapeType}{\sv 202}}
{\sp{\sn lineColor}{\sv 255}}
{\sp{\sn lineWidth}{\sv 12700}}
{\shptxt \pard\plain Text in the box\par}}
{\shprslt …the same box as a \do drawing object…}}
2,160 twips is 1.5 inches; colour 255 is red (red in the low byte); 12,700 EMUs is 1 point.