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.
Copyright © verlag moderne industrie GmbH 2001
You may print the online version for your private use.
Otherwise, this chapter from “Das Einsteigerseminar SVG — Webgrafiken mit XML” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
verlag moderne industrie GmbH, Justus-von-Liebig-Straße 1, D-86899 Landsberg/Lech, fon ++49 (0) 81 91 / 125 – 0, leserservice(at)mi-verlag.de
back to top