Skip to main content

FontFamily Class

Definition​

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia
public class FontFamily

Inheritance: object -> FontFamily

Constructors​

NameDescription
FontFamily (2 overloads)Initializes a new instance of the Avalonia.Media.FontFamily class.

FontFamily overloads​

FontFamily Constructor​

Initializes a new instance of the Avalonia.Media.FontFamily class.

public FontFamily(string name)
Parameters​

name string

The name of the Avalonia.Media.FontFamily.

FontFamily Constructor​

Initializes a new instance of the Avalonia.Media.FontFamily class.

public FontFamily(Uri baseUri, string name)
Parameters​

baseUri Uri

Specifies the base uri that is used to resolve font family assets.

name string

The name of the Avalonia.Media.FontFamily.

Exceptions​

Methods​

NameDescription
EqualsNo summary available.
GetHashCodeReturns a hash code for this instance.
Parse (2 overloads)Parses a Avalonia.Media.FontFamily string.
ToStringReturns a string that represents this instance.

Equals Method​

public bool Equals(object obj)

Parameters​

obj object

Returns​

bool

GetHashCode Method​

Returns a hash code for this instance.

public int GetHashCode()

Returns​

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Parse overloads​

Parse Method​

Parses a Avalonia.Media.FontFamily string.

public Avalonia.Media.FontFamily Parse(string s)
Parameters​

s string

The Avalonia.Media.FontFamily string.

Returns​

Avalonia.Media.FontFamily

Exceptions​

Parse Method​

Parses a Avalonia.Media.FontFamily string.

public Avalonia.Media.FontFamily Parse(string s, Uri baseUri)
Parameters​

s string

The Avalonia.Media.FontFamily string.

baseUri Uri

Specifies the base uri that is used to resolve font family assets.

Returns​

Avalonia.Media.FontFamily

Exceptions​

ToString Method​

Returns a string that represents this instance.

public string ToString()

Returns​

string

A string that represents this instance.

Properties​

NameDescription
DefaultRepresents the default font family
FamilyNamesGets the family names.
FamilyTypefacesGets the typefaces for this font family.
KeyGets the key for associated assets.
NameGets the primary family name of the font family.

Default Property​

Represents the default font family

public Avalonia.Media.FontFamily Default { get; set; }

FamilyNames Property​

Gets the family names.

public Avalonia.Media.Fonts.FamilyNameCollection FamilyNames { get; set; }

Value​

The family familyNames.

FamilyTypefaces Property​

Gets the typefaces for this font family.

public System.Collections.Generic.IReadOnlyList<Avalonia.Media.Typeface> FamilyTypefaces { get; set; }

Key Property​

Gets the key for associated assets.

public Avalonia.Media.Fonts.FontFamilyKey Key { get; set; }

Value​

The family key.

Remarks​

Key is only used for custom fonts.

Name Property​

Gets the primary family name of the font family.

public string Name { get; set; }

Value​

The primary name of the font family.

Fields​

NameDescription
DefaultFontFamilyNameNo summary available.

DefaultFontFamilyName Field​

public string DefaultFontFamilyName