lengthAdjust
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since Juli 2015.
Das Attribut lengthAdjust steuert, wie der Text auf die durch das Attribut textLength definierte Länge gestreckt wird.
Sie können dieses Attribut mit den folgenden SVG-Elementen verwenden:
Beispiel
html
<svg width="300" height="150" xmlns="http://www.w3.org/2000/svg">
<g font-face="sans-serif">
<text x="0" y="20" textLength="300" lengthAdjust="spacing">
Stretched using spacing only.
</text>
<text x="0" y="50" textLength="300" lengthAdjust="spacingAndGlyphs">
Stretched using spacing and glyphs.
</text>
<text x="0" y="80" textLength="100" lengthAdjust="spacing">
Shrunk using spacing only.
</text>
<text x="0" y="110" textLength="100" lengthAdjust="spacingAndGlyphs">
Shrunk using spacing and glyphs.
</text>
</g>
</svg>
Nutzungshinweise
| Wert | spacing | spacingAndGlyphs |
|---|---|
| Standardwert | spacing |
| Animierbar | Ja |
Spezifikationen
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # TextElementLengthAdjustAttribute> |