Interface IReadOnlyFontCollection
Represents a readonly collection of fonts.
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public interface IReadOnlyFontCollection
Properties
| Improve this Doc View SourceFamilies
Gets the collection of FontFamily in this IReadOnlyFontCollection using the invariant culture.
Declaration
IEnumerable<FontFamily> Families { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<FontFamily> |
Methods
| Improve this Doc View SourceGet(String)
Gets the specified font family matching the invariant culture and font family name.
Declaration
FontFamily Get(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The font family name. |
Returns
| Type | Description |
|---|---|
| FontFamily | The first FontFamily matching the given name. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| FontFamilyNotFoundException | The collection contains no matches. |
Get(String, CultureInfo)
Gets the specified font family matching the given culture and font family name.
Declaration
FontFamily Get(string name, CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The font family name. |
| CultureInfo | culture | The culture to use when searching for a match. |
Returns
| Type | Description |
|---|---|
| FontFamily | The first FontFamily matching the given name. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| FontFamilyNotFoundException | The collection contains no matches. |
GetByCulture(CultureInfo)
Gets the collection of FontFamily in this FontCollection using the given culture.
Declaration
IEnumerable<FontFamily> GetByCulture(CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureInfo | culture | The culture of the families to return. |
Returns
| Type | Description |
|---|---|
| IEnumerable<FontFamily> | The IEnumerable<T>. |
TryGet(String, out FontFamily)
Gets the specified font family matching the invariant culture and font family name.
Declaration
bool TryGet(string name, out FontFamily family)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The font family name. |
| FontFamily | family | When this method returns, contains the family associated with the specified name, if the name is found; otherwise, the default value for the type of the family parameter. This parameter is passed uninitialized. |
Returns
| Type | Description |
|---|---|
| Boolean | true if the IReadOnlyFontCollection contains a family with the specified name; otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
TryGet(String, CultureInfo, out FontFamily)
Gets the specified font family matching the given culture and font family name.
Declaration
bool TryGet(string name, CultureInfo culture, out FontFamily family)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The font family name. |
| CultureInfo | culture | The culture to use when searching for a match. |
| FontFamily | family | When this method returns, contains the family associated with the specified name, if the name is found; otherwise, the default value for the type of the family parameter. This parameter is passed uninitialized. |
Returns
| Type | Description |
|---|---|
| Boolean | true if the IReadOnlyFontCollection contains a family with the specified name; otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|