org.pentaho.reporting.libraries.fonts.awt

Class AWTFontMetrics

public class AWTFontMetrics extends Object implements FontMetrics

Creation-Date: 16.12.2005, 21:09:39

Author: Thomas Morgner

Constructor Summary
AWTFontMetrics(Font font, FontContext context)
Method Summary
protected Graphics2DcreateGraphics(FontContext context)
longgetAscent()
From the baseline to the
BaselineInfogetBaselines(int c, BaselineInfo info)
Baselines are defined for scripts, not glyphs.
longgetCharWidth(int character)
longgetDescent()
FontgetFont()
longgetItalicAngle()
Returns zero, as the AWT renderer will take care of the italic rendering already.
longgetKerning(int previous, int character)
This method is EXPENSIVE.
longgetLeading()
longgetMaxAscent()
longgetMaxCharAdvance()
longgetMaxDescent()
longgetMaxHeight()
longgetOverlinePosition()
longgetStrikeThroughPosition()
longgetUnderlinePosition()
longgetXHeight()
The height of the lowercase 'x'.
booleanisUniformFontMetrics()
Is it guaranteed that the font always returns the same baseline info objct?

Constructor Detail

AWTFontMetrics

public AWTFontMetrics(Font font, FontContext context)

Method Detail

createGraphics

protected Graphics2D createGraphics(FontContext context)

getAscent

public long getAscent()
From the baseline to the

Returns:

getBaselines

public BaselineInfo getBaselines(int c, BaselineInfo info)
Baselines are defined for scripts, not glyphs. A glyph carries script information most of the time (unless it is a neutral characters or just weird).

The baseline info does not take any leading into account.

Parameters: c the character that is used to select the script type.

Returns:

getCharWidth

public long getCharWidth(int character)

getDescent

public long getDescent()

getFont

public Font getFont()

getItalicAngle

public long getItalicAngle()
Returns zero, as the AWT renderer will take care of the italic rendering already. We do not have to apply any special transformations to the font to make it look italic.

Returns: always zero.

getKerning

public long getKerning(int previous, int character)
This method is EXPENSIVE.

Parameters: previous character

Returns:

getLeading

public long getLeading()

getMaxAscent

public long getMaxAscent()

getMaxCharAdvance

public long getMaxCharAdvance()

getMaxDescent

public long getMaxDescent()

getMaxHeight

public long getMaxHeight()

getOverlinePosition

public long getOverlinePosition()

getStrikeThroughPosition

public long getStrikeThroughPosition()

getUnderlinePosition

public long getUnderlinePosition()

getXHeight

public long getXHeight()
The height of the lowercase 'x'. This is used as hint, which size the lowercase characters will have.

Returns:

isUniformFontMetrics

public boolean isUniformFontMetrics()
Is it guaranteed that the font always returns the same baseline info objct?

Returns: true, if the baseline info in question is always the same, false otherwise.