Class FontDescription
Provides basic descriptive metadata for the font.
Inherited Members
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public class FontDescription
Properties
| Edit this page 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
| Edit this page 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[] |