Modifier and Type | Field and Description |
---|---|
protected HashMap<String,Object> |
attributes
Metric attributes.
|
protected BaseFont |
baseFont |
protected boolean |
changeLeading
Indicates if the height and offset of the Image has to be taken into account
|
protected String |
encoding
The encoding.
|
protected PdfFont |
font
The font for this
PdfChunk . |
protected Image |
image
The image in this
PdfChunk , if it has one |
private static float |
ITALIC_ANGLE |
private static HashSet<String> |
keysAttributes
The allowed attributes in variable
attributes . |
private static HashSet<String> |
keysNoStroke
The allowed attributes in variable
noStroke . |
protected boolean |
newlineSplit
true if the chunk split was cause by a newline. |
protected HashMap<String,Object> |
noStroke
Non metric attributes.
|
protected float |
offsetX
The offset in the x direction for the image
|
protected float |
offsetY
The offset in the y direction for the image
|
private static char[] |
singleSpace |
protected SplitCharacter |
splitCharacter |
private static PdfChunk[] |
thisChunk |
protected String |
value
The value of this object.
|
Constructor and Description |
---|
PdfChunk(Chunk chunk,
PdfAction action)
Constructs a
PdfChunk -object. |
PdfChunk(String string,
PdfChunk other)
Constructs a
PdfChunk -object. |
Modifier and Type | Method and Description |
---|---|
(package private) void |
adjustLeft(float newValue)
Correction for the tab position based on the left starting position.
|
boolean |
changeLeading() |
(package private) BaseColor |
color()
Returns the color of this
Chunk . |
(package private) PdfFont |
font()
Returns the font of this
Chunk . |
(package private) Object |
getAttribute(String name)
Gets an attribute.
|
(package private) float |
getCharWidth(int c) |
(package private) String |
getEncoding()
Gets the encoding of this string.
|
(package private) Image |
getImage()
Gets the image in the
PdfChunk . |
(package private) float |
getImageOffsetX()
Gets the image offset in the x direction
|
(package private) float |
getImageOffsetY()
Gets the image offset in the y direction
|
float |
getTextRise()
Gets the text displacement relative to the baseline.
|
int |
getUnicodeEquivalent(int c)
Gets the Unicode equivalent to a CID.
|
float |
getWidthCorrected(float charSpacing,
float wordSpacing)
Gets the width of the
PdfChunk taking into account the
extra character and word spacing. |
protected int |
getWord(String text,
int start) |
(package private) boolean |
isAttribute(String name)
Checks if the attribute exists.
|
(package private) boolean |
isExtSplitCharacter(int start,
int current,
int end,
char[] cc,
PdfChunk[] ck) |
(package private) boolean |
isHorizontalSeparator()
Checks if this
PdfChunk is a horizontal Separator Chunk. |
(package private) boolean |
isImage()
Checks if there is an image in the
PdfChunk . |
boolean |
isNewlineSplit()
Checks if the
PdfChunk split was caused by a newline. |
(package private) boolean |
isSeparator()
Checks if this
PdfChunk is a Separator Chunk. |
(package private) boolean |
isSpecialEncoding()
Tells you if this string is in Chinese, Japanese, Korean or Identity-H.
|
(package private) boolean |
isStroked()
Checks if this
PdfChunk needs some special metrics handling. |
(package private) boolean |
isTab()
Checks if this
PdfChunk is a tab Chunk. |
(package private) int |
length() |
(package private) int |
lengthUtf32() |
static boolean |
noPrint(int c) |
(package private) void |
setImageOffsetX(float offsetX)
Sets the image offset in the x direction
|
(package private) void |
setImageOffsetY(float offsetY)
Sets the image offset in the y direction
|
(package private) void |
setValue(String value)
sets the value.
|
(package private) PdfChunk |
split(float width)
Splits this
PdfChunk if it's too long for the given width. |
String |
toString() |
(package private) String |
trim(String string)
Removes all the ' ' and '-'-characters on the right of a
String . |
float |
trimFirstSpace() |
float |
trimLastSpace()
Trims the last space.
|
(package private) PdfChunk |
truncate(float width)
Truncates this
PdfChunk if it's too long for the given width. |
(package private) float |
width()
Returns the width of this
PdfChunk . |
private static final char[] singleSpace
private static final float ITALIC_ANGLE
private static final HashSet<String> keysAttributes
attributes
.private static final HashSet<String> keysNoStroke
noStroke
.protected SplitCharacter splitCharacter
protected HashMap<String,Object> attributes
This attributes require the measurement of characters widths when rendering such as underline.
protected HashMap<String,Object> noStroke
This attributes do not require the measurement of characters widths when rendering such as BaseColor.
protected boolean newlineSplit
true
if the chunk split was cause by a newline.protected float offsetX
protected float offsetY
protected boolean changeLeading
PdfChunk(String string, PdfChunk other)
PdfChunk
-object.string
- the content of the PdfChunk
-objectother
- Chunk with the same style you want for the new Chunkpublic int getUnicodeEquivalent(int c)
c
- the CID codePdfChunk split(float width)
PdfChunk
if it's too long for the given width.
Returns null if the PdfChunk
wasn't truncated.
width
- a given widthPdfChunk
that doesn't fit into the width.PdfChunk truncate(float width)
PdfChunk
if it's too long for the given width.
Returns null if the PdfChunk
wasn't truncated.
width
- a given widthPdfChunk
that doesn't fit into the width.float width()
PdfChunk
.public boolean isNewlineSplit()
PdfChunk
split was caused by a newline.true
if the PdfChunk
split was caused by a newline.public float getWidthCorrected(float charSpacing, float wordSpacing)
PdfChunk
taking into account the
extra character and word spacing.charSpacing
- the extra character spacingwordSpacing
- the extra word spacingpublic float getTextRise()
public float trimLastSpace()
public float trimFirstSpace()
Object getAttribute(String name)
attributes
and noStroke
.name
- the attribute keyboolean isAttribute(String name)
name
- the attribute keytrue
if the attribute existsboolean isStroked()
PdfChunk
needs some special metrics handling.true
if this PdfChunk
needs some special metrics handling.boolean isSeparator()
PdfChunk
is a Separator Chunk.boolean isHorizontalSeparator()
PdfChunk
is a horizontal Separator Chunk.boolean isTab()
PdfChunk
is a tab Chunk.void adjustLeft(float newValue)
newValue
- the new value for the left X.boolean isImage()
PdfChunk
.true
if an image is presentvoid setImageOffsetX(float offsetX)
offsetX
- the image offset in the x directionfloat getImageOffsetX()
void setImageOffsetY(float offsetY)
offsetY
- the image offset in the y directionfloat getImageOffsetY()
public String toString()
toString
in class Object
Object.toString()
boolean isSpecialEncoding()
String getEncoding()
String
int length()
int lengthUtf32()
boolean isExtSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck)
String trim(String string)
String
.
string
- the String that has to be trimmed.
String
public boolean changeLeading()
float getCharWidth(int c)
public static boolean noPrint(int c)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses