public class TextRenderInfo extends Object
PdfContentStreamProcessor
and
RenderListener
objects as text rendering operations are
discoveredModifier and Type | Field and Description |
---|---|
private GraphicsState |
gs |
private Collection<MarkedContentInfo> |
markedContentInfos
Array containing marked content info for the text.
|
private String |
text |
private Matrix |
textToUserSpaceTransformMatrix |
Constructor and Description |
---|
TextRenderInfo(String text,
GraphicsState gs,
Matrix textMatrix,
Collection<MarkedContentInfo> markedContentInfo)
Creates a new TextRenderInfo object
|
Modifier and Type | Method and Description |
---|---|
LineSegment |
getAscentLine()
Gets the ascentline for the text (i.e. the line that represents the topmost extent that a string of the current font could have)
|
LineSegment |
getBaseline()
Gets the baseline for the text (i.e. the line that the text 'sits' on)
|
LineSegment |
getDescentLine()
Gets the descentline for the text (i.e. the line that represents the bottom most extent that a string of the current font could have)
|
DocumentFont |
getFont()
Getter for the font
|
float |
getSingleSpaceWidth() |
private float |
getStringWidth(String string)
Gets the width of a String in text space units
|
String |
getText() |
int |
getTextRenderMode() |
private LineSegment |
getUnscaledBaselineWithOffset(float yOffset) |
private float |
getUnscaledFontSpaceWidth()
Calculates the width of a space character.
|
(package private) float |
getUnscaledWidth() |
boolean |
hasMcid(int mcid)
Checks if the text belongs to a marked content sequence
with a given mcid.
|
private final Matrix textToUserSpaceTransformMatrix
private final GraphicsState gs
private final Collection<MarkedContentInfo> markedContentInfos
TextRenderInfo(String text, GraphicsState gs, Matrix textMatrix, Collection<MarkedContentInfo> markedContentInfo)
text
- the text that should be displayedgs
- the graphics state (note: at this time, this is not immutable, so don't cache it)textMatrix
- the text matrix at the time of the render operationmarkedContentInfo
- the marked content sequence, if availablepublic boolean hasMcid(int mcid)
mcid
- a marked content idfloat getUnscaledWidth()
public LineSegment getBaseline()
public LineSegment getAscentLine()
public LineSegment getDescentLine()
private LineSegment getUnscaledBaselineWithOffset(float yOffset)
public DocumentFont getFont()
public float getSingleSpaceWidth()
public int getTextRenderMode()
private float getUnscaledFontSpaceWidth()
private float getStringWidth(String string)
string
- the string that needs measuringWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses