W3cubDocs

/Haxe JavaScript

TextContentElement

package js.html.svg

extends GraphicsElementElementDOMElementNodeEventTarget

extended by TextPathElement, TextPositioningElement

Available on js

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.

Documentation SVGTextContentElement by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Static variables

staticinlineread onlyLENGTHADJUST_SPACING:Int = 1

staticinlineread onlyLENGTHADJUST_SPACINGANDGLYPHS:Int = 2

staticinlineread onlyLENGTHADJUST_UNKNOWN:Int = 0

Variables

read onlylengthAdjust:AnimatedEnumeration

An SVGAnimatedEnumeration reflecting the lengthAdjust attribute of the given element. The numeric type values represent one of the constant values above.

read onlytextLength:AnimatedLength

An SVGAnimatedLength reflecting the textLength attribute of the given element.

Methods

getCharNumAtPosition(point:Point):Int

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

getComputedTextLength():Float

Returns a float representing the computed length for the text within the element.

getEndPositionOfChar(charnum:Int):Point

Returns a 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.

	@throws DOMError

getExtentOfChar(charnum:Int):Rect

Returns a DOMRect representing the computed tight bounding box of the glyph cell that corresponds to a given typographic character.

Throws:

null

DOMError

getNumberOfChars():Int

Returns a long representing the total number of addressable characters available for rendering within the current element, regardless of whether they will be rendered.

getRotationOfChar(charnum:Int):Float

Returns a float representing the rotation of typographic character.

Throws:

null

DOMError

getStartPositionOfChar(charnum:Int):Point

Returns a DOMPoint representing the position of a typographic character after text layout has been performed. Note: In SVG 1.1 this method returned an SVGPoint.

	@throws DOMError

getSubStringLength(charnum:Int, nchars:Int):Float

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.

Throws:

null

DOMError

selectSubString(charnum:Int, nchars:Int):Void

Selects text within the element.

Throws:

null

DOMError

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/svg/TextContentElement.html