Class AWTFontMetrics
- java.lang.Object
-
- org.pentaho.reporting.libraries.fonts.awt.AWTFontMetrics
-
- All Implemented Interfaces:
FontMetrics
public class AWTFontMetrics extends Object implements FontMetrics
Creation-Date: 16.12.2005, 21:09:39- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description AWTFontMetrics(FontNativeContext record, Font font, FontContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Graphics2DcreateGraphics(FontContext context)longgetAscent()From the baseline to theBaselineInfogetBaselines(int c, BaselineInfo info)Baselines are defined for scripts, not glyphs.longgetCharWidth(int character)longgetDescent()The font descent is the distance from the font's baseline to the bottom of most alphanumeric characters.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()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()FontNativeContextgetNativeContext()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(FontNativeContext record, Font font, FontContext context)
-
-
Method Detail
-
createGraphics
protected Graphics2D createGraphics(FontContext context)
-
getFont
public Font getFont()
-
getAscent
public long getAscent()
From the baseline to the- Specified by:
getAscentin interfaceFontMetrics- Returns:
-
getDescent
public long getDescent()
Description copied from interface:FontMetricsThe font descent is the distance from the font's baseline to the bottom of most alphanumeric characters. The descent is always a positive number.- Specified by:
getDescentin interfaceFontMetrics- Returns:
- the descent.
-
getLeading
public long getLeading()
Description copied from interface:FontMetricsThe 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.- Specified by:
getLeadingin interfaceFontMetrics- Returns:
- the leading.
-
getXHeight
public long getXHeight()
The height of the lowercase 'x'. This is used as hint, which size the lowercase characters will have.- Specified by:
getXHeightin interfaceFontMetrics- Returns:
-
getOverlinePosition
public long getOverlinePosition()
- Specified by:
getOverlinePositionin interfaceFontMetrics
-
getUnderlinePosition
public long getUnderlinePosition()
- Specified by:
getUnderlinePositionin interfaceFontMetrics
-
getStrikeThroughPosition
public long getStrikeThroughPosition()
- Specified by:
getStrikeThroughPositionin interfaceFontMetrics
-
getMaxAscent
public long getMaxAscent()
- Specified by:
getMaxAscentin interfaceFontMetrics
-
getMaxDescent
public long getMaxDescent()
- Specified by:
getMaxDescentin interfaceFontMetrics
-
getMaxHeight
public long getMaxHeight()
- Specified by:
getMaxHeightin interfaceFontMetrics
-
getMaxCharAdvance
public long getMaxCharAdvance()
- Specified by:
getMaxCharAdvancein interfaceFontMetrics
-
getCharWidth
public long getCharWidth(int character)
- Specified by:
getCharWidthin interfaceFontMetrics
-
getKerning
public long getKerning(int previous, int character)This method is EXPENSIVE.- Specified by:
getKerningin interfaceFontMetrics- Parameters:
previous-character-- 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.- Specified by:
getBaselinesin interfaceFontMetrics- Parameters:
c- the character that is used to select the script type.- Returns:
-
isUniformFontMetrics
public boolean isUniformFontMetrics()
Is it guaranteed that the font always returns the same baseline info objct?- Specified by:
isUniformFontMetricsin interfaceFontMetrics- Returns:
- true, if the baseline info in question is always the same, false otherwise.
-
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.- Specified by:
getItalicAnglein interfaceFontMetrics- Returns:
- always zero.
-
getNativeContext
public FontNativeContext getNativeContext()
- Specified by:
getNativeContextin interfaceFontMetrics
-
-