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 int ascent
descent
private int descent
leading
private int leading
maxAdvance
private int 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()
- Overrides:
getAscent in class FontMetrics
getDescent
public int getDescent()
- Overrides:
getDescent in class FontMetrics
getLeading
public int getLeading()
- Overrides:
getLeading in class FontMetrics
getMaxAdvance
public int getMaxAdvance()
- Overrides:
getMaxAdvance in class FontMetrics
getWidths
public int[] getWidths()
- Overrides:
getWidths in class FontMetrics
charWidth
public int charWidth(char c)
- Overrides:
charWidth in class FontMetrics
stringWidth
public int stringWidth(String s)
- Overrides:
stringWidth in class FontMetrics
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.
- Overrides:
getStringBounds in class FontMetrics
- Parameters:
str - the specified Stringcontext - 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.
- Overrides:
getStringBounds in class FontMetrics
- Parameters:
str - the specified StringbeginIndex - the offset of the beginning of strlimit - the length of strcontext - 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.
- Overrides:
getStringBounds in class FontMetrics
- 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.
- Overrides:
getStringBounds in class FontMetrics
- Parameters:
ci - the specified CharacterIteratorbeginIndex - the initial offset in cilimit - the end index of cicontext - 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.
- Overrides:
getMaxCharBounds in class FontMetrics
- 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)