Table of Contents

Struct TextLineMetrics

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

Represents a metric for a TextLine objects, that holds information about ascent, descent, line gap, size and origin of the text line.

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

Properties

Extent

Gets the distance from the top-most to bottom-most black pixel in a line.

public double Extent { get; init; }

Property Value

double

HasOverflowed

Gets a value that indicates whether content of the line overflows the specified paragraph width.

public bool HasOverflowed { get; init; }

Property Value

bool

Height

Gets the height of a line of text.

public double Height { get; init; }

Property Value

double

NewlineLength

Gets the number of newline characters at the end of a line.

public int NewlineLength { get; init; }

Property Value

int

OverhangAfter

Gets the distance that black pixels extend beyond the bottom alignment edge of a line.

public double OverhangAfter { get; init; }

Property Value

double

OverhangLeading

Gets the distance that black pixels extend prior to the left leading alignment edge of the line.

public double OverhangLeading { get; init; }

Property Value

double

OverhangTrailing

Gets the distance that black pixels extend following the right trailing alignment edge of the line.

public double OverhangTrailing { get; init; }

Property Value

double

Start

Gets the distance from the start of a paragraph to the starting point of a line.

public double Start { get; init; }

Property Value

double

TextBaseline

Gets the distance from the top to the baseline of the line of text.

public double TextBaseline { get; init; }

Property Value

double

TrailingWhitespaceLength

Gets the number of whitespace code points beyond the last non-blank character in a line.

public int TrailingWhitespaceLength { get; init; }

Property Value

int

Width

Gets the width of a line of text, excluding trailing whitespace characters.

public double Width { get; init; }

Property Value

double

WidthIncludingTrailingWhitespace

Gets the width of a line of text, including trailing whitespace characters.

public double WidthIncludingTrailingWhitespace { get; init; }

Property Value

double

Methods

Equals(TextLineMetrics)

public bool Equals(TextLineMetrics other)

Parameters

other TextLineMetrics

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

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

Parameters

left TextLineMetrics
right TextLineMetrics

Returns

bool

operator !=(TextLineMetrics, TextLineMetrics)

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

Parameters

left TextLineMetrics
right TextLineMetrics

Returns

bool