Class FontFamily
public sealed class FontFamily
- Inheritance
-
FontFamily
- Inherited Members
Constructors
FontFamily(string)
Initializes a new instance of the FontFamily class.
public FontFamily(string name)
Parameters
name
stringThe name of the FontFamily.
FontFamily(Uri?, string)
Initializes a new instance of the FontFamily class.
public FontFamily(Uri? baseUri, string name)
Parameters
baseUri
UriSpecifies the base uri that is used to resolve font family assets.
name
stringThe name of the FontFamily.
Exceptions
- ArgumentException
Base uri must be an absolute uri.
Fields
DefaultFontFamilyName
public const string DefaultFontFamilyName = "$Default"
Field Value
Properties
Default
Represents the default font family
public static FontFamily Default { get; }
Property Value
FamilyNames
Gets the family names.
public FamilyNameCollection FamilyNames { get; }
Property Value
- FamilyNameCollection
The family familyNames.
FamilyTypefaces
Gets the typefaces for this font family.
public IReadOnlyList<Typeface> FamilyTypefaces { get; }
Property Value
Key
Gets the key for associated assets.
public FontFamilyKey? Key { get; }
Property Value
- FontFamilyKey
The family key.
Remarks
Key is only used for custom fonts.
Name
Gets the primary family name of the font family.
public string Name { get; }
Property Value
- string
The primary name of the font family.
Methods
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Parse(string)
Parses a FontFamily string.
public static FontFamily Parse(string s)
Parameters
s
stringThe FontFamily string.
Returns
Exceptions
- ArgumentException
Specified family is not supported.
Parse(string, Uri?)
Parses a FontFamily string.
public static FontFamily Parse(string s, Uri? baseUri)
Parameters
s
stringThe FontFamily string.
baseUri
UriSpecifies the base uri that is used to resolve font family assets.
Returns
Exceptions
- ArgumentException
Specified family is not supported.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
Operators
operator ==(FontFamily?, FontFamily?)
public static bool operator ==(FontFamily? a, FontFamily? b)
Parameters
a
FontFamilyb
FontFamily
Returns
implicit operator FontFamily(string)
Implicit conversion of string to FontFamily
public static implicit operator FontFamily(string s)
Parameters
s
string
Returns
operator !=(FontFamily?, FontFamily?)
public static bool operator !=(FontFamily? a, FontFamily? b)
Parameters
a
FontFamilyb
FontFamily