public class TtfFontMetrics extends FontMetrics
Represents TTF Font metrics.
| Modifier and Type | Method and Description |
|---|---|
double |
getAscender()
Gets ascender value.
|
double |
getDescender()
Gets descender value.
|
FontBBox |
getFontBBox()
Gets FontBBox value.
|
TransformationMatrix |
getFontMatrix()
Gets FontBBox value.
|
double |
getGlyphWidth(GlyphId glyphId)
Returns glyphs width by glyph id.
|
double |
getKerningValue(GlyphId prevGlyphId,
GlyphId nextGlyphId)
Returns kerning value for the glyph pair.
|
double |
getLineGap()
Gets LineGap value.
|
double |
getTypoAscender()
Gets TypoAscender value.
|
double |
getTypoDescender()
Gets TypoDescender value.
|
double |
getTypoLineGap()
Gets TypoLineGap value.
|
long |
getUnitsPerEM()
Gets UnitsPerEM value.
|
double |
measureString(long[] charCodes,
double fontSize)
Measures text represented as array of character codes and returns string width.
|
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.
|
getAscender, getDescender, getGlyphBBox, getTypoAscender, getTypoDescender, getTypoLineGap, isFixedPitchpublic double getGlyphWidth(GlyphId glyphId)
Returns glyphs width by glyph id.
getGlyphWidth in interface IFontMetricsgetGlyphWidth in class FontMetricsglyphId - Glyph identifier.public double measureString(String unicode, double fontSize)
Measures string and returns string width.
measureString in interface IFontMetricsmeasureString in class FontMetricsunicode - Unicode string.fontSize - Font size.public double measureString(long[] charCodes,
double fontSize)
Measures text represented as array of character codes and returns string width.
charCodes - Text string represented as array of character codes.fontSize - Font size.public double getAscender()
Gets ascender value.
getAscender in interface IFontMetricsgetAscender in class FontMetricspublic void setAscender(double value)
Sets ascender value.
setAscender in interface IFontMetricssetAscender in class FontMetricsvalue - Ascender value.public double getDescender()
Gets descender value.
getDescender in interface IFontMetricsgetDescender in class FontMetricspublic void setDescender(double value)
Sets descender value.
setDescender in interface IFontMetricssetDescender in class FontMetricsvalue - Descender value.public double getTypoAscender()
Gets TypoAscender value.
getTypoAscender in interface IFontMetricsgetTypoAscender in class FontMetricspublic void setTypoAscender(double value)
Sets TypoAscender value.
setTypoAscender in interface IFontMetricssetTypoAscender in class FontMetricsvalue - TypoAscender value.public double getTypoDescender()
Gets TypoDescender value.
getTypoDescender in interface IFontMetricsgetTypoDescender in class FontMetricspublic void setTypoDescender(double value)
Sets TypoDescender value.
setTypoDescender in interface IFontMetricssetTypoDescender in class FontMetricsvalue - TypoDescender value.public double getLineGap()
Gets LineGap value.
getLineGap in interface IFontMetricsgetLineGap in class FontMetricspublic double getTypoLineGap()
Gets TypoLineGap value.
getTypoLineGap in interface IFontMetricsgetTypoLineGap in class FontMetricspublic FontBBox getFontBBox()
Gets FontBBox value.
getFontBBox in interface IFontMetricsgetFontBBox in class FontMetricspublic TransformationMatrix getFontMatrix()
Gets FontBBox value.
getFontMatrix in interface IFontMetricsgetFontMatrix in class FontMetricspublic double getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId)
Returns kerning value for the glyph pair.
getKerningValue in interface IFontMetricsgetKerningValue in class FontMetricsprevGlyphId - First glyph in pair.nextGlyphId - Font size.public long getUnitsPerEM()
Gets UnitsPerEM value.
getUnitsPerEM in interface IFontMetricsgetUnitsPerEM in class FontMetricspublic void setUnitsPerEM(long value)
FontMetricsSets UnitsPerEM value.
setUnitsPerEM in interface IFontMetricssetUnitsPerEM in class FontMetricsvalue - UnitsPerEM value.Copyright © 2025 Aspose. All Rights Reserved.