XML technologies / SVG / Using text elements / Available SVG tags for text elements / Using the textPath tag correctly

(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)

The <textPath> tag has the attributes xlink:href, startOffset, method and spacing.

The attribute xlink:href references the path for text alignment, using its name prefixed with #. For a path named "pfad1", assign the attribute the value "#pfad1", as follows:

xlink:href="#pfad1"

The attribute startOffset shifts the text’s starting point. Normally text begins at the path’s start; specify pixels or a percentage to indent it.

Percentages refer to path length. For a 100-pixel path, 15% means 15 pixels. The specification startOffset="15%" indents the text by 15%.

The method parameter determines how text fits the path. Its two alternative values are align and stretch. align is the default if the attribute is omitted. It simply rotates individual letters to follow the path. With stretch, letters can also be distorted for a smoother fit.

Note:
Adobe SVG Viewer currently does not support the attribute method. It reports no error, but changing the method attribute produces no visible difference.

The attribute spacing controls how letter spacing is calculated. Its values are auto and exact. With auto, spacing is calculated for the best visual result. With exact, the selected font’s standard spacing is retained.

Note:
Adobe SVG Viewer does not yet support this attribute either.

   

 

 

 

back to top