FontResourceLimits Class

The limits that bound the work of the font code on untrusted input: the bytes read and kept, the work of decoding a glyph and the glyphs of a shaped text. Exceeding a limit throws a FontResourceLimitException.

public sealed class FontResourceLimits

Constructors

NameDescription
FontResourceLimits()

FontResourceLimits()

FontResourceLimits.cs
public FontResourceLimits()

No documentation is available.

Properties

NameDescription
DefaultGets the default limits.
MaxCollectionFacesGets the maximum number of faces of a font collection. Each face is read when the collection is loaded.
MaxEncodedBytesGets the maximum number of bytes read from a font file.
MaxFontBytesGets the maximum number of bytes a font keeps in memory, after a compressed container is expanded.
MaxGlyphComplexityGets the maximum number of elementary operations (outline points, components, operators) to produce one glyph.
MaxTextGlyphsGets the maximum number of glyphs of a shaped text.

Gets the default limits.

public static FontResourceLimits Default { get; }

Property value

FontResourceLimits

MaxCollectionFaces

FontResourceLimits.cs

Gets the maximum number of faces of a font collection. Each face is read when the collection is loaded.

public int MaxCollectionFaces { get; init; }

Property value

int

MaxEncodedBytes

FontResourceLimits.cs

Gets the maximum number of bytes read from a font file.

public long MaxEncodedBytes { get; init; }

Property value

long

Gets the maximum number of bytes a font keeps in memory, after a compressed container is expanded.

public long MaxFontBytes { get; init; }

Property value

long

MaxGlyphComplexity

FontResourceLimits.cs

Gets the maximum number of elementary operations (outline points, components, operators) to produce one glyph.

public long MaxGlyphComplexity { get; init; }

Property value

long

Gets the maximum number of glyphs of a shaped text.

public long MaxTextGlyphs { get; init; }

Property value

long

Constants

NameDescription
DefaultMaxCollectionFacesThe default maximum number of faces of a font collection (1,024).
DefaultMaxEncodedBytesThe default maximum number of bytes read from a font file (256 MiB).
DefaultMaxFontBytesThe default maximum number of bytes a font keeps in memory (256 MiB).
DefaultMaxGlyphComplexityThe default maximum number of elementary operations to produce one glyph (1,000,000).
DefaultMaxTextGlyphsThe default maximum number of glyphs of a shaped text (1,000,000).

DefaultMaxCollectionFaces

The default maximum number of faces of a font collection (1,024).

public const int DefaultMaxCollectionFaces = 1024

DefaultMaxEncodedBytes

The default maximum number of bytes read from a font file (256 MiB).

public const long DefaultMaxEncodedBytes = 268435456L

DefaultMaxFontBytes

The default maximum number of bytes a font keeps in memory (256 MiB).

public const long DefaultMaxFontBytes = 268435456L

DefaultMaxGlyphComplexity

The default maximum number of elementary operations to produce one glyph (1,000,000).

public const long DefaultMaxGlyphComplexity = 1000000L

DefaultMaxTextGlyphs

The default maximum number of glyphs of a shaped text (1,000,000).

public const long DefaultMaxTextGlyphs = 1000000L