web api interface
SVGTextContentElement
The SVGTextContentElement interface is implemented by elements that support rendering child text content. It is inherited by various text-related interfaces, such as SVGTextElement, SVGTSpanElement, and SVGTextPathElement.
Instance properties
This interface also inherits properties from its parent, SVGGraphicsElement.
textLengthRead only- : An
SVGAnimatedLengthreflecting thetextLengthattribute of the given element.
- : An
lengthAdjustRead only- : An
SVGAnimatedEnumerationreflecting thelengthAdjustattribute of the given element. The numeric type values represent one of theLENGTHADJUST_*constant values.
- : An
Instance methods
This interface also inherits methods from its parent, SVGGraphicsElement.
getNumberOfChars()- : Returns a long representing the total number of addressable characters available for rendering within the current element, regardless of whether they will be rendered.
getComputedTextLength()- : Returns a float representing the computed length for the text within the element.
getSubStringLength()- : Returns a float representing 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 is ignored.
getStartPositionOfChar()- : Returns a
DOMPointrepresenting the position of a typographic character after text layout has been performed.
- : Returns a
getEndPositionOfChar()- : Returns a
DOMPointrepresenting the trailing position of a typographic character after text layout has been performed.
- : Returns a
getExtentOfChar()- : Returns a
DOMRectrepresenting the computed tight bounding box of the glyph cell that corresponds to a given typographic character.
- : Returns a
getRotationOfChar()- : Returns a float representing the rotation of typographic character.
getCharNumAtPosition()- : Returns a long representing the character which caused a text glyph to be rendered at a given position in the coordinate system. Because the relationship between characters and glyphs is not one-to-one, only the first character of the relevant typographic character is returned.
selectSubString()Deprecated- : Selects text within the element.
Static properties
LENGTHADJUST_UNKNOWN(0)- : The type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
LENGTHADJUST_SPACING(1)- : Corresponds to the value
spacing.
- : Corresponds to the value
LENGTHADJUST_SPACINGANDGLYPHS(2)- : Corresponds to the value
spacingAndGlyphs.
- : Corresponds to the value
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.