Struct FontMetrics
Represents font-defined metrics used for vertical alignment and em box sizing. These values are constant for a given font and size.
public readonly struct FontMetrics
- Inherited Members
Constructors
FontMetrics(NFloat, NFloat, NFloat, NFloat, NFloat, NFloat, NFloat)
Initializes a new FontMetrics instance.
public FontMetrics(NFloat fontAscent, NFloat fontDescent, NFloat emAscent, NFloat emDescent, NFloat alphabeticBaseline, NFloat hangingBaseline, NFloat ideographicBaseline)
Parameters
fontAscentNFloatMaximum vertical extent above the baseline from the font’s bounding box.
fontDescentNFloatMaximum vertical extent below the baseline from the font’s bounding box.
emAscentNFloatAscent to the top of the em square.
emDescentNFloatDescent to the bottom of the em square.
alphabeticBaselineNFloatPosition of the alphabetic baseline (typically 0).
hangingBaselineNFloatPosition of the hanging baseline for scripts that use it.
ideographicBaselineNFloatPosition of the ideographic baseline for CJK layout.
Fields
AlphabeticBaseline
Position of the alphabetic baseline (typically 0, used for alignment).
public readonly NFloat AlphabeticBaseline
Field Value
EmHeightAscent
Height from baseline to top of the em square. Recommended for app layout.
public readonly NFloat EmHeightAscent
Field Value
EmHeightDescent
Height from baseline to bottom of the em square. Recommended for app layout.
public readonly NFloat EmHeightDescent
Field Value
FontBoundingBoxAscent
Maximum ascent defined by the font (not necessarily used glyphs).
public readonly NFloat FontBoundingBoxAscent
Field Value
FontBoundingBoxDescent
Maximum descent defined by the font.
public readonly NFloat FontBoundingBoxDescent
Field Value
HangingBaseline
Vertical position of the hanging baseline (used in scripts like Devanagari).
public readonly NFloat HangingBaseline
Field Value
IdeographicBaseline
Vertical position of the ideographic baseline (used in CJK layout).
public readonly NFloat IdeographicBaseline
Field Value
Properties
Height
Total height of the font bounding box.
public NFloat Height { get; }