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 IFontMetricspublic void setAscender(double value)
Sets Ascender value.
setAscender in interface IFontMetricsvalue - Ascender value.public double getDescender()
Gets Descender value.
getDescender in interface IFontMetricspublic void setDescender(double value)
Sets Descender value.
setDescender in interface IFontMetricsvalue - Descender value.public double getTypoDescender()
Gets TypoDescender value.
getTypoDescender in interface IFontMetricspublic void setTypoDescender(double value)
Sets TypoDescender value.
setTypoDescender in interface IFontMetricsvalue - TypoDescender value.public double getTypoAscender()
Gets TypoAscender value.
getTypoAscender in interface IFontMetricspublic void setTypoAscender(double value)
Sets TypoAscender value.
setTypoAscender in interface IFontMetricsvalue - TypoAscender value.public double getLineGap()
Gets LineGap value.
getLineGap in interface IFontMetricspublic double getTypoLineGap()
Gets TypoLineGap value.
getTypoLineGap in interface IFontMetricspublic boolean isFixedPitch()
Gets IsFixedPitch value.
isFixedPitch in interface IFontMetricspublic FontBBox getFontBBox()
Gets FontBBox value.
getFontBBox in interface IFontMetricspublic TransformationMatrix getFontMatrix()
Gets FontMatrix value.
getFontMatrix in interface IFontMetricspublic long getUnitsPerEM()
Gets UnitsPerEM value.
getUnitsPerEM in interface IFontMetricspublic void setUnitsPerEM(long value)
Sets UnitsPerEM value.
setUnitsPerEM in interface IFontMetricsvalue - UnitsPerEM value.public double getAscender(double fontSize)
Returns ascender for specific Font size.
getAscender in interface IFontMetricsfontSize - Font size.public double getDescender(double fontSize)
Returns descender for specific Font size.
getDescender in interface IFontMetricsfontSize - Font size.public double getTypoDescender(double fontSize)
Returns typographic descender for specific font size
param fontSize Font size.getTypoDescender in interface IFontMetricsfontSize - Font size.public double getTypoAscender(double fontSize)
Returns typographic ascender for specific Font size.
getTypoAscender in interface IFontMetricsfontSize - Font size.public double getTypoLineGap(double fontSize)
Returns line gap for specific Font size.
getTypoLineGap in interface IFontMetricsfontSize - Font size.public double getGlyphWidth(GlyphId glyphId)
Returns glyph width. May be overridden by specific font encoding inheritors.
getGlyphWidth in interface IFontMetricsglyphId - 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 IFontMetricsglyphId - Glyph identifier.public double getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId)
Returns kerning value for the glyph pair.
getKerningValue in interface IFontMetricsprevGlyphId - First glyph in pair.nextGlyphId - Font size.public abstract double measureString(String unicode, double fontSize)
Measures string and returns string width.
measureString in interface IFontMetricsunicode - Unicode string.fontSize - Font size.Copyright © 2025 Aspose. All Rights Reserved.