public class Text extends AbstractElement<Text> implements ILeafElement, IAccessibleElement
Text is a piece of text of any length. As a leaf element,
it is the smallest piece of content that may bear specific layout attributes.| Modifier and Type | Field and Description |
|---|---|
protected DefaultAccessibilityProperties |
tagProperties |
protected String |
text |
childElements, nextRenderer, stylesproperties| Constructor and Description |
|---|
Text(String text)
Constructs a Text with its role initialized.
|
| Modifier and Type | Method and Description |
|---|---|
Text |
disableOtfFeatures()
Disable otf features applying for this text element.
|
AccessibilityProperties |
getAccessibilityProperties()
Gets the
accessibility properties. |
Float |
getHorizontalScaling()
Gets the horizontal scaling property, which determines how wide the text
should be stretched.
|
String |
getText()
Gets the contents of the Text object that will be rendered.
|
float |
getTextRise()
Gets the text rise.
|
protected IRenderer |
makeNewRenderer()
Creates a new renderer instance.
|
Text |
setHorizontalScaling(float horizontalScaling)
The horizontal scaling parameter adjusts the width of glyphs by stretching or
compressing them in the horizontal direction.
|
Text |
setNeutralRole()
Give this element a neutral role.
|
Text |
setSkew(float alpha,
float beta)
Skews the text to simulate italic and other effects.
|
void |
setText(String text)
Sets the contents of the Text object.
|
Text |
setTextRise(float textRise)
Sets the text rise.
|
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, setAction, setNextRenderer, setPageNumberdeleteOwnProperty, getDefaultProperty, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, getTransparentStrokeColor, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBaseDirection, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDashPattern, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeColor, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing, simulateBold, simulateItalicclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateRendererSubTree, getRenderer, setNextRendererdeleteOwnProperty, getDefaultProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setPropertyprotected String text
protected DefaultAccessibilityProperties tagProperties
public String getText()
public void setText(String text)
text - the new contentspublic float getTextRise()
public Text setTextRise(float textRise)
textRise - a vertical distance from the text's default base line.public Float getHorizontalScaling()
floatpublic Text setSkew(float alpha, float beta)
alpha=0
and beta=12.alpha - the first angle in degreesbeta - the second angle in degreesTextpublic Text setHorizontalScaling(float horizontalScaling)
horizontalScaling - the scaling parameter. 1 means no scaling will be applied,
0.5 means the text will be scaled by half.
2 means the text will be twice as wide as normal one.public AccessibilityProperties getAccessibilityProperties()
IAccessibleElementaccessibility properties. See also IAccessibleElement.getAccessibilityProperties in interface IAccessibleElementpublic Text setNeutralRole()
AccessibilityProperties.setRole(String).public Text disableOtfFeatures()
Text elementprotected IRenderer makeNewRenderer()
AbstractElementmakeNewRenderer in class AbstractElement<Text>IRendererCopyright © 1998–2025 Apryse Group NV. All rights reserved.