|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.pobjects.graphics.TextSprite
public class TextSprite
This class represents text which will be rendered to the a graphics context. This class was created to act as a wrapper for painting text using the Phelphs font library as well as painting using java.awt.Font.
Objects of this type are created by the content parser when "TJ" or "Tj" operands are encountered in a page's content stream. Each TextSprite object is comprised of a list of CharSprites which can be painted by the Shapes class at render time.
| Constructor Summary | |
|---|---|
TextSprite(FontFile font,
int size,
java.awt.geom.AffineTransform graphicStateTransform)
Creates a new TextSprit object. |
|
| Method Summary | |
|---|---|
GlyphText |
addText(java.lang.String cid,
java.lang.String unicode,
float x,
float y,
float width)
Adds a new text char to the TextSprite which will pe painted at x, y under the current CTM |
void |
dispose()
Dispose this TextSprite Object. |
java.awt.geom.Rectangle2D.Float |
getBounds()
Getst the bounds of the text that makes up this sprite. |
java.awt.geom.Area |
getGlyphOutline()
Gets the glyph outline as an Area. |
java.util.ArrayList<GlyphText> |
getGlyphSprites()
Gets the character bounds of each glyph found in the TextSprite. |
java.awt.geom.AffineTransform |
getGraphicStateTransform()
|
boolean |
intersects(java.awt.Shape shape)
Tests if the interior of the TextSprite bounds intersects the
interior of a specified shape. |
void |
paint(java.awt.Graphics g)
Paints all the character elements in this TextSprite to the graphics context |
void |
setGraphicStateTransform(java.awt.geom.AffineTransform graphicStateTransform)
Set the graphic state transorm on all child sprites, This is used for xForm object parsing and text selection. |
void |
setRMode(int rmode)
Set the rmode for all the characters being in this object. |
void |
setStrokeColor(java.awt.Color color)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextSprite(FontFile font,
int size,
java.awt.geom.AffineTransform graphicStateTransform)
Creates a new TextSprit object.
font - font used when painting glyphs.size - size of the font in user space| Method Detail |
|---|
public GlyphText addText(java.lang.String cid,
java.lang.String unicode,
float x,
float y,
float width)
Adds a new text char to the TextSprite which will pe painted at x, y under the current CTM
cid - cid to paint.unicode - unicode represention of cid.x - x-coordinate to paint.y - y-coordinate to paint.width - width of cid from font.public java.util.ArrayList<GlyphText> getGlyphSprites()
public java.awt.geom.AffineTransform getGraphicStateTransform()
public void setGraphicStateTransform(java.awt.geom.AffineTransform graphicStateTransform)
graphicStateTransform - public void setRMode(int rmode)
Set the rmode for all the characters being in this object. Rmode can have the following values:
rmode - valid rmode from 0-7public java.lang.String toString()
toString in class java.lang.Objectpublic void setStrokeColor(java.awt.Color color)
public java.awt.geom.Rectangle2D.Float getBounds()
public void paint(java.awt.Graphics g)
Paints all the character elements in this TextSprite to the graphics context
g - graphics context to which the characters will be painted to.public java.awt.geom.Area getGlyphOutline()
public boolean intersects(java.awt.Shape shape)
TextSprite bounds intersects the
interior of a specified shape.
shape - shape to calculate intersection against
TextSprite bounds intersects shape;
otherwise; false.public void dispose()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||