FontMetrics
Overview
FontMetrics is a class in Aspose.Pdf FOSS for Java.
Holds computed font metrics derived from a {@link FontDescriptor} and font-specific data.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
ascent | double | Read | Returns the ascent (maximum height above baseline) in glyph units (typically 1/1000 em). |
descent | double | Read | Returns the descent (maximum depth below baseline, usually negative). |
capHeight | double | Read | Returns the cap height (height of uppercase letters). |
missingWidth | double | Read | Returns the missing width — default width for characters not in the font’s width table. |
widths | double[] | Read | Returns the custom width table if set. |
Methods
| Signature | Description |
|---|---|
FontMetrics(descriptor: FontDescriptor) | Creates FontMetrics from a FontDescriptor. |
FontMetrics(ascent: double, descent: double, missingWidth: double) | Creates FontMetrics with explicit values. |
getAscent() → double | Returns the ascent (maximum height above baseline) in glyph units (typically 1/1000 em). |
getDescent() → double | Returns the descent (maximum depth below baseline, usually negative). |
getCapHeight() → double | Returns the cap height (height of uppercase letters). |
getMissingWidth() → double | Returns the missing width — default width for characters not in the font’s width table. |
getWidths() → double[] | Returns the custom width table if set. |
setWidths(widths: double[]) | Sets the custom width table. |
setAscent(ascent: double) | Sets the ascent. |
setDescent(descent: double) | Sets the descent. |