Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The getSubStringLength() method of the SVGTextContentElement interface represents the computed length of the formatted text advance distance for a substring of text within the element.
Note that this method only accounts for the widths of the glyphs in the substring and any extra spacing inserted by the CSS letter-spacing and word-spacing properties. Visual spacing adjustments made by the x attribute are ignored.
An integer; the start index of the substring.
lengthAn integer; the number of characters to include in the substring.
A float.
Thrown if the index is greater than the highest index or length is negative.
| Scalable Vector Graphics (SVG) 2 # __svg__SVGTextContentElement__getSubStringLength |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Dec 17, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.