[Table of Contents] [docx version]
Error! No text of specified style in document.
This element specifies when a preset geometric shape should be used to transform a piece of text. This operation is known formally as a text warp. The generating application should be able to render all preset geometries enumerated in the ST_TextShapeType list.
[Example: Consider the case where the user wishes to accent a piece of text by warping it's shape. For this to occur a preset shape will be chosen from the ST_TextShapeType list and applied to the entire body of text.
<p:sp>
<p:txBody>
<a:bodyPr wrap="none" rtlCol="0">
<a:prstTxWarp prst="textInflate">
</a:prstTxWarp>
<a:spAutoFit/>
</a:bodyPr>
<a:lstStyle/>
<a:p>
…
<a:t>Sample Text</a:t>
…
</a:p>
</p:txBody>
</p:sp>
The resulting text that has now had the Inflate text warp applied to it is shown above. end example]
Using any of the presets listed under the ST_TextShapeType list below it is possible to apply a text warp to a run of DrawingML text via the following steps.
If you look at any of the text warps in the file format you will notice that each consists of two paths. This corresponds to a top path (first one specified) and a bottom path (second one specified). Now the top path and the bottom path represent the top line and base line that the text needs to be warped to. How this is done is in the following way.
1. Compute the rectangle that the unwarped text resides in. (tightest possible rectangle around text, no white space except for “space characters”)
1. Take each of the quadratic and cubic Bezier curves that are used to calculate the original character and change their end points and control points by the following method…
2. Move a vertical line horizontally along the original text rectangle and find the horizontal percentage that a given end point or control point lives at. (.5 for the middle for instance)
3. Now do the same thing for this point vertically. Find the vertical percentage that this point lives at with the top and bottom of this text rectangle being the respective top and bottom bounds. (0.0 and 1.0 respectively)
4. Now that we have the percentages for a given point in a Bezier equation we can map that to the new point in the warped text environment.
5. Going back to the top and bottom paths specified in the file format we can take these and flatten them out to a straight arc (top and bottom might be different lengths)
6. After they are straight we can measure them both horizontally to find the same percentage point that we found within the original text rectangle. (0.5 let’s say)
7. So then we measure 50% along the top path and 50% along the bottom path, putting the paths back to their original curvy shapes.
8. Once we have these two points we can draw a line between them that will serve as our vertical line in the original text rectangle (note: this might not be truly vertical as 50% on the top does not always line up with 50% on the bottom)
9. Taking this new line we then follow it from top to bottom the vertical percentage amount that we got from step 4.
10. This is then the new point that should be used in place of the old point in the original text rectangle.
11. We will then continue doing these same steps for each of the end points and control points within the body of text. (is applied to a whole body of text only)
[Note: Horizxontal percentages begin at 0.0 and continue to 1.0, left to right. Vertical percentages begin at 0.0 and continue to 1.0, top to bottom. end note]
[Note: Since this is a shape it does have both a shape coordinate system and a path coordinate system. end note]
Parent Elements |
bodyPr (§5.1.5.1.1) |
Child Elements |
Subclause |
avLst (List of Shape Adjust Values) |
§5.1.11.5 |
Attributes |
Description |
prst (Preset Warp Shape) |
Specifies the preset geometry that will be used for a shape warp on a piece of text. This preset can have any of the values in the enumerated list for ST_TextShapeType. This attribute is required in order for a text warp to be rendered.
[Example: Consider the sample DrawingML below.
<p:sp> <a:lstStyle/>
In the above example a preset text shape geometry has been used to define the warping shape. The shape utilized here is the sun shape. end example]
The possible values for this attribute are defined by the ST_TextShapeType simple type (§5.1.12.76). |
The following XML Schema fragment defines the contents of this element:
<complexType name="CT_PresetTextShape">
<sequence>
<element name="avLst" type="CT_GeomGuideList" minOccurs="0" maxOccurs="1"/>
</sequence>
<attribute name="prst" type="ST_TextShapeType" use="required"/>
</complexType>