Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ISvgTextContainer2

interface ISvgTextContainer2
Extends ISvgTextContainer Extends ISvgTextContainer with the SVG textLength attribute, which constrains the rendered text to an author-specified advance length. Applies to text, tspan, and textPath content. Obtain via TryQueryInterface<ISvgTextContainer2>().

Methods

setTextLength()

void setTextLength(SvgLength textLength)
Sets the textLength attribute — the author-specified total advance the rendered text should occupy. The text is fit to this length by distributing across the spacing between glyphs (i.e. adjusting letter-spacing); the glyph shapes themselves are not scaled. A value larger than the natural text width spreads the glyphs apart; a value smaller than the natural width compresses them. Very small, zero, or negative values are not clamped: the inter-glyph spacing becomes negative, so glyphs overlap (and, for negative values, run in reverse). No error is raised for zero or negative values. On a ISvgTextPath, glyphs whose midpoint is pushed off the path (e.g. by a large/negative textLength) are not rendered. By default no textLength is applied and the text uses its natural advance width.

Parameters

textLength
SvgLength — Required SvgLength the target advance length.
Last modified on October 29, 2026