public class TextPosition extends Object
Modifier | Constructor and Description |
---|---|
protected |
TextPosition()
Constructor.
|
|
TextPosition(int pageRotation,
float pageWidthValue,
float pageHeightValue,
Matrix textPositionSt,
float endXValue,
float endYValue,
float maxFontH,
float individualWidth,
float spaceWidth,
String string,
int[] codePoints,
PDFont currentFont,
float fontSizeValue,
int fontSizeInPt)
Constructor.
|
|
TextPosition(int pageRotation,
float pageWidthValue,
float pageHeightValue,
Matrix textPositionSt,
float endXValue,
float endYValue,
float maxFontH,
float individualWidth,
float spaceWidth,
String string,
PDFont currentFont,
float fontSizeValue,
int fontSizeInPt)
|
|
TextPosition(int pageRotation,
float pageWidthValue,
float pageHeightValue,
Matrix textPositionSt,
Matrix textPositionEnd,
float maxFontH,
float individualWidth,
float spaceWidth,
String string,
PDFont currentFont,
float fontSizeValue,
int fontSizeInPt)
|
|
TextPosition(PDPage page,
Matrix textPositionSt,
Matrix textPositionEnd,
float maxFontH,
float[] individualWidths,
float spaceWidth,
String string,
PDFont currentFont,
float fontSizeValue,
int fontSizeInPt,
float ws)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(TextPosition tp2)
Determine if this TextPosition logically contains
another (i.e. they overlap and should be rendered on top
of each other).
|
String |
getCharacter()
Return the string of characters stored in this object.
|
int[] |
getCodePoints()
Return the codepoints of the characters stored in this object.
|
float |
getDir()
Return the direction/orientation of the string in this object
based on its text matrix.
|
PDFont |
getFont()
This will get the font for the text being drawn.
|
float |
getFontSize()
This will get the font size that this object is
suppose to be drawn at.
|
float |
getFontSizeInPt()
This will get the font size in pt.
|
float |
getHeight()
This will get the maximum height of all characters in this string.
|
float |
getHeightDir()
This will get the maximum height of all characters in this string.
|
float[] |
getIndividualWidths()
Get the widths of each individual character.
|
Matrix |
getTextPos()
Return the Matrix textPos stored in this object.
|
float |
getWidth()
This will get the width of the string when page rotation adjusted coordinates are used.
|
float |
getWidthDirAdj()
This will get the width of the string when text direction adjusted coordinates are used.
|
float |
getWidthOfSpace()
This will get the width of a space character.
|
float |
getWordSpacing()
Deprecated.
|
float |
getX()
This will get the page rotation adjusted x position of the character.
|
float |
getXDirAdj()
This will get the text direction adjusted x position of the character.
|
float |
getXScale() |
float |
getY()
This will get the y position of the text, adjusted so that 0,0 is upper left and
it is adjusted based on the page rotation.
|
float |
getYDirAdj()
This will get the y position of the text, adjusted so that 0,0 is upper left and
it is adjusted based on the text direction.
|
float |
getYScale() |
boolean |
isDiacritic() |
void |
mergeDiacritic(TextPosition diacritic,
TextNormalize normalize)
Merge a single character TextPosition into the current object.
|
String |
toString()
Show the string data for this text position.
|
protected TextPosition()
public TextPosition(PDPage page, Matrix textPositionSt, Matrix textPositionEnd, float maxFontH, float[] individualWidths, float spaceWidth, String string, PDFont currentFont, float fontSizeValue, int fontSizeInPt, float ws)
page
- Page that the text is located intextPositionSt
- TextMatrix for start of text (in display units)textPositionEnd
- TextMatrix for end of text (in display units)maxFontH
- Maximum height of text (in display units)individualWidths
- The width of each individual character. (in ? units)spaceWidth
- The width of the space character. (in display units)string
- The character to be displayed.currentFont
- The current for for this text position.fontSizeValue
- The new font size.fontSizeInPt
- The font size in pt units.ws
- The word spacing parameter (in display units)public TextPosition(int pageRotation, float pageWidthValue, float pageHeightValue, Matrix textPositionSt, Matrix textPositionEnd, float maxFontH, float individualWidth, float spaceWidth, String string, PDFont currentFont, float fontSizeValue, int fontSizeInPt)
TextPosition(int, float, float, Matrix, float, float, float, float, float,
String, PDFont, float, int)
instead.pageRotation
- rotation of the page that the text is located inpageWidthValue
- rotation of the page that the text is located inpageHeightValue
- rotation of the page that the text is located intextPositionSt
- TextMatrix for start of text (in display units)textPositionEnd
- TextMatrix for end of text (in display units)maxFontH
- Maximum height of text (in display units)individualWidth
- The width of the given character/string. (in ? units)spaceWidth
- The width of the space character. (in display units)string
- The character to be displayed.currentFont
- The current for for this text position.fontSizeValue
- The new font size.fontSizeInPt
- The font size in pt units.public TextPosition(int pageRotation, float pageWidthValue, float pageHeightValue, Matrix textPositionSt, float endXValue, float endYValue, float maxFontH, float individualWidth, float spaceWidth, String string, PDFont currentFont, float fontSizeValue, int fontSizeInPt)
TextPosition(int, float, float, Matrix, float, float, float, float, float,
String, int[], PDFont, float, int)
insetadpageRotation
- rotation of the page that the text is located inpageWidthValue
- rotation of the page that the text is located inpageHeightValue
- rotation of the page that the text is located intextPositionSt
- TextMatrix for start of text (in display units)endXValue
- x coordinate of the end positionendYValue
- y coordinate of the end positionmaxFontH
- Maximum height of text (in display units)individualWidth
- The width of the given character/string. (in ? units)spaceWidth
- The width of the space character. (in display units)string
- The character to be displayed.currentFont
- The current for for this text position.fontSizeValue
- The new font size.fontSizeInPt
- The font size in pt units.public TextPosition(int pageRotation, float pageWidthValue, float pageHeightValue, Matrix textPositionSt, float endXValue, float endYValue, float maxFontH, float individualWidth, float spaceWidth, String string, int[] codePoints, PDFont currentFont, float fontSizeValue, int fontSizeInPt)
pageRotation
- rotation of the page that the text is located inpageWidthValue
- rotation of the page that the text is located inpageHeightValue
- rotation of the page that the text is located intextPositionSt
- TextMatrix for start of text (in display units)endXValue
- x coordinate of the end positionendYValue
- y coordinate of the end positionmaxFontH
- Maximum height of text (in display units)individualWidth
- The width of the given character/string. (in ? units)spaceWidth
- The width of the space character. (in display units)string
- The character to be displayed.codePoints
- An array containing the codepoints of the given string.currentFont
- The current font for this text position.fontSizeValue
- The new font size.fontSizeInPt
- The font size in pt units.public String getCharacter()
public int[] getCodePoints()
public Matrix getTextPos()
public float getDir()
public float getX()
public float getXDirAdj()
public float getY()
public float getYDirAdj()
public float getWidth()
public float getWidthDirAdj()
public float getHeight()
public float getHeightDir()
public float getFontSize()
public float getFontSizeInPt()
public PDFont getFont()
@Deprecated public float getWordSpacing()
public float getWidthOfSpace()
public float getXScale()
public float getYScale()
public float[] getIndividualWidths()
public String toString()
public boolean contains(TextPosition tp2)
tp2
- The other TestPosition to compare againstpublic void mergeDiacritic(TextPosition diacritic, TextNormalize normalize)
diacritic
- TextPosition to merge into the current TextPosition.normalize
- Instance of TextNormalize class to be used to normalize diacriticpublic boolean isDiacritic()
Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.