Table of Contents

Struct Typeface

Namespace
Avalonia.Media
Assembly
Avalonia.Base.dll

Represents a typeface.

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

Constructors

Typeface(FontFamily, FontStyle, FontWeight, FontStretch)

Initializes a new instance of the Typeface class.

public Typeface(FontFamily fontFamily, FontStyle style = FontStyle.Normal, FontWeight weight = FontWeight.Normal, FontStretch stretch = FontStretch.Normal)

Parameters

fontFamily FontFamily

The font family.

style FontStyle

The font style.

weight FontWeight

The font weight.

stretch FontStretch

The font stretch.

Typeface(string, FontStyle, FontWeight, FontStretch)

Initializes a new instance of the Typeface class.

public Typeface(string fontFamilyName, FontStyle style = FontStyle.Normal, FontWeight weight = FontWeight.Normal, FontStretch stretch = FontStretch.Normal)

Parameters

fontFamilyName string

The name of the font family.

style FontStyle

The font style.

weight FontWeight

The font weight.

stretch FontStretch

The font stretch.

Properties

Default

public static Typeface Default { get; }

Property Value

Typeface

FontFamily

Gets the font family.

public FontFamily FontFamily { get; }

Property Value

FontFamily

GlyphTypeface

Gets the glyph typeface.

public IGlyphTypeface GlyphTypeface { get; }

Property Value

IGlyphTypeface

The glyph typeface.

Stretch

Gets the font stretch.

public FontStretch Stretch { get; }

Property Value

FontStretch

Style

Gets the font style.

public FontStyle Style { get; }

Property Value

FontStyle

Weight

Gets the font weight.

public FontWeight Weight { get; }

Property Value

FontWeight

Methods

Equals(Typeface)

public bool Equals(Typeface other)

Parameters

other Typeface

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Operators

operator ==(Typeface, Typeface)

public static bool operator ==(Typeface a, Typeface b)

Parameters

a Typeface
b Typeface

Returns

bool

operator !=(Typeface, Typeface)

public static bool operator !=(Typeface a, Typeface b)

Parameters

a Typeface
b Typeface

Returns

bool