lengthAdjust

The lengthAdjust attribute controls how the text is stretched into the length defined by the textLength 属性。

You can use this attribute with the following SVG elements:

范例

<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>

					

用法注意事项

spacing | spacingAndGlyphs
默认值 spacing
Animatable Yes

规范

规范 状态 注释
Scalable Vector Graphics (SVG) 2
The definition of 'lengthAdjust' in that specification.
候选推荐 无变化
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of 'lengthAdjust' in that specification.
推荐 初始定义

浏览器兼容性

BCD tables only load in the browser

Found a problem with this page?

最后修改: , 由 MDN 贡献者