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.-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractSvgNodeRenderer
AbstractSvgNodeRenderer.FillProperties, AbstractSvgNodeRenderer.StrokeProperties -
Field Summary
FieldsFields inherited from class AbstractSvgNodeRenderer
attributesAndStyles, doFill, doStroke -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidapplyGraphicsState(SvgDrawContext context) private voidapplyTransform(SvgDrawContext context) protected booleanMethod to see if a certain renderer can use fill.booleanDeprecated.booleanDeprecated.Creates a deep copy of this renderer, including it's subtree of childrenprotected voiddoDraw(SvgDrawContext context) Draws this element to a canvas-like object maintained in the context.float[][]Deprecated.getObjectBoundingBox(SvgDrawContext context) Calculates the current object bounding box.float[]Deprecated.floatgetTextContentLength(float parentFontSize, PdfFont font) Deprecated.getTextRectangle(SvgDrawContext context, Point startPoint) Return the bounding rectangle of the text element.private LineRendererlayoutText(SvgDrawContext context) Methods inherited from class AbstractSvgNodeRenderer
applyFillAndStrokeProperties, applyNonScalingStrokeTransform, calculateViewPortTranslation, canConstructViewPort, deepCopyAttributesAndStyles, doStrokeOrFill, draw, getAttribute, getAttributeMapCopy, getAttributeOrDefault, getCurrentFontSize, getCurrentFontSize, getCurrentViewBox, getParent, getParentClipPath, isHidden, parseAbsoluteLength, parseHorizontalLength, parseVerticalLength, postDraw, preDraw, retrieveAlignAndMeet, setAttribute, setAttributesAndStyles, setParentMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISvgNodeRenderer
draw, getAttribute, getAttributeMapCopy, getParent, setAttribute, setAttributesAndStyles, setParent
-
Field Details
-
text
-
-
Constructor Details
-
TextLeafSvgNodeRenderer
public TextLeafSvgNodeRenderer()
-
-
Method Details
-
createDeepCopy
Description copied from interface:ISvgNodeRendererCreates a deep copy of this renderer, including it's subtree of children- Specified by:
createDeepCopyin interfaceISvgNodeRenderer- Returns:
- deep copy of this renderer
-
getTextContentLength
Deprecated.Description copied from interface:ISvgTextNodeRendererGets text content length.- Specified by:
getTextContentLengthin interfaceISvgTextNodeRenderer- Parameters:
parentFontSize- parent font sizefont- current font- Returns:
- text content length
-
getRelativeTranslation
Deprecated.Description copied from interface:ISvgTextNodeRendererThis 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:
getRelativeTranslationin interfaceISvgTextNodeRenderer- Returns:
- text relative translation
-
containsRelativeMove
Deprecated.Description copied from interface:ISvgTextNodeRendererThis 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:
containsRelativeMovein interfaceISvgTextNodeRenderer- Returns:
trueif there is a relative move,falseotherwise
-
containsAbsolutePositionChange
Deprecated.Description copied from interface:ISvgTextNodeRendererThis 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:
containsAbsolutePositionChangein interfaceISvgTextNodeRenderer- Returns:
trueif an absolute position is specified via x/y attributes,falseotherwise
-
getAbsolutePositionChanges
Deprecated.Description copied from interface:ISvgTextNodeRendererThis 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:
getAbsolutePositionChangesin interfaceISvgTextNodeRenderer- Returns:
- text absolute position
-
getTextRectangle
Description copied from interface:ISvgTextNodeRendererReturn the bounding rectangle of the text element.- Specified by:
getTextRectanglein interfaceISvgTextNodeRenderer- Parameters:
context- currentSvgDrawContextstartPoint- end point of previous text element- Returns:
- created instance of
TextRectangle
-
getObjectBoundingBox
Description copied from interface:ISvgNodeRendererCalculates the current object bounding box.- Specified by:
getObjectBoundingBoxin interfaceISvgNodeRenderer- Parameters:
context- the current context, for instance it contains current viewport and available font data- Returns:
- the
Rectanglerepresenting the current object's bounding box, or null if bounding box is undefined
-
doDraw
Description copied from class:AbstractSvgNodeRendererDraws this element to a canvas-like object maintained in the context.- Specified by:
doDrawin 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:AbstractSvgNodeRendererMethod to see if a certain renderer can use fill.- Overrides:
canElementFillin classAbstractSvgNodeRenderer- Returns:
- true if the renderer can use fill
-
applyTransform
-
applyGraphicsState
-
layoutText
-