IFontMetrics

public interface IFontMetrics

Defines an interface for Font metrics tools.

Methods

MethodDescription
isFixedPitch()True, if the Font is monospaced.
getFontBBox()Gets Font bounding box.
getFontMatrix()Gets Font transformation matrix.
getUnitsPerEM()Gets Gets units per em.
setUnitsPerEM(long value)
getAscender()Gets ascender value of the Font in font units.
setAscender(double value)
getTypoAscender()Gets typographic ascender value of the Font in font units
setTypoAscender(double value)
getDescender()Gets descender value of the Font in font units.
setDescender(double value)
getTypoDescender()Gets typographic descender value of the Font in Font units.
setTypoDescender(double value)
getLineGap()Gets LineGap value of the Font in Font units.
getTypoLineGap()Gets typographic LineGap value of the Font in Font units.
getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId)Returns kerning value for the glyph pair.
getGlyphWidth(GlyphId glyphId)Returns glyph width.
getGlyphBBox(GlyphId glyphId)Returns glyph BBox.
getAscender(double fontSize)Returns ascender for specific Font size.
getDescender(double fontSize)Returns descender for specific Font size.
getTypoDescender(double fontSize)Returns typographic descender for specific Font size.
getTypoAscender(double fontSize)Returns typographic ascender for specific Font size.
getTypoLineGap(double fontSize)Returns line gap for specific Font size.
measureString(String unicode, double fontSize)Measures string and returns string width.

isFixedPitch()

public abstract boolean isFixedPitch()

True, if the Font is monospaced.

Returns: boolean - True, if the Font is monospaced.

getFontBBox()

public abstract FontBBox getFontBBox()

Gets Font bounding box.

Returns: FontBBox - Font bounding box.

getFontMatrix()

public abstract TransformationMatrix getFontMatrix()

Gets Font transformation matrix.

Returns: TransformationMatrix - Font transformation matrix.

getUnitsPerEM()

public abstract long getUnitsPerEM()

Gets Gets units per em.

Returns: long - Units per em.

setUnitsPerEM(long value)

public abstract void setUnitsPerEM(long value)

Parameters:

ParameterTypeDescription
valuelong

getAscender()

public abstract double getAscender()

Gets ascender value of the Font in font units.

Returns: double - Ascender value of the Font in font units.

setAscender(double value)

public abstract void setAscender(double value)

Parameters:

ParameterTypeDescription
valuedouble

getTypoAscender()

public abstract double getTypoAscender()

Gets typographic ascender value of the Font in font units

Returns: double - Typographic ascender value of the Font in font units

setTypoAscender(double value)

public abstract void setTypoAscender(double value)

Parameters:

ParameterTypeDescription
valuedouble

getDescender()

public abstract double getDescender()

Gets descender value of the Font in font units.

Returns: double - Descender value of the Font in font units.

setDescender(double value)

public abstract void setDescender(double value)

Parameters:

ParameterTypeDescription
valuedouble

getTypoDescender()

public abstract double getTypoDescender()

Gets typographic descender value of the Font in Font units.

Returns: double - Typographic descender value of the Font in Font units.

setTypoDescender(double value)

public abstract void setTypoDescender(double value)

Parameters:

ParameterTypeDescription
valuedouble

getLineGap()

public abstract double getLineGap()

Gets LineGap value of the Font in Font units.

Returns: double - LineGap value of the Font in Font units.

getTypoLineGap()

public abstract double getTypoLineGap()

Gets typographic LineGap value of the Font in Font units.

Returns: double - Typographic LineGap value of the Font in Font units.

getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId)

public abstract double getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId)

Returns kerning value for the glyph pair.

Parameters:

ParameterTypeDescription
prevGlyphIdGlyphIdFirst glyph in pair.
nextGlyphIdGlyphIdFont size.

Returns: double - Kerning value.

getGlyphWidth(GlyphId glyphId)

public abstract double getGlyphWidth(GlyphId glyphId)

Returns glyph width.

Parameters:

ParameterTypeDescription
glyphIdGlyphIdGlyph identifier.

Returns: double - Glyph width.

getGlyphBBox(GlyphId glyphId)

public abstract FontBBox getGlyphBBox(GlyphId glyphId)

Returns glyph BBox.

Parameters:

ParameterTypeDescription
glyphIdGlyphIdglyph identifier

Returns: FontBBox - glyph BBox

getAscender(double fontSize)

public abstract double getAscender(double fontSize)

Returns ascender for specific Font size.

Parameters:

ParameterTypeDescription
fontSizedoubleFont size.

Returns: double - Ascender value.

getDescender(double fontSize)

public abstract double getDescender(double fontSize)

Returns descender for specific Font size.

Parameters:

ParameterTypeDescription
fontSizedoubleFont size.

Returns: double - Descender value.

getTypoDescender(double fontSize)

public abstract double getTypoDescender(double fontSize)

Returns typographic descender for specific Font size.

Parameters:

ParameterTypeDescription
fontSizedoubleFont size.

Returns: double - Typographic descender value.

getTypoAscender(double fontSize)

public abstract double getTypoAscender(double fontSize)

Returns typographic ascender for specific Font size.

Parameters:

ParameterTypeDescription
fontSizedoubleFont size.

Returns: double - Typographic ascender value.

getTypoLineGap(double fontSize)

public abstract double getTypoLineGap(double fontSize)

Returns line gap for specific Font size.

Parameters:

ParameterTypeDescription
fontSizedoubleFont size.

Returns: double - Line gap value.

measureString(String unicode, double fontSize)

public abstract double measureString(String unicode, double fontSize)

Measures string and returns string width.

Parameters:

ParameterTypeDescription
unicodejava.lang.StringUnicode string.
fontSizedoubleFont size.

Returns: double - String width.