Struct FontFamily
Defines a group of type faces having a similar basic design and certain variations in styles.
public struct FontFamily : IEquatable<FontFamily>
- Implements
- Inherited Members
Properties
Culture
Gets the culture this instance was extracted against.
public readonly CultureInfo Culture { get; }
Property Value
Name
Gets the name.
public readonly string Name { get; }
Property Value
Methods
CreateFont(float)
Create a new instance of the Font for the named font family with regular styling.
public readonly Font CreateFont(float size)
Parameters
sizefloatThe size of the font in PT units.
Returns
CreateFont(float, FontStyle)
Create a new instance of the Font for the named font family.
public readonly Font CreateFont(float size, FontStyle style)
Parameters
Returns
CreateFont(float, FontStyle, params FontVariation[])
Create a new instance of the Font for the named font family with the specified style and variation axis settings.
public readonly Font CreateFont(float size, FontStyle style, params FontVariation[] variations)
Parameters
sizefloatThe size of the font in PT units.
styleFontStyleThe font style.
variationsFontVariation[]The variation axis settings to apply.
Returns
CreateFont(float, params FontVariation[])
Create a new instance of the Font for the named font family with regular styling and the specified variation axis settings.
public readonly Font CreateFont(float size, params FontVariation[] variations)
Parameters
sizefloatThe size of the font in PT units.
variationsFontVariation[]The variation axis settings to apply.
Returns
Equals(FontFamily)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(FontFamily other)
Parameters
otherFontFamilyAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetAvailableStyles()
Gets the collection of FontStyle that are currently available.
public readonly ReadOnlyMemory<FontStyle> GetAvailableStyles()
Returns
- ReadOnlyMemory<FontStyle>
A read-only memory region containing the available font styles.
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()
Returns
- string
The fully qualified type name.
TryGetMetrics(FontStyle, out FontMetrics?)
Gets the specified font metrics matching the given font style.
public readonly bool TryGetMetrics(FontStyle style, out FontMetrics? metrics)
Parameters
styleFontStyleThe font style to use when searching for a match.
metricsFontMetricsWhen this method returns, contains the metrics associated with the specified name, if the name is found; otherwise, the default value for the type of the metrics parameter. This parameter is passed uninitialized.
Returns
- bool
true if the FontFamily contains font metrics with the specified name; otherwise, false.
TryGetPaths(out ReadOnlyMemory<string>)
Gets the collection of filesystem paths to the font family sources.
public bool TryGetPaths(out ReadOnlyMemory<string> paths)
Parameters
pathsReadOnlyMemory<string>When this method returns, contains the filesystem paths to the font family sources, if the path exists; otherwise, an empty memory region. This parameter is passed uninitialized.
Returns
- bool
true if the FontFamily was created via filesystem paths; otherwise, false.
Operators
operator ==(FontFamily, FontFamily)
Compares two FontFamily objects for equality.
public static bool operator ==(FontFamily left, FontFamily right)
Parameters
leftFontFamilyThe FontFamily on the left side of the operand.
rightFontFamilyThe FontFamily on the right side of the operand.
Returns
operator !=(FontFamily, FontFamily)
Compares two FontFamily objects for inequality.
public static bool operator !=(FontFamily left, FontFamily right)
Parameters
leftFontFamilyThe FontFamily on the left side of the operand.
rightFontFamilyThe FontFamily on the right side of the operand.