TextPath Element

HTML (DHTML)

TextPath Element

Internet Development Index

Defines a text path for a shape.

The following attributes modify a text path.

AttributeDescription
FitPathDefines whether the text fits the path of a shape.
FitShapeDefines whether the text fits the shape boundaries.
Font-FamilySpecifies the font-family of text.
Font-SizeSpecifies the font-size of text.
Font-StyleSpecifies the font-style of text.
Font-VariantSpecifies the font-variant of text.
Font-WeightSpecifies the font-weight of text.
FontSpecifies the compound font value of text.
MSO-Text-ShadowDefines whether a shadow is applied to the text.
OnDefines whether the text is displayed.
StringDefines the text string.
Text-DecorationDefines the text-decoration of the text.
TrimDefines whether extra space is removed above and below the text.
V-Rotate-LettersDetermines whether the letters of the text are rotated.
V-Same-Letter-HeightsDetermines whether all letters will have the same height.
V-Text-AlignDefines the alignment of the text.
V-Text-KernDetermines whether kerning is turned on.
V-Text-ReverseDetermines whether the layout order of rows is reversed.
V-Text-Spacing-ModeDefines the mode for letterspacing.
V-Text-SpacingDefines the amount of spacing for text.
XScaleDetermines whether a straight textpath will be used instead of the shape path.

Remarks

This element must be defined within a Shape element.

In addition to the normal fill, string, and style attributes, the TextPathOK attribute of Path must be set to True and the On attribute of TextPath must be set to True to display text on a text path.

The following is the minimum code needed to display text on a path.

   <v:line from="50 200" to="400 100">
   <v:fill on="True" color="red"/>
   <v:path textpathok="True"/>
   <v:textpath on="True" string="VML Text"
   style="font:normal normal normal 36pt Arial"/>
   </v:line>

Examples

Click here to view text drawn along a straight line.

Click here to view text drawn along a dynamic curved line.

Click here to view different styles of text along a text path.