com.lowagie.text.pdf
Class PdfGraphics2D.PdfFontMetrics
java.lang.Object
java.awt.FontMetrics
com.lowagie.text.pdf.PdfGraphics2D.PdfFontMetrics
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- PdfGraphics2D
- class PdfGraphics2D.PdfFontMetrics
- extends FontMetrics
Method Summary |
int |
charWidth(char c)
|
int |
getAscent()
|
int |
getDescent()
|
int |
getLeading()
|
int |
getMaxAdvance()
|
Rectangle2D |
getMaxCharBounds(Graphics context)
Returns the bounds for the character with the maximum bounds
in the specified Graphics context. |
Rectangle2D |
getStringBounds(char[] chars,
int beginIndex,
int limit,
Graphics context)
Returns the bounds of the specified array of characters
in the specified Graphics context. |
Rectangle2D |
getStringBounds(CharacterIterator ci,
int beginIndex,
int limit,
Graphics context)
Returns the bounds of the characters indexed in the specified
CharacterIterator in the
specified Graphics context. |
Rectangle2D |
getStringBounds(String str,
Graphics context)
Returns the bounds of the specified String in the
specified Graphics context. |
Rectangle2D |
getStringBounds(String str,
int beginIndex,
int limit,
Graphics context)
Returns the bounds of the specified String in the
specified Graphics context. |
int[] |
getWidths()
|
int |
stringWidth(String s)
|
Methods inherited from class java.awt.FontMetrics |
bytesWidth, charsWidth, charWidth, getFont, getHeight, getLineMetrics, getLineMetrics, getLineMetrics, getLineMetrics, getMaxAscent, getMaxDecent, getMaxDescent, hasUniformLineMetrics, toString |
bf
private BaseFont bf
fontSize
private float fontSize
ascent
private double ascent
descent
private double descent
leading
private double leading
maxAdvance
private double maxAdvance
widths
private int[] widths
scaleX
private double scaleX
scaleY
private double scaleY
PdfGraphics2D.PdfFontMetrics
private PdfGraphics2D.PdfFontMetrics(Font f,
BaseFont bf)
getAscent
public int getAscent()
getDescent
public int getDescent()
getLeading
public int getLeading()
getMaxAdvance
public int getMaxAdvance()
getWidths
public int[] getWidths()
charWidth
public int charWidth(char c)
stringWidth
public int stringWidth(String s)
getStringBounds
public Rectangle2D getStringBounds(String str,
Graphics context)
- Returns the bounds of the specified
String
in the
specified Graphics
context. The bounds is used
to layout the String
.
- Parameters:
str
- the specified String
context
- the specified Graphics
context
- Returns:
- a
Rectangle2D
that is the bounding box of the
specified String
in the specified
Graphics
context. - See Also:
Font.getStringBounds(String, FontRenderContext)
getStringBounds
public Rectangle2D getStringBounds(String str,
int beginIndex,
int limit,
Graphics context)
- Returns the bounds of the specified
String
in the
specified Graphics
context. The bounds is used
to layout the String
.
- Parameters:
str
- the specified String
beginIndex
- the offset of the beginning of str
limit
- the length of str
context
- the specified Graphics
context
- Returns:
- a
Rectangle2D
that is the bounding box of the
specified String
in the specified
Graphics
context. - See Also:
Font.getStringBounds(String, int, int, FontRenderContext)
getStringBounds
public Rectangle2D getStringBounds(char[] chars,
int beginIndex,
int limit,
Graphics context)
- Returns the bounds of the specified array of characters
in the specified
Graphics
context.
The bounds is used to layout the String
created with the specified array of characters,
beginIndex
and limit
.
- Parameters:
chars
- an array of charactersbeginIndex
- the initial offset of the array of
characterslimit
- the length of the array of characterscontext
- the specified Graphics
context
- Returns:
- a
Rectangle2D
that is the bounding box of the
specified character array in the specified
Graphics
context. - See Also:
Font.getStringBounds(char[], int, int, FontRenderContext)
getStringBounds
public Rectangle2D getStringBounds(CharacterIterator ci,
int beginIndex,
int limit,
Graphics context)
- Returns the bounds of the characters indexed in the specified
CharacterIterator
in the
specified Graphics
context.
- Parameters:
ci
- the specified CharacterIterator
beginIndex
- the initial offset in ci
limit
- the end index of ci
context
- the specified Graphics
context
- Returns:
- a
Rectangle2D
that is the bounding box of the
characters indexed in the specified CharacterIterator
in the specified Graphics
context. - See Also:
Font.getStringBounds(CharacterIterator, int, int, FontRenderContext)
getMaxCharBounds
public Rectangle2D getMaxCharBounds(Graphics context)
- Returns the bounds for the character with the maximum bounds
in the specified
Graphics
context.
- Parameters:
context
- the specified Graphics
context
- Returns:
- a
Rectangle2D
that is the
bounding box for the character with the maximum bounds. - See Also:
Font.getMaxCharBounds(FontRenderContext)