@DOMObjectAttribute @DOMNameAttribute(name="SVGTextContentElement") public class SVGTextContentElement extends SVGGraphicsElement
The SVGTextContentElement is inherited by various text-related interfaces, such as SVGTextElement, SVGTSpanElement, SVGTRefElement, SVGAltGlyphElement and SVGTextPathElement. For the methods on this interface that refer to an index to a character or a number of characters, these references are to be interpreted as an index to a UTF-16 code unit or a number of UTF-16 code units, respectively. This is for consistency with DOM Level 2 Core, where methods on the CharacterData interface use UTF-16 code units as indexes and counts within the character data.Thus for example, if the text content of a 'text’ element is a single non-BMP character, such as U+10000, then invoking getNumberOfChars on that element will return 2 since there are two UTF-16 code units(the surrogate pair) used to represent that one character.
SVGElement
Node.Flags
Modifier and Type | Field and Description |
---|---|
static int |
LENGTHADJUST_SPACING
Corresponds to value 'spacing'.
|
static int |
LENGTHADJUST_SPACINGANDGLYPHS
Corresponds to value 'spacingAndGlyphs'.
|
static int |
LENGTHADJUST_UNKNOWN
The enumeration was set to a value that is not one of predefined types.
|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, flags, nodeDocument, NOTATION_NODE, parent, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
EventMap
PropertyChanged, PropertyChangedDelegate
Constructor and Description |
---|
SVGTextContentElement(com.aspose.html.dom.DOMName name,
Document doc)
Initializes a new instance of the
SVGElement class. |
Modifier and Type | Method and Description |
---|---|
long |
getCharNumAtPosition(SVGPoint point)
Returns the index of the character whose corresponding glyph cell bounding box contains the specified point.
|
float |
getComputedTextLength()
The total sum of all of the advance values from rendering all of the characters within this element, including the advance value on the glyphs (horizontal or vertical), the effect of properties 'kerning’, 'letter-spacing’ and 'word-spacing’ and adjustments due to attributes 'dx’ and 'dy’ on 'tspan’ elements.
|
SVGPoint |
getEndPositionOfChar(long charnum)
Returns the current text position after rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character.
|
SVGRect |
getExtentOfChar(long charnum)
Returns a tightest rectangle which defines the minimum and maximum X and Y values in the user coordinate system for rendering the glyph(s) that correspond to the specified character.
|
SVGAnimatedEnumeration |
getLengthAdjust()
Corresponds to attribute 'lengthAdjust’ on the given element.
|
long |
getNumberOfChars()
Returns the total number of characters available for rendering within the current element, which includes referenced characters from 'tref’ reference, regardless of whether they will be rendered.
|
float |
getRotationOfChar(long charnum)
Returns the rotation value relative to the current user coordinate system used to render the glyph(s) corresponding to the specified character.
|
SVGPoint |
getStartPositionOfChar(long charnum)
Returns the current text position before rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character.
|
float |
getSubStringLength(long charnum,
long nchars)
The total sum of all of the advance values from rendering the specified substring of the characters, including the advance value on the glyphs (horizontal or vertical), the effect of properties 'kerning’, 'letter-spacing’ and 'word-spacing’ and adjustments due to attributes 'dx’ and 'dy’ on 'tspan’ elements.
|
SVGAnimatedLength |
getTextLength()
Corresponds to attribute 'textLength’ on the given element.
|
void |
selectSubString(long charnum,
long nchars)
Causes the specified substring to be selected just as if the user selected the substring interactively.
|
getBBox, getCTM, getFarthestViewportElement, getNearestViewportElement, getRequiredExtensions, getRequiredFeatures, getScreenCTM, getSystemLanguage, getTransform
addSVGAttributeBinding, blur, focus, getClassName_SVGElement_New, getId_SVGElement_New, getOwnerSVGElement, getStyle, getSVGAttributeBindings, getSVGContext, getTabIndex, getViewportElement, isReadOnly, isRendered, setId_SVGElement_New, setTabIndex
attachShadow, dispose, equals, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildElementCount, getChildren, getClassName, getComputedStyle, getComputedStyle, getData, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getId, getInnerHTML, getLastElementChild, getLocalName, getNamespaceURI, getNextElementSibling, getNodeName, getNodeType, getOuterHTML, getPrefix, getPreviousElementSibling, getSchemaTypeInfo, getShadowRoot, getStyleContainer, getTag, getTagName, getTextContent, hasAttribute, hasAttributeNS, hasAttributes, querySelector, querySelectorAll, remove, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, setData, setId, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setInnerHTML, setOuterHTML, setTextContent
adoptNode, appendChild, cloneNode, deepClone, finalize, getBaseURI, getChildNodes, getChildNodesInternal, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, getRegisteredObservers, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceAll, replaceChild, setLocalName, setNamespaceURI, setNodeValue, setParentNode, setPrefix, toString
addEventListener, addEventListener, addEventListener, addEventListener, dispatchEvent, dispose, removeEventListener, removeEventListener, removeEventListener
fireNotifyPropertyChanged, getCurrentValues, getRuntimesBinding, setCurrentValues, setField, setRuntimesBinding
@DOMNameAttribute(name="LENGTHADJUST_UNKNOWN") public static final int LENGTHADJUST_UNKNOWN
The enumeration was set to a value that 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.
@DOMNameAttribute(name="LENGTHADJUST_SPACING") public static final int LENGTHADJUST_SPACING
Corresponds to value 'spacing'.
@DOMNameAttribute(name="LENGTHADJUST_SPACINGANDGLYPHS") public static final int LENGTHADJUST_SPACINGANDGLYPHS
Corresponds to value 'spacingAndGlyphs'.
public SVGTextContentElement(com.aspose.html.dom.DOMName name, Document doc)
Initializes a new instance of the SVGElement
class.
name
- The element name.doc
- The document.@DOMNameAttribute(name="textLength") public SVGAnimatedLength getTextLength()
Corresponds to attribute 'textLength’ on the given element.
Value: The attribute 'textLength’ of the given element.@DOMNameAttribute(name="lengthAdjust") public SVGAnimatedEnumeration getLengthAdjust()
Corresponds to attribute 'lengthAdjust’ on the given element. The value must be one of the length adjust constants defined on this interface.
Value: The attribute 'lengthAdjust’ of the given element@DOMNameAttribute(name="getNumberOfChars") public long getNumberOfChars()
Returns the total number of characters available for rendering within the current element, which includes referenced characters from 'tref’ reference, regardless of whether they will be rendered. Effectively, this is equivalent to the length of the Node::textContent attribute from DOM Level 3 Core ([DOM3], section 1.4), if that attribute also expanded 'tref’ elements.
@DOMNameAttribute(name="getComputedTextLength") public float getComputedTextLength()
The total sum of all of the advance values from rendering all of the characters within this element, including the advance value on the glyphs (horizontal or vertical), the effect of properties 'kerning’, 'letter-spacing’ and 'word-spacing’ and adjustments due to attributes 'dx’ and 'dy’ on 'tspan’ elements. For non-rendering environments, the user agent shall make reasonable assumptions about glyph metrics.
@DOMNameAttribute(name="getSubStringLength") public float getSubStringLength(long charnum, long nchars)
The total sum of all of the advance values from rendering the specified substring of the characters, including the advance value on the glyphs (horizontal or vertical), the effect of properties 'kerning’, 'letter-spacing’ and 'word-spacing’ and adjustments due to attributes 'dx’ and 'dy’ on 'tspan’ elements. For non-rendering environments, the user agent shall make reasonable assumptions about glyph metrics. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs, or because the range encompasses half of a surrogate pair), and nchars is greater than 0 then the measured range shall be expanded so that each of the inseparable characters are included.
charnum
- The index of the first character in the substring, where the first character has an index of 0.nchars
- The number of characters in the substring. If nchars specifies more characters than are available, then the substring will consist of all characters starting with charnum until the end of the list of characters.DOMException
- Code DOMException.INDEX_SIZE_ERR
.
Raised if charnum or nchars is negative or if charnum is greater than or equal to the number of characters at this node.@DOMNameAttribute(name="getStartPositionOfChar") public SVGPoint getStartPositionOfChar(long charnum)
Returns the current text position before rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character. The current text position has already taken into account the effects of any inter-character adjustments due to properties 'kerning’, 'letter-spacing’ and 'word-spacing’ and adjustments due to attributes ’x’, 'y’, 'dx’ and 'dy’. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the start position for the first glyph.
charnum
- The index of the character, where the first character has an index of 0.DOMException
- Code DOMException.INDEX_SIZE_ERR
.
Raised if charnum or nchars is negative or if charnum is greater than or equal to the number of characters at this node.@DOMNameAttribute(name="getEndPositionOfChar") public SVGPoint getEndPositionOfChar(long charnum)
Returns the current text position after rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character. This current text position does not take into account the effects of any inter-character adjustments to prepare for the next character, such as properties 'kerning’, 'letter-spacing’ and 'word-spacing’ and adjustments due to attributes ’x’, 'y’, 'dx’ and 'dy’. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the end position for the last glyph.
charnum
- The index of the character, where the first character has an index of 0.DOMException
- Code DOMException.INDEX_SIZE_ERR
.
Raised if charnum or nchars is negative or if charnum is greater than or equal to the number of characters at this node.@DOMNameAttribute(name="getExtentOfChar") public SVGRect getExtentOfChar(long charnum)
Returns a tightest rectangle which defines the minimum and maximum X and Y values in the user coordinate system for rendering the glyph(s) that correspond to the specified character. The calculations assume that all glyphs occupy the full standard glyph cell for the font. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the same extent.
charnum
- The index of the character, where the first character has an index of 0.DOMException
- Code DOMException.INDEX_SIZE_ERR
.
Raised if charnum or nchars is negative or if charnum is greater than or equal to the number of characters at this node.@DOMNameAttribute(name="getRotationOfChar") public float getRotationOfChar(long charnum)
Returns the rotation value relative to the current user coordinate system used to render the glyph(s) corresponding to the specified character. If multiple glyph(s) are used to render the given character and the glyphs each have different rotations (e.g., due to text-on-a-path), the user agent shall return an average value (e.g., the rotation angle at the midpoint along the path for all glyphs used to render this character). The rotation value represents the rotation that is supplemental to any rotation due to properties 'glyph-orientation-horizontal’ and 'glyph-orientation-vertical’; thus, any glyph rotations due to these properties are not included into the returned rotation value. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the same rotation value.
charnum
- The index of the character, where the first character has an index of 0.DOMException
- Code DOMException.INDEX_SIZE_ERR
.
Raised if charnum or nchars is negative or if charnum is greater than or equal to the number of characters at this node.@DOMNameAttribute(name="getCharNumAtPosition") public long getCharNumAtPosition(SVGPoint point)
Returns the index of the character whose corresponding glyph cell bounding box contains the specified point. The calculations assume that all glyphs occupy the full standard glyph cell for the font. If no such character exists, a value of -1 is returned. If multiple such characters exist, the character within the element whose glyphs were rendered last (i.e., take into account any reordering such as for bidirectional text) is used. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then the user agent shall allocate an equal percentage of the text advance amount to each of the contributing characters in determining which of the characters is chosen.
point
- A point in user space.@DOMNameAttribute(name="selectSubString") public void selectSubString(long charnum, long nchars)
Causes the specified substring to be selected just as if the user selected the substring interactively.
charnum
- The index of the start character which is at the given point, where the first character has an index of 0.nchars
- The number of characters in the substring. If nchars specifies more characters than are available, then the substring will consist of all characters starting with charnum until the end of the list of characters.DOMException
- Code DOMException.INDEX_SIZE_ERR
.
Raised if charnum or nchars is negative or if charnum is greater than or equal to the number of characters at this node.