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


Field Summary
private  double ascent
           
private  BaseFont bf
           
private  double descent
           
private  float fontSize
           
private  double leading
           
private  double maxAdvance
           
private  double scaleX
           
private  double scaleY
           
private  int[] widths
           
 
Fields inherited from class java.awt.FontMetrics
font
 
Constructor Summary
private PdfGraphics2D.PdfFontMetrics(Font f, BaseFont bf)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

PdfGraphics2D.PdfFontMetrics

private PdfGraphics2D.PdfFontMetrics(Font f,
                                     BaseFont bf)
Method Detail

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 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.

Overrides:
getStringBounds in class FontMetrics
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.

Overrides:
getStringBounds in class FontMetrics
Parameters:
chars - an array of characters
beginIndex - the initial offset of the array of characters
limit - the length of the array of characters
context - 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 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.

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)