Table of Contents

Struct TextMetrics

Namespace
Avalonia.Media.TextFormatting
Assembly
Avalonia.Base.dll

A metric that holds information about text specific measurements.

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

Constructors

TextMetrics(IGlyphTypeface, double)

public TextMetrics(IGlyphTypeface glyphTypeface, double fontRenderingEmSize)

Parameters

glyphTypeface IGlyphTypeface
fontRenderingEmSize double

Properties

Ascent

Gets the recommended distance above the baseline.

public double Ascent { get; }

Property Value

double

Descent

Gets the recommended distance under the baseline.

public double Descent { get; }

Property Value

double

FontRenderingEmSize

Em size of font used to format and display text

public double FontRenderingEmSize { get; }

Property Value

double

LineGap

Gets the recommended additional space between two lines of text.

public double LineGap { get; }

Property Value

double

LineHeight

Gets the estimated line height.

public double LineHeight { get; }

Property Value

double

StrikethroughPosition

Gets a value that indicates the distance of the strikethrough from the baseline.

public double StrikethroughPosition { get; }

Property Value

double

StrikethroughThickness

Gets a value that indicates the thickness of the underline.

public double StrikethroughThickness { get; }

Property Value

double

UnderlinePosition

Gets a value that indicates the distance of the underline from the baseline.

public double UnderlinePosition { get; }

Property Value

double

UnderlineThickness

Gets a value that indicates the thickness of the underline.

public double UnderlineThickness { get; }

Property Value

double

Methods

Equals(TextMetrics)

public bool Equals(TextMetrics other)

Parameters

other TextMetrics

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 ==(TextMetrics, TextMetrics)

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

Parameters

left TextMetrics
right TextMetrics

Returns

bool

operator !=(TextMetrics, TextMetrics)

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

Parameters

left TextMetrics
right TextMetrics

Returns

bool