Package com.itextpdf.svg.renderers.impl
Class TextLeafSvgNodeRenderer
- java.lang.Object
-
- com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
-
- com.itextpdf.svg.renderers.impl.TextLeafSvgNodeRenderer
-
- All Implemented Interfaces:
ISvgTextNodeRenderer
,ISvgNodeRenderer
public class TextLeafSvgNodeRenderer extends AbstractSvgNodeRenderer implements ISvgTextNodeRenderer
ISvgNodeRenderer
implementation for drawing text to a canvas.
-
-
Field Summary
-
Fields inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
attributesAndStyles, doFill, doStroke, partOfClipPath
-
-
Constructor Summary
Constructors Constructor Description TextLeafSvgNodeRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canElementFill()
Method to see if a certain renderer can use fill.boolean
containsAbsolutePositionChange()
boolean
containsRelativeMove()
ISvgNodeRenderer
createDeepCopy()
Creates a deep copy of this renderer, including it's subtree of childrenprotected void
doDraw(SvgDrawContext context)
Draws this element to a canvas-like object maintained in the context.float[][]
getAbsolutePositionChanges()
Rectangle
getObjectBoundingBox(SvgDrawContext context)
Calculates the current object bounding box.float[]
getRelativeTranslation()
float
getTextContentLength(float parentFontSize, PdfFont font)
TextRectangle
getTextRectangle(SvgDrawContext context, Point basePoint)
Return the bounding rectangle of the text element.-
Methods inherited from class com.itextpdf.svg.renderers.impl.AbstractSvgNodeRenderer
calculateViewPortTranslation, canConstructViewPort, deepCopyAttributesAndStyles, draw, getAttribute, getAttributeMapCopy, getAttributeOrDefault, getCurrentFontSize, getParent, parseAbsoluteLength, postDraw, preDraw, setAttribute, setAttributesAndStyles, setParent, setPartOfClipPath
-
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
-
-
-
-
Method Detail
-
createDeepCopy
public ISvgNodeRenderer 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
-
getTextContentLength
public float getTextContentLength(float parentFontSize, PdfFont font)
- Specified by:
getTextContentLength
in interfaceISvgTextNodeRenderer
-
getRelativeTranslation
public float[] getRelativeTranslation()
- Specified by:
getRelativeTranslation
in interfaceISvgTextNodeRenderer
-
containsRelativeMove
public boolean containsRelativeMove()
- Specified by:
containsRelativeMove
in interfaceISvgTextNodeRenderer
-
containsAbsolutePositionChange
public boolean containsAbsolutePositionChange()
- Specified by:
containsAbsolutePositionChange
in interfaceISvgTextNodeRenderer
-
getAbsolutePositionChanges
public float[][] getAbsolutePositionChanges()
- Specified by:
getAbsolutePositionChanges
in interfaceISvgTextNodeRenderer
-
getTextRectangle
public TextRectangle getTextRectangle(SvgDrawContext context, Point basePoint)
Description copied from interface:ISvgTextNodeRenderer
Return the bounding rectangle of the text element.- Specified by:
getTextRectangle
in interfaceISvgTextNodeRenderer
- Parameters:
context
- currentSvgDrawContext
basePoint
- end point of previous text element- Returns:
- created instance of
TextRectangle
-
getObjectBoundingBox
public Rectangle getObjectBoundingBox(SvgDrawContext context)
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
protected void doDraw(SvgDrawContext context)
Description copied from class:AbstractSvgNodeRenderer
Draws this element to a canvas-like object maintained in the context.- Specified by:
doDraw
in classAbstractSvgNodeRenderer
- Parameters:
context
- the object that knows the place to draw this element and maintains its state
-
canElementFill
protected boolean canElementFill()
Description copied from class:AbstractSvgNodeRenderer
Method to see if a certain renderer can use fill.- Overrides:
canElementFill
in classAbstractSvgNodeRenderer
- Returns:
- true if the renderer can use fill
-
-