Table of Contents

Class FontDescription

Namespace
SixLabors.Fonts
Assembly
SixLabors.Fonts.dll

Provides basic descriptive metadata for the font.

public class FontDescription
Inheritance
FontDescription
Inherited Members

Properties

FontFamilyInvariantCulture

Gets the name of the font family in the invariant culture.

public string FontFamilyInvariantCulture { get; }

Property Value

string

FontNameInvariantCulture

Gets the name of the font in the invariant culture.

public string FontNameInvariantCulture { get; }

Property Value

string

FontSubFamilyNameInvariantCulture

Gets the font sub family in the invariant culture.

public string FontSubFamilyNameInvariantCulture { get; }

Property Value

string

Style

Gets the style.

public FontStyle Style { get; }

Property Value

FontStyle

Methods

FontFamily(CultureInfo)

Gets the name of the font family.

public string FontFamily(CultureInfo culture)

Parameters

culture CultureInfo

The culture to load metadata in.

Returns

string

The font family name.

FontName(CultureInfo)

Gets the name of the font.

public string FontName(CultureInfo culture)

Parameters

culture CultureInfo

The culture to load metadata in.

Returns

string

The font name.

FontSubFamilyName(CultureInfo)

Gets the font sub family.

public string FontSubFamilyName(CultureInfo culture)

Parameters

culture CultureInfo

The culture to load metadata in.

Returns

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.

public string GetNameById(CultureInfo culture, KnownNameIds nameId)

Parameters

culture CultureInfo

The culture to load metadata in.

nameId KnownNameIds

The name id to match.

Returns

string

The string name.

LoadDescription(Stream)

Reads a FontDescription from the specified stream.

public static FontDescription LoadDescription(Stream stream)

Parameters

stream Stream

The stream.

Returns

FontDescription

a FontDescription.

LoadDescription(string)

Reads a FontDescription from the specified stream.

public static FontDescription LoadDescription(string path)

Parameters

path string

The file path.

Returns

FontDescription

a FontDescription.

LoadFontCollectionDescriptions(Stream)

Reads all the FontDescriptions from the specified stream (typically a .ttc file like simsun.ttc).

public static ReadOnlyMemory<FontDescription> LoadFontCollectionDescriptions(Stream stream)

Parameters

stream Stream

The stream to read the font collection from.

Returns

ReadOnlyMemory<FontDescription>

A read-only memory region containing the font descriptions.

LoadFontCollectionDescriptions(string)

Reads all the FontDescriptions from the file at the specified path (typically a .ttc file like simsun.ttc).

public static ReadOnlyMemory<FontDescription> LoadFontCollectionDescriptions(string path)

Parameters

path string

The file path.

Returns

ReadOnlyMemory<FontDescription>

A read-only memory region containing the font descriptions.