org.pentaho.reporting.libraries.fonts.registry

Interface FontMetrics

public interface FontMetrics

Font-metrics are computed for a certain font-size and style. There are no general metrics, which are assumed to be globally available.

The use of these font metrics is application dependent. As building these metrics usually is memory and CPU intensive, this must be done in an application specific context. You certainly want to cache the font data.

Author: Thomas Morgner

Method Summary
longgetAscent()
The font ascent is the distance from the font's baseline to the top of most alphanumeric characters.
BaselineInfogetBaselines(int codePoint, BaselineInfo info)
Baselines are defined for scripts, not glyphs.
longgetCharWidth(int codePoint)
longgetDescent()
The font descent is the distance from the font's baseline to the bottom of most alphanumeric characters.
longgetItalicAngle()
longgetKerning(int previous, int codePoint)
longgetLeading()
The standard leading, or interline spacing, is the logical amount of space to be reserved between the descent of one line of text and the ascent of the next line.
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?

Method Detail

getAscent

public long getAscent()
The font ascent is the distance from the font's baseline to the top of most alphanumeric characters. The ascent is always a positive number.

Returns: the ascent.

getBaselines

public BaselineInfo getBaselines(int codePoint, 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).

Parameters: codePoint info

Returns:

getCharWidth

public long getCharWidth(int codePoint)

getDescent

public long getDescent()
The font descent is the distance from the font's baseline to the bottom of most alphanumeric characters. The descent is always a positive number.

Returns: the descent.

getItalicAngle

public long getItalicAngle()

getKerning

public long getKerning(int previous, int codePoint)

getLeading

public long getLeading()
The standard leading, or interline spacing, is the logical amount of space to be reserved between the descent of one line of text and the ascent of the next line. The height metric is calculated to include this extra space. The leading is always a positive number.

Returns: the leading.

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.