XML technologies / SVG / Using text elements / Available SVG tags for text elements / The attributes of the text tag

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

The <text> tag also has several attributes, mainly universal ones. It has the attributes x, y, textLength, lengthAdjust, style and id.

Use x and y to set the text’s position, always referring to its lower-left corner. Text at 0/0 is therefore invisible. Text 16 pixels high must be positioned at least at 0/16 to be fully visible. The id attribute names text for reuse elsewhere, as explained on the next page.

Note:
If you neither specify the attributes x and y nor align the text to a path, it is created at 0/0 and remains invisible.

The attribute textLength sets the text width. It is useful only together with the attribute lengthAdjust, which determines how the desired width is achieved. Available values are spacing and spacingAndGlyphs. With spacing, only the spacing between letters changes; with spacingAndGlyphs, individual characters are also adjusted if necessary.

Note:
Adobe SVG Viewer supports neither attribute.

   

 

 

 

back to top