FontMetrics
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.font.IFontMetrics
public abstract class FontMetrics implements IFontMetrics
Represents font metrics.
Methods
Method | Description |
---|---|
getAscender() | Gets Ascender value. |
setAscender(double value) | Sets Ascender value. |
getDescender() | Gets Descender value. |
setDescender(double value) | Sets Descender value. |
getTypoDescender() | Gets TypoDescender value. |
setTypoDescender(double value) | Sets TypoDescender value. |
getTypoAscender() | Gets TypoAscender value. |
setTypoAscender(double value) | Sets TypoAscender value. |
getLineGap() | Gets LineGap value. |
getTypoLineGap() | Gets TypoLineGap value. |
isFixedPitch() | Gets IsFixedPitch value. |
getFontBBox() | Gets FontBBox value. |
getFontMatrix() | Gets FontMatrix value. |
getUnitsPerEM() | Gets UnitsPerEM value. |
setUnitsPerEM(long value) | Sets UnitsPerEM value. |
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. |
getGlyphWidth(GlyphId glyphId) | Returns glyph width. |
getGlyphBBox(GlyphId glyphId) | Returns glyph Bbox. |
getKerningValue(GlyphId prevGlyphId, GlyphId nextGlyphId) | Returns kerning value for the glyph pair. |
measureString(String unicode, double fontSize) | Measures string and returns 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. |
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. |
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. |
getLineGap()
public double getLineGap()
Gets LineGap value.
Returns: double - LineGap value.
getTypoLineGap()
public double getTypoLineGap()
Gets TypoLineGap value.
Returns: double - TypoLineGap value.
isFixedPitch()
public boolean isFixedPitch()
Gets IsFixedPitch value.
Returns: boolean - IsFixedPitch value.
getFontBBox()
public FontBBox getFontBBox()
Gets FontBBox value.
Returns: FontBBox - FontBBox value.
getFontMatrix()
public TransformationMatrix getFontMatrix()
Gets FontMatrix value.
Returns: TransformationMatrix - FontMatrix value.
getUnitsPerEM()
public long getUnitsPerEM()
Gets UnitsPerEM value.
Returns: long - UnitsPerEM value.
setUnitsPerEM(long value)
public void setUnitsPerEM(long value)
Sets UnitsPerEM value.
Parameters:
Parameter | Type | Description |
---|---|---|
value | long | UnitsPerEM value. |
getAscender(double fontSize)
public double getAscender(double fontSize)
Returns ascender for specific Font size.
Parameters:
Parameter | Type | Description |
---|---|---|
fontSize | double | Font size. |
Returns: double - Ascender value.
getDescender(double fontSize)
public double getDescender(double fontSize)
Returns descender for specific Font size.
Parameters:
Parameter | Type | Description |
---|---|---|
fontSize | double | Font size. |
Returns: double - Descender value.
getTypoDescender(double fontSize)
public double getTypoDescender(double fontSize)
Returns typographic descender for specific font size
param fontSize Font size.
Parameters:
Parameter | Type | Description |
---|---|---|
fontSize | double |
Returns: double - Typographic descender value.
getTypoAscender(double fontSize)
public double getTypoAscender(double fontSize)
Returns typographic ascender for specific Font size.
Parameters:
Parameter | Type | Description |
---|---|---|
fontSize | double | Font size. |
Returns: double - Typographic ascender value.
getTypoLineGap(double fontSize)
public double getTypoLineGap(double fontSize)
Returns line gap for specific Font size.
Parameters:
Parameter | Type | Description |
---|---|---|
fontSize | double | Font size. |
Returns: double - Line gap value.
getGlyphWidth(GlyphId glyphId)
public double getGlyphWidth(GlyphId glyphId)
Returns glyph width. May be overridden by specific font encoding inheritors.
Parameters:
Parameter | Type | Description |
---|---|---|
glyphId | GlyphId | Glyph identifier. |
Returns: double - Glyph width.
getGlyphBBox(GlyphId glyphId)
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.
Parameters:
Parameter | Type | Description |
---|---|---|
glyphId | GlyphId | Glyph identifier. |
Returns: FontBBox - Glyph BBox.
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.
measureString(String unicode, double fontSize)
public abstract 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.