Table of Contents

Interface IReadOnlyFontCollection

Namespace
SixLabors.Fonts
Assembly
SixLabors.Fonts.dll

Represents a readonly collection of fonts.

public interface IReadOnlyFontCollection

Properties

Families

Gets the collection of FontFamily in this IReadOnlyFontCollection using the invariant culture.

IEnumerable<FontFamily> Families { get; }

Property Value

IEnumerable<FontFamily>

Methods

Get(string)

Gets the specified font family matching the invariant culture and font family name.

FontFamily Get(string name)

Parameters

name string

The font family name.

Returns

FontFamily

The first FontFamily matching the given name.

Exceptions

ArgumentNullException

name is null

FontFamilyNotFoundException

The collection contains no matches.

GetByCulture(CultureInfo)

Gets the collection of FontFamily in this FontCollection using the given culture.

IEnumerable<FontFamily> GetByCulture(CultureInfo culture)

Parameters

culture CultureInfo

The culture of the families to return.

Returns

IEnumerable<FontFamily>

The IEnumerable<T>.

GetByCulture(string, CultureInfo)

Gets the specified font family matching the given culture and font family name.

FontFamily GetByCulture(string name, CultureInfo culture)

Parameters

name string

The font family name.

culture CultureInfo

The culture to use when searching for a match.

Returns

FontFamily

The first FontFamily matching the given name.

Exceptions

ArgumentNullException

name is null

FontFamilyNotFoundException

The collection contains no matches.

TryGet(string, out FontFamily)

Gets the specified font family matching the invariant culture and font family name.

bool TryGet(string name, out FontFamily family)

Parameters

name string

The font family name.

family FontFamily

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

bool

true if the IReadOnlyFontCollection contains a family with the specified name; otherwise, false.

Exceptions

ArgumentNullException

name is null

TryGetByCulture(string, CultureInfo, out FontFamily)

Gets the specified font family matching the given culture and font family name.

bool TryGetByCulture(string name, CultureInfo culture, out FontFamily family)

Parameters

name string

The font family name.

culture CultureInfo

The culture to use when searching for a match.

family FontFamily

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

bool

true if the IReadOnlyFontCollection contains a family with the specified name; otherwise, false.

Exceptions

ArgumentNullException

name is null