L.5.5.1 OfficeArt Shapes
L.5.5.1 OfficeArt Shapes
WordprocessingML takes advantage of the template-based shape definition VML provides. This example shows how the two shapes in the screenshot below are created.
The star is first defined using a ShapeType.
<v:shapetype id="_x0000_t12" coordsize="21600,21600" o:spt="12"
path="m10800,l8280,8259,,8259r6720,5146l4200,21600r6600,
-5019l17400,21600,14880,13405,21600,8259r-8280,xe">
<v:stroke joinstyle="miter" />
<v:path gradientshapeok="t" o:connecttype="custom"
…
o:connectlocs="10800,0;0,8259;4200,21600;17400,21600;21600,8259"
textboxrect="6720,8259,14880,15628" />
</v:shapetype>
The first star is created by referencing the ShapeType via the Type attribute. It sets its own positioning and scaling.
<v:shape id="_x0000_s1026" type="#_x0000_t12"
style="position:absolute;margin-left:33pt;margin-top:25.5pt;
width:47.25pt;height:47.25pt;z-index:251656704" />
The second star is created by referencing the ShapeType and providing its own positioning, scaling and formatting.
<v:shape id="_x0000_s1027" type="#_x0000_t12"
style="position:absolute;margin-left:145.5pt;margin-top:25.5pt;
width:47.25pt;height:47.25pt;z-index:251657728"
fillcolor="#4f81bd [3204]" strokecolor="#f2f2f2 [3041]"
strokeweight="3pt">
<v:shadow on="t" type="perspective" color="#27405e [1604]"
opacity=".5" offset="1pt" offset2="-1pt" />
</v:shape>
The example contains only the two star shapes. What follows is the entire document:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<w:document "…">
<w:body>
<w:p>
<w:r w:rsidR="00496863">
<w:rPr>
<w:noProof />
</w:rPr>
<w:pict>
<v:shapetype id="_x0000_t12" coordsize="21600,21600"
o:spt="12"
path="m10800,l8280,8259,,8259r6720,5146l4200,21600r6600,
-5019l17400,21600,14880,13405,21600,8259r-8280,xe">
<v:stroke joinstyle="miter" />
<v:path gradientshapeok="t" o:connecttype="custom"
o:connectlocs="10800,0;0,8259;4200,21600;
17400,21600;21600,8259"
textboxrect="6720,8259,14880,15628" />
</v:shapetype>
<v:shape id="_x0000_s1026" type="#_x0000_t12"
style="position:absolute;margin-left:33pt;
margin-top:25.5pt;
width:47.25pt;height:47.25pt;z-index:251656704" />
</w:pict>
</w:r>
<w:r w:rsidR="00496863">
<w:rPr>
<w:noProof />
</w:rPr>
<w:pict>
<v:shape id="_x0000_s1027" type="#_x0000_t12"
style="position:absolute;margin-left:145.5pt;
margin-top:25.5pt;width:47.25pt;height:47.25pt;
z-index:251657728" fillcolor="#4f81bd [3204]"
strokecolor="#f2f2f2 [3041]" strokeweight="3pt">
<v:shadow on="t" type="perspective"
color="#27405e [1604]"
opacity=".5" offset="1pt" offset2="-1pt" />
</v:shape>
</w:pict>
</w:r>
</w:p>
<w:sectPr w:rsidR="00953D70" w:rsidSect="00667294">
<w:pgSz w:w="12240" w:h="15840" />
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440"
w:left="1440"
w:header="720" w:footer="720" w:gutter="0" />
<w:cols w:space="720" />
<w:docGrid w:linePitch="360" />
</w:sectPr>
</w:body>
</w:document>
Last updated on