Package com.lowagie.text.pdf.parser
Class ParsedTextImpl
- java.lang.Object
-
- com.lowagie.text.pdf.parser.ParsedTextImpl
-
- All Implemented Interfaces:
TextAssemblyBuffer
- Direct Known Subclasses:
ParsedText
,Word
public abstract class ParsedTextImpl extends java.lang.Object implements TextAssemblyBuffer
-
-
Field Summary
Fields Modifier and Type Field Description private float
ascent
private Vector
baseline
We track a vector representing our baseline, left->right, so that calculations of line- change can be accurate, even with 0-length words (representing lone spaces, when those are rendered by the PDF).private float
descent
private Vector
endPoint
private float
spaceWidth
private Vector
startPoint
private java.lang.String
text
-
Constructor Summary
Constructors Constructor Description ParsedTextImpl(java.lang.String text, Vector startPoint, Vector endPoint, Vector baseline, float ascent, float descent, float spaceWidth)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
breakBefore()
float
getAscent()
Vector
getBaseline()
Return the vector representing the baseline of this text chunk, even if the length of the text is zero.float
getDescent()
Vector
getEndPoint()
float
getSingleSpaceWidth()
Vector
getStartPoint()
java.lang.String
getText()
float
getWidth()
abstract boolean
shouldNotSplit()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.lowagie.text.pdf.parser.TextAssemblyBuffer
accumulate, assemble, getFinalText
-
-
-
-
Field Detail
-
text
private final java.lang.String text
-
ascent
private float ascent
-
descent
private float descent
-
startPoint
private Vector startPoint
-
endPoint
private Vector endPoint
-
spaceWidth
private float spaceWidth
-
baseline
private Vector baseline
We track a vector representing our baseline, left->right, so that calculations of line- change can be accurate, even with 0-length words (representing lone spaces, when those are rendered by the PDF).
-
-
Constructor Detail
-
ParsedTextImpl
ParsedTextImpl(java.lang.String text, Vector startPoint, Vector endPoint, Vector baseline, float ascent, float descent, float spaceWidth)
- Parameters:
text
- characters to be rendered for this stringstartPoint
- Initial rendering spot on baselineendPoint
- ending render position on baselinebaseline
- vector representing baseline (needed for 0-length strings)ascent
- font ascent above baselinedescent
- font descent below the baselingspaceWidth
- What is the width of the space in this font....
-
-
Method Detail
-
getText
public java.lang.String getText()
- Specified by:
getText
in interfaceTextAssemblyBuffer
- Returns:
- the text to render
- See Also:
ParsedText.getText()
-
getSingleSpaceWidth
public float getSingleSpaceWidth()
- Returns:
- The width, in user space units, of a single space character in the current font
-
getAscent
public float getAscent()
-
getDescent
public float getDescent()
-
getWidth
public float getWidth()
-
getStartPoint
public Vector getStartPoint()
- Returns:
- a vector in User space representing the start point of the text
-
getEndPoint
public Vector getEndPoint()
- Returns:
- a vector in User space representing the end point of the text (i.e. the starting point of the text plus the width of the text, transformed by the applicable transformation matrices)
-
getBaseline
public Vector getBaseline()
Return the vector representing the baseline of this text chunk, even if the length of the text is zero.- Returns:
- baseline
- See Also:
baseline
-
shouldNotSplit
public abstract boolean shouldNotSplit()
- Returns:
- true if this was extracted from a string containing spaces, in which case, we assume further splitting is not needed.
-
breakBefore
public abstract boolean breakBefore()
- Returns:
- true if this was a space or other item that should force a space before it.
-
-