public abstract class FontMetrics extends Object implements IFontMetrics
Represents font metrics.
Modifier and Type | Method and Description |
---|---|
double |
getAscender()
Gets Ascender value.
|
double |
getAscender(double fontSize)
Returns ascender for specific Font size.
|
double |
getDescender()
Gets Descender value.
|
double |
getDescender(double fontSize)
Returns descender for specific Font size.
|
FontBBox |
getFontBBox()
Gets FontBBox value.
|
TransformationMatrix |
getFontMatrix()
Gets FontMatrix value.
|
FontBBox |
getGlyphBBox(GlyphId glyphId)
Returns glyph Bbox.
|
double |
getGlyphWidth(GlyphId glyphId)
Returns glyph width.
|
double |
getKerningValue(GlyphId prevGlyphId,
GlyphId nextGlyphId)
Returns kerning value for the glyph pair.
|
double |
getLineGap()
Gets LineGap value.
|
double |
getTypoAscender()
Gets TypoAscender value.
|
double |
getTypoAscender(double fontSize)
Returns typographic ascender for specific Font size.
|
double |
getTypoDescender()
Gets TypoDescender value.
|
double |
getTypoDescender(double fontSize)
Returns typographic descender for specific font size
param fontSize Font size.
|
double |
getTypoLineGap()
Gets TypoLineGap value.
|
double |
getTypoLineGap(double fontSize)
Returns line gap for specific Font size.
|
long |
getUnitsPerEM()
Gets UnitsPerEM value.
|
boolean |
isFixedPitch()
Gets IsFixedPitch value.
|
abstract double |
measureString(String unicode,
double fontSize)
Measures string and returns string width.
|
void |
setAscender(double value)
Sets Ascender value.
|
void |
setDescender(double value)
Sets Descender value.
|
void |
setTypoAscender(double value)
Sets TypoAscender value.
|
void |
setTypoDescender(double value)
Sets TypoDescender value.
|
void |
setUnitsPerEM(long value)
Sets UnitsPerEM value.
|
public double getAscender()
Gets Ascender value.
getAscender
in interface IFontMetrics
public void setAscender(double value)
Sets Ascender value.
setAscender
in interface IFontMetrics
value
- Ascender value.public double getDescender()
Gets Descender value.
getDescender
in interface IFontMetrics
public void setDescender(double value)
Sets Descender value.
setDescender
in interface IFontMetrics
value
- Descender value.public double getTypoDescender()
Gets TypoDescender value.
getTypoDescender
in interface IFontMetrics
public void setTypoDescender(double value)
Sets TypoDescender value.
setTypoDescender
in interface IFontMetrics
value
- TypoDescender value.public double getTypoAscender()
Gets TypoAscender value.
getTypoAscender
in interface IFontMetrics
public void setTypoAscender(double value)
Sets TypoAscender value.
setTypoAscender
in interface IFontMetrics
value
- TypoAscender value.public double getLineGap()
Gets LineGap value.
getLineGap
in interface IFontMetrics
public double getTypoLineGap()
Gets TypoLineGap value.
getTypoLineGap
in interface IFontMetrics
public boolean isFixedPitch()
Gets IsFixedPitch value.
isFixedPitch
in interface IFontMetrics
public FontBBox getFontBBox()
Gets FontBBox value.
getFontBBox
in interface IFontMetrics
public TransformationMatrix getFontMatrix()
Gets FontMatrix value.
getFontMatrix
in interface IFontMetrics
public long getUnitsPerEM()
Gets UnitsPerEM value.
getUnitsPerEM
in interface IFontMetrics
public void setUnitsPerEM(long value)
Sets UnitsPerEM value.
setUnitsPerEM
in interface IFontMetrics
value
- UnitsPerEM value.public double getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId)
Returns kerning value for the glyph pair.
getKerningValue
in interface IFontMetrics
prevGlyphId
- First glyph in pair.nextGlyphId
- Font size.public double getAscender(double fontSize)
Returns ascender for specific Font size.
getAscender
in interface IFontMetrics
fontSize
- Font size.public double getDescender(double fontSize)
Returns descender for specific Font size.
getDescender
in interface IFontMetrics
fontSize
- Font size.public double getTypoDescender(double fontSize)
Returns typographic descender for specific font size
param fontSize Font size.getTypoDescender
in interface IFontMetrics
fontSize
- Font size.public double getTypoAscender(double fontSize)
Returns typographic ascender for specific Font size.
getTypoAscender
in interface IFontMetrics
fontSize
- Font size.public double getTypoLineGap(double fontSize)
Returns line gap for specific Font size.
getTypoLineGap
in interface IFontMetrics
fontSize
- Font size.public double getGlyphWidth(GlyphId glyphId)
Returns glyph width. May be overridden by specific font encoding inheritors.
getGlyphWidth
in interface IFontMetrics
glyphId
- Glyph identifier.public FontBBox getGlyphBBox(GlyphId glyphId)
Returns glyph Bbox. Returns FontBBox if BBox was not defined for the glyph. May be overridden by specific font encoding inheritors.
getGlyphBBox
in interface IFontMetrics
glyphId
- Glyph identifier.public abstract double measureString(String unicode, double fontSize)
Measures string and returns string width.
measureString
in interface IFontMetrics
unicode
- Unicode string.fontSize
- Font size.