Struct FontFamily
Defines a group of type faces having a similar basic design and certain variations in styles.
Implements
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public struct FontFamily
Properties
| Improve this Doc 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
| Improve this Doc View SourceCreateFont(Single)
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 |
---|---|---|
Single | size | The size of the font in PT units. |
Returns
Type | Description |
---|---|
Font | The new Font. |
CreateFont(Single, 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 |
---|---|---|
Single | size | The size of the font in PT units. |
FontStyle | style | The font style. |
Returns
Type | Description |
---|---|
Font | The new Font. |
Equals(FontFamily)
Declaration
public readonly bool Equals(FontFamily other)
Parameters
Type | Name | Description |
---|---|---|
FontFamily | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Nullable<Object>)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Object> | obj |
Returns
Type | Description |
---|---|
Boolean |
GetAvailableStyles()
Gets the collection of FontStyle that are currently available.
Declaration
public readonly IEnumerable<FontStyle> GetAvailableStyles()
Returns
Type | Description |
---|---|
IEnumerable<FontStyle> | The |
GetHashCode()
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
ToString()
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
String |
TryGetMetrics(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 |
---|---|
Boolean | 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 |
---|---|
Boolean | true if the FontFamily was created via filesystem paths; otherwise, false. |
Operators
| Improve this Doc View SourceEquality(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 |
---|---|
Boolean | true if the current left is equal to the |
Inequality(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 |
---|---|
Boolean | true if the current left is unequal to the |