Class EmptyFontMetrics
- java.lang.Object
-
- org.pentaho.reporting.libraries.fonts.registry.EmptyFontMetrics
-
- All Implemented Interfaces:
FontMetrics
public class EmptyFontMetrics extends Object implements FontMetrics
An placeholder metrics for buggy fonts.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description EmptyFontMetrics(FontNativeContext record, double baseWidth, double baseHeight)
EmptyFontMetrics(FontNativeContext record, long baseWidth, long baseHeight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getAscent()
From the baseline to theBaselineInfo
getBaselines(int c, BaselineInfo info)
Baselines are defined for scripts, not glyphs.long
getCharWidth(int codePoint)
long
getDescent()
The font descent is the distance from the font's baseline to the bottom of most alphanumeric characters.long
getItalicAngle()
long
getKerning(int previous, int codePoint)
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.long
getMaxAscent()
long
getMaxCharAdvance()
long
getMaxDescent()
long
getMaxHeight()
FontNativeContext
getNativeContext()
long
getOverlinePosition()
long
getStrikeThroughPosition()
long
getUnderlinePosition()
long
getXHeight()
The height of the lowercase 'x'.boolean
isUniformFontMetrics()
Is it guaranteed that the font always returns the same baseline info objct?
-
-
-
Constructor Detail
-
EmptyFontMetrics
public EmptyFontMetrics(FontNativeContext record, double baseWidth, double baseHeight)
-
EmptyFontMetrics
public EmptyFontMetrics(FontNativeContext record, long baseWidth, long baseHeight)
-
-
Method Detail
-
isUniformFontMetrics
public boolean isUniformFontMetrics()
Is it guaranteed that the font always returns the same baseline info objct?- Specified by:
isUniformFontMetrics
in interfaceFontMetrics
- Returns:
- true, if the baseline info in question is always the same, false otherwise.
-
getAscent
public long getAscent()
From the baseline to the- Specified by:
getAscent
in interfaceFontMetrics
- Returns:
-
getDescent
public long getDescent()
Description copied from interface:FontMetrics
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.- Specified by:
getDescent
in interfaceFontMetrics
- Returns:
- the descent.
-
getLeading
public long getLeading()
Description copied from interface:FontMetrics
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.- Specified by:
getLeading
in 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:
getXHeight
in interfaceFontMetrics
- Returns:
-
getOverlinePosition
public long getOverlinePosition()
- Specified by:
getOverlinePosition
in interfaceFontMetrics
-
getUnderlinePosition
public long getUnderlinePosition()
- Specified by:
getUnderlinePosition
in interfaceFontMetrics
-
getStrikeThroughPosition
public long getStrikeThroughPosition()
- Specified by:
getStrikeThroughPosition
in interfaceFontMetrics
-
getMaxAscent
public long getMaxAscent()
- Specified by:
getMaxAscent
in interfaceFontMetrics
-
getMaxDescent
public long getMaxDescent()
- Specified by:
getMaxDescent
in interfaceFontMetrics
-
getMaxHeight
public long getMaxHeight()
- Specified by:
getMaxHeight
in interfaceFontMetrics
-
getMaxCharAdvance
public long getMaxCharAdvance()
- Specified by:
getMaxCharAdvance
in interfaceFontMetrics
-
getCharWidth
public long getCharWidth(int codePoint)
- Specified by:
getCharWidth
in interfaceFontMetrics
-
getKerning
public long getKerning(int previous, int codePoint)
- Specified by:
getKerning
in interfaceFontMetrics
-
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).- Specified by:
getBaselines
in interfaceFontMetrics
- Parameters:
c
-- Returns:
-
getItalicAngle
public long getItalicAngle()
- Specified by:
getItalicAngle
in interfaceFontMetrics
-
getNativeContext
public FontNativeContext getNativeContext()
- Specified by:
getNativeContext
in interfaceFontMetrics
-
-