• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Laying Out Text in SVG > The textPath Element

The textPath Element

As well as laying out text on a straight line, SVG allows us to apply text to any arbitrary path. The creation of paths in SVG, using the path element, was described in Chapter 6, “Paths in SVG.” The SVGTextPathElement object was described in “The SVG DOM Interfaces” section of Chapter 6.

The textPath element is nested within a text element and has an xlink:href attribute that references a path element, elsewhere in the document, which possesses an id attribute. Listing 8.15 shows a basic example using the textPath element. The text is displayed twice—first without showing the underlying path, and second with the underlying path displayed beneath the text.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint