Package com.itextpdf.svg.renderers.impl
Class TextSvgBranchRenderer
java.lang.Object
com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
com.itextpdf.svg.renderers.impl.TextSvgBranchRenderer
- All Implemented Interfaces:
-
ISvgTextNodeRenderer
,ISvgNodeRenderer
- Direct Known Subclasses:
-
TextSvgTSpanBranchRenderer
ISvgNodeRenderer
implementation for the -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Deprecated.protected static final AffineTransform
Top level transformation to flip the y-axis results in the character glyphs being mirrored, this tf corrects for this behaviourFields inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
attributesAndStyles
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addChild
(ISvgTextNodeRenderer child) Adds a child to the currentTextSvgBranchRenderer
renderer.boolean
This method is deprecated and will be replaced with new signaturecontainsAbsolutePositionChange(SvgDrawContext)
.boolean
Checks whether currentor element contains absolute position attributes. boolean
Deprecated.boolean
containsRelativeMove
(SvgDrawContext context) Checks whether currentor element contains relative position change. Creates a deep copy of this renderer, including it's subtree of childrenprotected 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[][]
This method is deprecated and will be replaced with new signaturegetAbsolutePositionChanges(SvgDrawContext)
.float[][]
getAbsolutePositionChanges
(SvgDrawContext context) Gets absolute position of the currentor element. final List<ISvgTextNodeRenderer>
Retrieves a list of all children of the currentTextSvgBranchRenderer
renderer.getObjectBoundingBox
(SvgDrawContext context) Calculates the current object bounding box.float[]
Deprecated.float[]
getRelativeTranslation
(SvgDrawContext context) Gets relative translation of the currentor element. float
getTextContentLength
(float parentFontSize, PdfFont font) Deprecated.getTextRectangle
(SvgDrawContext context, Point startPoint) Return the bounding rectangle of the text element.void
Marks white-space property as processed.Methods inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
canConstructViewPort, canElementFill, deepCopyAttributesAndStyles, draw, getAttribute, getAttributeMapCopy, getAttributeOrDefault, getCurrentFontSize, getCurrentFontSize, getCurrentViewBox, getParent, isHidden, parseAbsoluteLength, parseHorizontalLength, parseVerticalLength, setAttribute, setAttributesAndStyles, setParent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.itextpdf.svg.renderers.ISvgNodeRenderer
draw, getAttribute, getAttributeMapCopy, getParent, setAttribute, setAttributesAndStyles, setParent
-
Field Details
-
TEXTFLIP
Top level transformation to flip the y-axis results in the character glyphs being mirrored, this tf corrects for this behaviour -
performRootTransformations
Deprecated.
-
-
Constructor Details
-
TextSvgBranchRenderer
public TextSvgBranchRenderer()Creates newTextSvgBranchRenderer
instance.
-
-
Method Details
-
createDeepCopy
Description copied from interface:ISvgNodeRenderer
Creates a deep copy of this renderer, including it's subtree of children- Specified by:
-
createDeepCopy
in interfaceISvgNodeRenderer
- Returns:
- deep copy of this renderer
-
addChild
Adds a child to the currentTextSvgBranchRenderer
renderer.- Parameters:
-
child
-ISvgTextNodeRenderer
child to add
-
getChildren
Retrieves a list of all children of the currentTextSvgBranchRenderer
renderer.- Returns:
-
a list of
ISvgTextNodeRenderer
children
-
getTextContentLength
Deprecated.Description copied from interface:ISvgTextNodeRenderer
Gets text content length.- Specified by:
-
getTextContentLength
in interfaceISvgTextNodeRenderer
- Parameters:
-
parentFontSize
- parent font size -
font
- current font - Returns:
- text content length
-
getRelativeTranslation
Deprecated.Description copied from interface:ISvgTextNodeRenderer
This method is deprecated and will be replaced with new signaturegetRelativeTranslation(SvgDrawContext)
. This is needed because xMove/yMove can contain relative values, so SvgDrawContext is needed to resolve them.- Specified by:
-
getRelativeTranslation
in interfaceISvgTextNodeRenderer
- Returns:
- text relative translation
-
getRelativeTranslation
Gets relative translation of the currentor element. - Parameters:
-
context
- currentSvgDrawContext
- Returns:
-
float array that contains relative
dx
anddy
translations
-
containsRelativeMove
Deprecated.Description copied from interface:ISvgTextNodeRenderer
This method is deprecated and will be replaced with new signaturecontainsRelativeMove(SvgDrawContext)
. This is needed because xMove/yMove can contain relative values, so SvgDrawContext is needed to resolve them.- Specified by:
-
containsRelativeMove
in interfaceISvgTextNodeRenderer
- Returns:
-
true
if there is a relative move,false
otherwise
-
containsRelativeMove
Checks whether currentor element contains relative position change. - Parameters:
-
context
- currentSvgDrawContext
- Returns:
-
true
is current element contains relative position,false
otherwise
-
containsAbsolutePositionChange
public boolean containsAbsolutePositionChange()Description copied from interface:ISvgTextNodeRenderer
This method is deprecated and will be replaced with new signaturecontainsAbsolutePositionChange(SvgDrawContext)
. This is needed because x/y can contain relative values, so SvgDrawContext is needed to resolve them.- Specified by:
-
containsAbsolutePositionChange
in interfaceISvgTextNodeRenderer
- Returns:
-
true
if an absolute position is specified via x/y attributes,false
otherwise
-
containsAbsolutePositionChange
Checks whether currentor element contains absolute position attributes. - Parameters:
-
context
- currentSvgDrawContext
- Returns:
-
true
is current element contains absolute position,false
otherwise
-
getAbsolutePositionChanges
public float[][] getAbsolutePositionChanges()Description copied from interface:ISvgTextNodeRenderer
This method is deprecated and will be replaced with new signaturegetAbsolutePositionChanges(SvgDrawContext)
. This is needed because x/y can contain relative values, so SvgDrawContext is needed to resolve them.- Specified by:
-
getAbsolutePositionChanges
in interfaceISvgTextNodeRenderer
- Returns:
- text absolute position
-
getAbsolutePositionChanges
Gets absolute position of the currentor element. - Parameters:
-
context
- currentSvgDrawContext
- Returns:
-
float array that contains absolute
x
andy
positions as either single item arrays or null if attribute is not present
-
markWhiteSpaceProcessed
public void markWhiteSpaceProcessed()Marks white-space property as processed. -
getTextRectangle
Description copied from interface:ISvgTextNodeRenderer
Return the bounding rectangle of the text element.- Specified by:
-
getTextRectangle
in interfaceISvgTextNodeRenderer
- Parameters:
-
context
- currentSvgDrawContext
-
startPoint
- end point of previous text element - Returns:
-
created instance of
TextRectangle
-
getObjectBoundingBox
Description copied from interface:ISvgNodeRenderer
Calculates the current object bounding box.- Specified by:
-
getObjectBoundingBox
in interfaceISvgNodeRenderer
- Parameters:
-
context
- the current context, for instance it contains current viewport and available font data - Returns:
-
the
Rectangle
representing the current object's bounding box, or null if bounding box is undefined
-
doDraw
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.- Specified by:
-
doDraw
in classAbstractSvgNodeRenderer
- Parameters:
-
context
- the object that knows the place to draw this element and maintains its state
-