Table of Contents

Struct FontMetrics

Namespace
Xui.Core.Canvas
Assembly
Xui.Core.dll

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

fontAscent NFloat

Maximum vertical extent above the baseline from the font’s bounding box.

fontDescent NFloat

Maximum vertical extent below the baseline from the font’s bounding box.

emAscent NFloat

Ascent to the top of the em square.

emDescent NFloat

Descent to the bottom of the em square.

alphabeticBaseline NFloat

Position of the alphabetic baseline (typically 0).

hangingBaseline NFloat

Position of the hanging baseline for scripts that use it.

ideographicBaseline NFloat

Position 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

NFloat

EmHeightAscent

Height from baseline to top of the em square. Recommended for app layout.

public readonly NFloat EmHeightAscent

Field Value

NFloat

EmHeightDescent

Height from baseline to bottom of the em square. Recommended for app layout.

public readonly NFloat EmHeightDescent

Field Value

NFloat

FontBoundingBoxAscent

Maximum ascent defined by the font (not necessarily used glyphs).

public readonly NFloat FontBoundingBoxAscent

Field Value

NFloat

FontBoundingBoxDescent

Maximum descent defined by the font.

public readonly NFloat FontBoundingBoxDescent

Field Value

NFloat

HangingBaseline

Vertical position of the hanging baseline (used in scripts like Devanagari).

public readonly NFloat HangingBaseline

Field Value

NFloat

IdeographicBaseline

Vertical position of the ideographic baseline (used in CJK layout).

public readonly NFloat IdeographicBaseline

Field Value

NFloat

Properties

Height

Total height of the font bounding box.

public NFloat Height { get; }

Property Value

NFloat