GlyphBudget Struct

Counts the elementary operations spent to produce one glyph (outline points, components, operators), against FontResourceLimits.MaxGlyphComplexity.

public struct GlyphBudget

Remarks

A font is untrusted input: composite glyphs that refer to each other, or subroutines that call each other, can describe an outline whose size is exponential in the size of the file. One counter bounds them all.

Constructors

NameDescription
GlyphBudget(FontResourceLimits)Initializes a new budget for a glyph.

GlyphBudget(FontResourceLimits)

GlyphBudget.cs

Initializes a new budget for a glyph.

public GlyphBudget(FontResourceLimits limits)

Parameters

limits FontResourceLimits
The limits whose FontResourceLimits.MaxGlyphComplexity bounds the operations.

Methods

NameDescription
Charge(long)Spends operations.

Charge(long)

GlyphBudget.cs

Spends operations.

public void Charge(long count)

Parameters

count long

Exceptions

FontResourceLimitException
The glyph exceeds the limit.