XML technologies / SVG / Creating simple SVG graphics / SVG tag syntax / The text tag
(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)
You have already seen the <text> tag. It displays the text defined between <text> and </text>. Besides the universal attributes id, style, x and y, it also has the attributes textLength and lengthAdjust.
The property textLength specifies the desired text length, allowing the rendering program to compare the rendered and desired results. Rendering means building the graphic: calculating screen pixel positions from source code. This attribute can only be used with the attribute lengthAdjust, which determines how to achieve that length. Its values can be spacing or spacingAndGlyphs. With spacing, letter spacing is adjusted to reach the desired length. With spacingAndGlyphs, letters themselves are compressed or widened if necessary.
Note:
SVG Viewer does not yet support either attribute, so using them is not currently useful.
Text may cause problems with German umlauts or special characters. Solutions and other text features are explained in more detail under Using text elements.
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