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, SVGTRefElement, SVGAltGlyphElement and SVGTextPathElement.
| Constant | Value | Description |
| LENGTHADJUST_UNKNOWN | 0 | Some other value. |
| LENGTHADJUST_SPACING | 1 | The spacing keyword. |
| LENGTHADJUST_SPACINGANDGLYPHS | 2 | The spacingAndGlyphs keyword. |
This interface also inherits properties from its parent, SVGGraphicsElement.
SVGTextContentElement.textLength Read only
SVGAnimatedLength reflecting the textLength attribute of the given element.SVGTextContentElement.lengthAdjust Read only
SVGAnimatedEnumeration reflecting the lengthAdjust attribute of the given element. The numeric type values represent one of the constant values above.This interface also inherits methods from its parent, SVGGraphicsElement.
SVGTextContentElement.getNumberOfChars()SVGTextContentElement.getComputedTextLength()SVGTextContentElement.getSubStringLength()SVGTextContentElement.getStartPositionOfChar()DOMPoint representing the position of a typographic character after text layout has been performed. Note: In SVG 1.1 this method returned an SVGPoint.
SVGTextContentElement.getEndPositionOfChar()DOMPoint representing the trailing position of a typographic character after text layout has been performed. Note: In SVG 1.1 this method returned an SVGPoint.
SVGTextContentElement.getExtentOfChar()DOMRect representing the computed tight bounding box of the glyph cell that corresponds to a given typographic character.SVGTextContentElement.getRotationOfChar()SVGTextContentElement.getCharNumAtPosition()SVGTextContentElement.selectSubString()
| Specification | Status | Comment |
|---|---|---|
| Scalable Vector Graphics (SVG) 2 The definition of 'SVGTextContentElement' in that specification. | Candidate Recommendation | Changed inheritance from SVGElement to SVGGraphicsElement and getStartPositionOfChar() and removed implementations of SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGStylable interfaces and getEndPositionOfChar() to return a DOMPoint instead of an SVGPoint. |
| Scalable Vector Graphics (SVG) 1.1 (Second Edition) The definition of 'SVGTextContentElement' in that specification. | Recommendation | Initial definition |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | Yes | 12 | Yes | Yes | Yes | ? |
lengthAdjust |
? | ? | ? | ? | ? | ? |
textLength |
? | ? | ? | ? | ? | ? |
getCharNumAtPosition |
? | ? | ? | ? | ? | ? |
getComputedTextLength |
? | ? | ? | ? | ? | ? |
getEndPositionOfChar |
? | ? | ? | ? | ? | ? |
getExtentOfChar |
? | ? | ? | ? | ? | ? |
getNumberOfChars |
? | ? | ? | ? | ? | ? |
getRotationOfChar |
? | ? | ? | ? | ? | ? |
getStartPositionOfChar |
? | ? | ? | ? | ? | ? |
getSubStringLength |
? | ? | ? | ? | ? | ? |
selectSubString
|
? | ? | ? | ? | ? | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Yes | Yes | 12 | Yes | Yes | ? | ? |
lengthAdjust |
? | ? | ? | ? | ? | ? | ? |
textLength |
? | ? | ? | ? | ? | ? | ? |
getCharNumAtPosition |
? | ? | ? | ? | ? | ? | ? |
getComputedTextLength |
? | ? | ? | ? | ? | ? | ? |
getEndPositionOfChar |
? | ? | ? | ? | ? | ? | ? |
getExtentOfChar |
? | ? | ? | ? | ? | ? | ? |
getNumberOfChars |
? | ? | ? | ? | ? | ? | ? |
getRotationOfChar |
? | ? | ? | ? | ? | ? | ? |
getStartPositionOfChar |
? | ? | ? | ? | ? | ? | ? |
getSubStringLength |
? | ? | ? | ? | ? | ? | ? |
selectSubString
|
? | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement