Class FontDescription
Provides basic descriptive metadata for the font.
Inherited Members
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public class FontDescription
Properties
| Improve this Doc View SourceFontFamilyInvariantCulture
Gets the name of the font family in the invariant culture.
Declaration
public string FontFamilyInvariantCulture { get; }
Property Value
| Type | Description |
|---|---|
| String |
FontNameInvariantCulture
Gets the name of the font in the invariant culture.
Declaration
public string FontNameInvariantCulture { get; }
Property Value
| Type | Description |
|---|---|
| String |
FontSubFamilyNameInvariantCulture
Gets the font sub family in the invariant culture.
Declaration
public string FontSubFamilyNameInvariantCulture { get; }
Property Value
| Type | Description |
|---|---|
| String |
Style
Gets the style.
Declaration
public FontStyle Style { get; }
Property Value
| Type | Description |
|---|---|
| FontStyle |
Methods
| Improve this Doc View SourceFontFamily(CultureInfo)
Gets the name of the font family.
Declaration
public string FontFamily(CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureInfo | culture | The culture to load metadata in. |
Returns
| Type | Description |
|---|---|
| String | The font family name. |
FontName(CultureInfo)
Gets the name of the font.
Declaration
public string FontName(CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureInfo | culture | The culture to load metadata in. |
Returns
| Type | Description |
|---|---|
| String | The font name. |
FontSubFamilyName(CultureInfo)
Gets the font sub family.
Declaration
public string FontSubFamilyName(CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureInfo | culture | The culture to load metadata in. |
Returns
| Type | Description |
|---|---|
| String | The font sub family name. |
GetNameById(CultureInfo, KnownNameIds)
Gets the name matching the given culture and id. If InvariantCulture is passed this method will return the first name matching the id.
Declaration
public string GetNameById(CultureInfo culture, KnownNameIds nameId)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureInfo | culture | The culture to load metadata in. |
| KnownNameIds | nameId | The name id to match. |
Returns
| Type | Description |
|---|---|
| String | The String name. |
LoadDescription(Stream)
Reads a FontDescription from the specified stream.
Declaration
public static FontDescription LoadDescription(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream. |
Returns
| Type | Description |
|---|---|
| FontDescription |
LoadDescription(String)
Reads a FontDescription from the specified stream.
Declaration
public static FontDescription LoadDescription(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The file path. |
Returns
| Type | Description |
|---|---|
| FontDescription |
LoadFontCollectionDescriptions(Stream)
Reads all the FontDescriptions from the specified stream (typically a .ttc file like simsun.ttc).
Declaration
public static FontDescription[] LoadFontCollectionDescriptions(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to read the font collection from. |
Returns
| Type | Description |
|---|---|
| FontDescription[] |
LoadFontCollectionDescriptions(String)
Reads all the FontDescriptions from the file at the specified path (typically a .ttc file like simsun.ttc).
Declaration
public static FontDescription[] LoadFontCollectionDescriptions(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The file path. |
Returns
| Type | Description |
|---|---|
| FontDescription[] |