Skip to main content

TextMetrics Struct

Definition​

Assembly:Avalonia.Base
Package:Avalonia

A metric that holds information about text specific measurements.

public struct TextMetrics

Inheritance: ValueType -> TextMetrics

Implements: IEquatable<TextMetrics>

Constructors​

NameDescription
TextMetricsNo summary available.

TextMetrics Constructor​

public TextMetrics(Avalonia.Media.GlyphTypeface glyphTypeface, double fontRenderingEmSize)

Parameters​

glyphTypeface Avalonia.Media.GlyphTypeface

fontRenderingEmSize double

Methods​

NameDescription
Equals (2 overloads)No summary available.
GetHashCodeNo summary available.
ToStringNo summary available.

Equals overloads​

Equals Method​

public bool Equals(Avalonia.Media.TextFormatting.TextMetrics other)
Parameters​

other Avalonia.Media.TextFormatting.TextMetrics

Returns​

bool

Equals Method​

public bool Equals(object obj)
Parameters​

obj object

Returns​

bool

GetHashCode Method​

public int GetHashCode()

Returns​

int

ToString Method​

public string ToString()

Returns​

string

Properties​

NameDescription
AscentGets the recommended distance above the baseline.
BaselineGets the distance from the top to the baseline of the line of text.
DescentGets the recommended distance under the baseline.
FontRenderingEmSizeEm size of font used to format and display text
LineGapGets the recommended additional space between two lines of text.
LineHeightGets the estimated line height.
StrikethroughPositionGets a value that indicates the distance of the strikethrough from the baseline.
StrikethroughThicknessGets a value that indicates the thickness of the underline.
UnderlinePositionGets a value that indicates the distance of the underline from the baseline.
UnderlineThicknessGets a value that indicates the thickness of the underline.

Ascent Property​

Gets the recommended distance above the baseline.

public double Ascent { get; set; }

Baseline Property​

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

public double Baseline { get; set; }

Descent Property​

Gets the recommended distance under the baseline.

public double Descent { get; set; }

FontRenderingEmSize Property​

Em size of font used to format and display text

public double FontRenderingEmSize { get; set; }

LineGap Property​

Gets the recommended additional space between two lines of text.

public double LineGap { get; set; }

LineHeight Property​

Gets the estimated line height.

public double LineHeight { get; set; }

StrikethroughPosition Property​

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

public double StrikethroughPosition { get; set; }

StrikethroughThickness Property​

Gets a value that indicates the thickness of the underline.

public double StrikethroughThickness { get; set; }

UnderlinePosition Property​

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

public double UnderlinePosition { get; set; }

UnderlineThickness Property​

Gets a value that indicates the thickness of the underline.

public double UnderlineThickness { get; set; }