TextMetrics Struct

The dimensions of a line of text.

public readonly struct TextMetrics : IEquatable<TextMetrics>
Implements

Constructors

NameDescription
TextMetrics(double, double, double)The dimensions of a line of text.

TextMetrics(double, double, double)

The dimensions of a line of text.

public TextMetrics(double Width, double Ascent, double Descent)

Parameters

Width double
The advance width of the text.
Ascent double
The distance from the baseline to the top of the line, positive.
Descent double
The distance from the baseline to the bottom of the line, positive.

Properties

NameDescription
AscentThe distance from the baseline to the top of the line, positive.
DescentThe distance from the baseline to the bottom of the line, positive.
HeightGets the height of the line, TextMetrics.Ascent plus TextMetrics.Descent.
WidthThe advance width of the text.

The distance from the baseline to the top of the line, positive.

public double Ascent { get; init; }

Property value

double

The distance from the baseline to the bottom of the line, positive.

public double Descent { get; init; }

Property value

double

Gets the height of the line, TextMetrics.Ascent plus TextMetrics.Descent.

public double Height { get; }

Property value

double

The advance width of the text.

public double Width { get; init; }

Property value

double

Methods

NameDescription
Deconstruct(double, double, double)
Equals(TextMetrics)
Equals(object)
GetHashCode()
ToString()

Deconstruct(double, double, double)

public void Deconstruct(out double Width, out double Ascent, out double Descent)

Parameters

Width double
Ascent double
Descent double

No documentation is available.

Equals overloads

Equals(TextMetrics)

public bool Equals(TextMetrics other)
Parameters
other TextMetrics
Returns

bool

No documentation is available.

Equals(object)

public override bool Equals(object obj)
Parameters
obj object
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(TextMetrics, TextMetrics)
operator !=(TextMetrics, TextMetrics)

operator ==(TextMetrics, TextMetrics)

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

Parameters

left TextMetrics
right TextMetrics

Returns

bool

No documentation is available.

operator !=(TextMetrics, TextMetrics)

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

Parameters

left TextMetrics
right TextMetrics

Returns

bool

No documentation is available.