Table of Contents

Struct FontMetrics

Namespace
Avalonia.Media
Assembly
Avalonia.Base.dll

The font metrics is holding information about a font's ascent, descent, etc. in design em units.

public readonly struct FontMetrics : IEquatable<FontMetrics>
Implements
Inherited Members

Properties

Ascent

Gets the recommended distance above the baseline in design em size.

public int Ascent { get; init; }

Property Value

int

Descent

Gets the recommended distance under the baseline in design em size.

public int Descent { get; init; }

Property Value

int

DesignEmHeight

Gets the font design units per em.

public short DesignEmHeight { get; init; }

Property Value

short

IsFixedPitch

A bool value indicating whether all glyphs in the font have the same advancement.

public bool IsFixedPitch { get; init; }

Property Value

bool

LineGap

Gets the recommended additional space between two lines of text in design em size.

public int LineGap { get; init; }

Property Value

int

LineSpacing

Gets the recommended line spacing of a formed text line.

public int LineSpacing { get; }

Property Value

int

StrikethroughPosition

Gets a value that indicates the distance of the strikethrough from the baseline in design em size.

public int StrikethroughPosition { get; init; }

Property Value

int

StrikethroughThickness

Gets a value that indicates the thickness of the underline in design em size.

public int StrikethroughThickness { get; init; }

Property Value

int

UnderlinePosition

Gets a value that indicates the distance of the underline from the baseline in design em size.

public int UnderlinePosition { get; init; }

Property Value

int

UnderlineThickness

Gets a value that indicates the thickness of the underline in design em size.

public int UnderlineThickness { get; init; }

Property Value

int

Methods

Equals(FontMetrics)

public bool Equals(FontMetrics other)

Parameters

other FontMetrics

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(FontMetrics, FontMetrics)

public static bool operator ==(FontMetrics left, FontMetrics right)

Parameters

left FontMetrics
right FontMetrics

Returns

bool

operator !=(FontMetrics, FontMetrics)

public static bool operator !=(FontMetrics left, FontMetrics right)

Parameters

left FontMetrics
right FontMetrics

Returns

bool