Struct FontFamily
Defines a group of type faces having a similar basic design and certain variations in styles.
Implements
Inherited Members
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public struct FontFamily : IEquatable<FontFamily>
Properties
| Edit this page View SourceCulture
Gets the culture this instance was extracted against.
Declaration
public readonly CultureInfo Culture { get; }
Property Value
Type | Description |
---|---|
CultureInfo |
Name
Gets the name.
Declaration
public readonly string Name { get; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceCreateFont(float)
Create a new instance of the Font for the named font family with regular styling.
Declaration
public readonly Font CreateFont(float size)
Parameters
Type | Name | Description |
---|---|---|
float | size | The size of the font in PT units. |
Returns
Type | Description |
---|---|
Font | The new Font. |
CreateFont(float, FontStyle)
Create a new instance of the Font for the named font family.
Declaration
public readonly Font CreateFont(float size, FontStyle style)
Parameters
Type | Name | Description |
---|---|---|
float | size | The size of the font in PT units. |
FontStyle | style | The font style. |
Returns
Type | Description |
---|---|
Font | The new Font. |
Equals(FontFamily)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(FontFamily other)
Parameters
Type | Name | Description |
---|---|---|
FontFamily | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
| Edit this page View SourceGetAvailableStyles()
Gets the collection of FontStyle that are currently available.
Declaration
public readonly IEnumerable<FontStyle> GetAvailableStyles()
Returns
Type | Description |
---|---|
IEnumerable<FontStyle> | The IEnumerable<T>. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceToString()
Returns the fully qualified type name of this instance.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
| Edit this page View SourceTryGetMetrics(FontStyle, out FontMetrics?)
Gets the specified font metrics matching the given font style.
Declaration
public readonly bool TryGetMetrics(FontStyle style, out FontMetrics? metrics)
Parameters
Type | Name | Description |
---|---|---|
FontStyle | style | The font style to use when searching for a match. |
FontMetrics | metrics | When 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
Type | Description |
---|---|
bool | true if the FontFamily contains font metrics with the specified name; otherwise, false. |
TryGetPaths(out IEnumerable<string>)
Gets the collection of filesystem paths to the font family sources.
Declaration
public bool TryGetPaths(out IEnumerable<string> paths)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | paths | When this method returns, contains the filesystem paths to the font family sources, if the path exists; otherwise, an empty value for the type of the paths parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
bool | true if the FontFamily was created via filesystem paths; otherwise, false. |
Operators
| Edit this page View Sourceoperator ==(FontFamily, FontFamily)
Compares two FontFamily objects for equality.
Declaration
public static bool operator ==(FontFamily left, FontFamily right)
Parameters
Type | Name | Description |
---|---|---|
FontFamily | left | The FontFamily on the left side of the operand. |
FontFamily | right | The FontFamily on the right side of the operand. |
Returns
Type | Description |
---|---|
bool | true if the current left is equal to the |
operator !=(FontFamily, FontFamily)
Compares two FontFamily objects for inequality.
Declaration
public static bool operator !=(FontFamily left, FontFamily right)
Parameters
Type | Name | Description |
---|---|---|
FontFamily | left | The FontFamily on the left side of the operand. |
FontFamily | right | The FontFamily on the right side of the operand. |
Returns
Type | Description |
---|---|
bool | true if the current left is unequal to the |