lengthAdjust
Baseline
Weitgehend verfügbar
Diese Funktion ist gut etabliert und funktioniert auf vielen Geräten und in vielen Browserversionen. Sie ist seit Juli 2015 browserübergreifend verfügbar.
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
| Spezifikation |
|---|
| Scalable Vector Graphics (SVG) 2> # TextElementLengthAdjustAttribute> |