Skip to content

FontRegistry

Defined in: src/core/font/font-registry.ts:54

A registry of parsed font variants. The renderer resolves a (bold, italic) request to the closest available face via pickVariant, degrading through bold → italic → regular when an exact match is missing.

entries(): IterableIterator<[FontVariant, ParsedTtf]>

Defined in: src/core/font/font-registry.ts:88

Iterate the [variant, parsed font] pairs the registry holds.

IterableIterator<[FontVariant, ParsedTtf]>


hasVariant(v): boolean

Defined in: src/core/font/font-registry.ts:93

Whether a given variant is present.

FontVariant

boolean


resolveByStyle(bold, italic): object

Defined in: src/core/font/font-registry.ts:80

Resolve a style request to the closest available face.

boolean

Whether bold was requested.

boolean

Whether italic was requested.

object

The chosen variant and its parsed font.

parsed: ParsedTtf

variant: FontVariant

Error when the registry has no usable (regular) font.


static fromBytes(input): FontRegistry

Defined in: src/core/font/font-registry.ts:63

Parse a set of font bytes into a registry.

FontBytesByVariant

The bytes per variant (regular required).

FontRegistry

A registry holding the parsed faces.