TtfFontMetrics
Inheritance: java.lang.Object, com.aspose.font.FontMetrics
public class TtfFontMetrics extends FontMetrics
Represents TTF Font metrics.
Methods
Method | Description |
---|---|
getGlyphWidth(GlyphId glyphId) | Returns glyphs width by glyph id. |
measureString(String unicode, double fontSize) | Measures string and returns string width. |
measureString(long[] charCodes, double fontSize) | Measures text represented as array of character codes and returns string width. |
getAscender() | Gets ascender value. |
setAscender(double value) | Sets ascender value. |
getDescender() | Gets descender value. |
setDescender(double value) | Sets descender value. |
getTypoAscender() | Gets TypoAscender value. |
setTypoAscender(double value) | Sets TypoAscender value. |
getTypoDescender() | Gets TypoDescender value. |
setTypoDescender(double value) | Sets TypoDescender value. |
getLineGap() | Gets LineGap value. |
getTypoLineGap() | Gets TypoLineGap value. |
getFontBBox() | Gets FontBBox value. |
getFontMatrix() | Gets FontBBox value. |
getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId) | Returns kerning value for the glyph pair. |
getUnitsPerEM() | Gets UnitsPerEM value. |
setUnitsPerEM(long value) |
getGlyphWidth(GlyphId glyphId)
public double getGlyphWidth(GlyphId glyphId)
Returns glyphs width by glyph id.
Parameters:
Parameter | Type | Description |
---|---|---|
glyphId | GlyphId | Glyph identifier. |
Returns: double - Glyph width.
measureString(String unicode, double fontSize)
public double measureString(String unicode, double fontSize)
Measures string and returns string width.
Parameters:
Parameter | Type | Description |
---|---|---|
unicode | java.lang.String | Unicode string. |
fontSize | double | Font size. |
Returns: double - String width.
measureString(long[] charCodes, double fontSize)
public double measureString(long[] charCodes, double fontSize)
Measures text represented as array of character codes and returns string width.
Parameters:
Parameter | Type | Description |
---|---|---|
charCodes | long[] | Text string represented as array of character codes. |
fontSize | double | Font size. |
Returns: double - String width.
getAscender()
public double getAscender()
Gets ascender value.
Returns: double - Ascender value.
setAscender(double value)
public void setAscender(double value)
Sets ascender value.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | Ascender value. |
getDescender()
public double getDescender()
Gets descender value.
Returns: double - Descender value.
setDescender(double value)
public void setDescender(double value)
Sets descender value.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | Descender value. |
getTypoAscender()
public double getTypoAscender()
Gets TypoAscender value.
Returns: double - TypoAscender value.
setTypoAscender(double value)
public void setTypoAscender(double value)
Sets TypoAscender value.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | TypoAscender value. |
getTypoDescender()
public double getTypoDescender()
Gets TypoDescender value.
Returns: double - TypoDescender value.
setTypoDescender(double value)
public void setTypoDescender(double value)
Sets TypoDescender value.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | TypoDescender value. |
getLineGap()
public double getLineGap()
Gets LineGap value.
Returns: double - LineGap value.
getTypoLineGap()
public double getTypoLineGap()
Gets TypoLineGap value.
Returns: double - TypoLineGap value.
getFontBBox()
public FontBBox getFontBBox()
Gets FontBBox value.
Returns: FontBBox
getFontMatrix()
public TransformationMatrix getFontMatrix()
Gets FontBBox value.
Returns: TransformationMatrix
getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId)
public double getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId)
Returns kerning value for the glyph pair.
Parameters:
Parameter | Type | Description |
---|---|---|
prevGlyphId | GlyphId | First glyph in pair. |
nextGlyphId | GlyphId | Font size. |
Returns: double - Kerning value
getUnitsPerEM()
public long getUnitsPerEM()
Gets UnitsPerEM value.
Returns: long
setUnitsPerEM(long value)
public void setUnitsPerEM(long value)
Sets UnitsPerEM value.
Parameters:
Parameter | Type | Description |
---|---|---|
value | long |