public class TextSvgBranchRenderer extends AbstractSvgNodeRenderer implements ISvgTextNodeRenderer
ISvgNodeRenderer implementation for the <text> and <tspan> tag.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
performRootTransformations
Deprecated.
|
protected static com.itextpdf.kernel.geom.AffineTransform |
TEXTFLIP
Top level transformation to flip the y-axis results in the character glyphs being mirrored, this tf corrects for this behaviour
|
attributesAndStyles| Constructor and Description |
|---|
TextSvgBranchRenderer()
Creates new
TextSvgBranchRenderer instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(ISvgTextNodeRenderer child)
Adds a child to the current
TextSvgBranchRenderer renderer. |
boolean |
containsAbsolutePositionChange()
This method is deprecated and will be replaced with new signature
containsAbsolutePositionChange(SvgDrawContext). |
boolean |
containsAbsolutePositionChange(SvgDrawContext context)
Checks whether current <text> or <tspan> element contains absolute position attributes.
|
boolean |
containsRelativeMove()
Deprecated.
|
boolean |
containsRelativeMove(SvgDrawContext context)
Checks whether current <text> or <tspan> element contains relative position change.
|
ISvgNodeRenderer |
createDeepCopy()
Creates a deep copy of this renderer, including it's subtree of children
|
protected void |
doDraw(SvgDrawContext context)
Method that will set properties to be inherited by this branch renderer's
children and will iterate over all children in order to draw them.
|
float[][] |
getAbsolutePositionChanges()
This method is deprecated and will be replaced with new signature
getAbsolutePositionChanges(SvgDrawContext). |
float[][] |
getAbsolutePositionChanges(SvgDrawContext context)
Gets absolute position of the current <text> or <tspan> element.
|
List<ISvgTextNodeRenderer> |
getChildren()
Retrieves a list of all children of the current
TextSvgBranchRenderer renderer. |
com.itextpdf.kernel.geom.Rectangle |
getObjectBoundingBox(SvgDrawContext context)
Calculates the current object bounding box.
|
float[] |
getRelativeTranslation()
Deprecated.
|
float[] |
getRelativeTranslation(SvgDrawContext context)
Gets relative translation of the current <text> or <tspan> element.
|
float |
getTextContentLength(float parentFontSize,
com.itextpdf.kernel.font.PdfFont font)
Deprecated.
|
TextRectangle |
getTextRectangle(SvgDrawContext context,
com.itextpdf.kernel.geom.Point startPoint)
Return the bounding rectangle of the text element.
|
void |
markWhiteSpaceProcessed()
Marks white-space property as processed.
|
canConstructViewPort, canElementFill, deepCopyAttributesAndStyles, draw, getAttribute, getAttributeMapCopy, getAttributeOrDefault, getCurrentFontSize, getCurrentFontSize, getCurrentViewBox, getParent, isHidden, parseAbsoluteLength, parseHorizontalLength, parseVerticalLength, setAttribute, setAttributesAndStyles, setParentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdraw, getAttribute, getAttributeMapCopy, getParent, setAttribute, setAttributesAndStyles, setParentprotected static final com.itextpdf.kernel.geom.AffineTransform TEXTFLIP
@Deprecated protected boolean performRootTransformations
public TextSvgBranchRenderer()
TextSvgBranchRenderer instance.public ISvgNodeRenderer createDeepCopy()
ISvgNodeRenderercreateDeepCopy in interface ISvgNodeRendererpublic final void addChild(ISvgTextNodeRenderer child)
TextSvgBranchRenderer renderer.child - ISvgTextNodeRenderer child to addpublic final List<ISvgTextNodeRenderer> getChildren()
TextSvgBranchRenderer renderer.ISvgTextNodeRenderer children@Deprecated public float getTextContentLength(float parentFontSize, com.itextpdf.kernel.font.PdfFont font)
ISvgTextNodeRenderergetTextContentLength in interface ISvgTextNodeRendererparentFontSize - parent font sizefont - current font@Deprecated public float[] getRelativeTranslation()
ISvgTextNodeRenderergetRelativeTranslation(SvgDrawContext).
This is needed because xMove/yMove can contain relative values, so SvgDrawContext is needed to resolve them.getRelativeTranslation in interface ISvgTextNodeRendererpublic float[] getRelativeTranslation(SvgDrawContext context)
context - current SvgDrawContextdx and dy translations@Deprecated public boolean containsRelativeMove()
ISvgTextNodeRenderercontainsRelativeMove(SvgDrawContext).
This is needed because xMove/yMove can contain relative values, so SvgDrawContext is needed to resolve them.containsRelativeMove in interface ISvgTextNodeRenderertrue if there is a relative move, false otherwisepublic boolean containsRelativeMove(SvgDrawContext context)
context - current SvgDrawContexttrue is current element contains relative position, false otherwisepublic boolean containsAbsolutePositionChange()
ISvgTextNodeRenderercontainsAbsolutePositionChange(SvgDrawContext).
This is needed because x/y can contain relative values, so SvgDrawContext is needed to resolve them.containsAbsolutePositionChange in interface ISvgTextNodeRenderertrue if an absolute position is specified via x/y attributes, false otherwisepublic boolean containsAbsolutePositionChange(SvgDrawContext context)
context - current SvgDrawContexttrue is current element contains absolute position, false otherwisepublic float[][] getAbsolutePositionChanges()
ISvgTextNodeRenderergetAbsolutePositionChanges(SvgDrawContext).
This is needed because x/y can contain relative values, so SvgDrawContext is needed to resolve them.getAbsolutePositionChanges in interface ISvgTextNodeRendererpublic float[][] getAbsolutePositionChanges(SvgDrawContext context)
context - current SvgDrawContextx and y positions as either single item arrays
or null if attribute is not presentpublic void markWhiteSpaceProcessed()
public TextRectangle getTextRectangle(SvgDrawContext context, com.itextpdf.kernel.geom.Point startPoint)
ISvgTextNodeRenderergetTextRectangle in interface ISvgTextNodeRenderercontext - current SvgDrawContextstartPoint - end point of previous text elementTextRectanglepublic com.itextpdf.kernel.geom.Rectangle getObjectBoundingBox(SvgDrawContext context)
ISvgNodeRenderergetObjectBoundingBox in interface ISvgNodeRenderercontext - the current context, for instance it contains current viewport and available
font dataRectangle representing the current object's bounding box, or null
if bounding box is undefinedprotected void doDraw(SvgDrawContext context)
doDraw in class AbstractSvgNodeRenderercontext - the object that knows the place to draw this element and
maintains its stateCopyright © 1998–2025 Apryse Group NV. All rights reserved.