Package com.lowagie.text.pdf.parser
Class GraphicsState
- java.lang.Object
-
- com.lowagie.text.pdf.parser.GraphicsState
-
public class GraphicsState extends java.lang.Object
Keeps all the parameters of the graphics state.- Since:
- 2.1.4
-
-
Field Summary
Fields Modifier and Type Field Description private float
characterSpacing
The current character spacing.private Matrix
ctm
The current transformation matrix.private CMapAwareDocumentFont
font
The active font.private float
fontSize
The current font size.private float
horizontalScaling
The current horizontal scalingprivate boolean
knockout
The current knockout value.private float
leading
The current leading.private int
renderMode
The current render mode.private float
rise
The current text riseprivate float
wordSpacing
The current word spacing.
-
Constructor Summary
Constructors Constructor Description GraphicsState()
Constructs a new Graphics State object with the default values.GraphicsState(GraphicsState source)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
calculateCharacterWidthWithoutSpace(float charFontWidth)
float
calculateCharacterWidthWithSpace(float charFontWidth)
float
getCharacterSpacing()
Matrix
getCtm()
Get the current transformation matrix.CMapAwareDocumentFont
getFont()
float
getFontAscentDescriptor()
Get maximum height above the baseline reached by glyphs in this font, excluding the height of glyphs for accented characters.float
getFontDescentDescriptor()
Get maximum depth below the baseline reached by glyphs in this font.float
getFontSize()
float
getHorizontalScaling()
float
getLeading()
int
getRenderMode()
float
getRise()
float
getWordSpacing()
boolean
isKnockout()
Matrix
multiplyCtm(Matrix matrix)
Multiply transformation matrix and get result.void
setCharacterSpacing(float characterSpacing)
void
setFont(CMapAwareDocumentFont font)
void
setFontSize(float fontSize)
void
setHorizontalScaling(float horizontalScaling)
void
setLeading(float leading)
void
setRenderMode(int renderMode)
void
setRise(float rise)
void
setWordSpacing(float wordSpacing)
-
-
-
Field Detail
-
ctm
private Matrix ctm
The current transformation matrix.
-
characterSpacing
private float characterSpacing
The current character spacing.
-
wordSpacing
private float wordSpacing
The current word spacing.
-
horizontalScaling
private float horizontalScaling
The current horizontal scaling
-
leading
private float leading
The current leading.
-
font
private CMapAwareDocumentFont font
The active font.
-
fontSize
private float fontSize
The current font size.
-
renderMode
private int renderMode
The current render mode.
-
rise
private float rise
The current text rise
-
knockout
private boolean knockout
The current knockout value.
-
-
Constructor Detail
-
GraphicsState
public GraphicsState()
Constructs a new Graphics State object with the default values.
-
GraphicsState
public GraphicsState(GraphicsState source)
Copy constructor.- Parameters:
source
- another GraphicsState object
-
-
Method Detail
-
getCtm
public Matrix getCtm()
Get the current transformation matrix.- Returns:
- current transformation matrix
-
getCharacterSpacing
public float getCharacterSpacing()
-
setCharacterSpacing
public void setCharacterSpacing(float characterSpacing)
-
getWordSpacing
public float getWordSpacing()
-
setWordSpacing
public void setWordSpacing(float wordSpacing)
-
getHorizontalScaling
public float getHorizontalScaling()
-
setHorizontalScaling
public void setHorizontalScaling(float horizontalScaling)
-
getLeading
public float getLeading()
-
setLeading
public void setLeading(float leading)
-
getFontAscentDescriptor
public float getFontAscentDescriptor()
Get maximum height above the baseline reached by glyphs in this font, excluding the height of glyphs for accented characters.- Returns:
- ascent descriptor value
-
getFontDescentDescriptor
public float getFontDescentDescriptor()
Get maximum depth below the baseline reached by glyphs in this font. The value is a negative number- Returns:
- descent descriptor value
-
calculateCharacterWidthWithSpace
public float calculateCharacterWidthWithSpace(float charFontWidth)
-
calculateCharacterWidthWithoutSpace
public float calculateCharacterWidthWithoutSpace(float charFontWidth)
-
getFont
public CMapAwareDocumentFont getFont()
-
setFont
public void setFont(CMapAwareDocumentFont font)
-
getFontSize
public float getFontSize()
-
setFontSize
public void setFontSize(float fontSize)
-
getRenderMode
public int getRenderMode()
-
setRenderMode
public void setRenderMode(int renderMode)
-
getRise
public float getRise()
-
setRise
public void setRise(float rise)
-
isKnockout
public boolean isKnockout()
-
multiplyCtm
public Matrix multiplyCtm(Matrix matrix)
Multiply transformation matrix and get result. Result would be also stored in thisGraphicsState
instance- Parameters:
matrix
- multiply by matrix- Returns:
- result matrix
-
-