Back to API Reference
Class

FontFeatureRegistry

static

Process-wide registry mapping OpenType feature sets to compact byte ids suitable for per-codepoint attribute storage, and back to the settings the shaper needs.

Remarks

The registry is additive: once a set is registered its id stays stable for the lifetime of the process, which is what lets shaping caches key on the id alone. Id 0 is reserved for "no features". A set is canonical — sorted by tag, one entry per tag — so equal sets always share an id, and the registry holds at most 255 of them. Get is lock-free and safe on shaping worker threads; registration is not and belongs to the apply phase.
public static byte Register()

Registers the set written as a comma-separated list of settings — kern 0, -kern, +dlig, ss01 2 — and returns its id. Unparseable settings are skipped; a specification that yields none, or a full registry, returns Unset.

public static byte Register()

Registers a set built in code and returns its id, Unset when the set is empty or the registry is full. Later duplicates of a tag win.

public static byte Combine()

Returns the id of the union of two sets, where second wins a tag both carry. Either side being Unset returns the other.

public static ReadOnlySpan<FontFeature> Get()

Returns the settings of a registered id, empty for Unset or an unknown id.

public static const byte Unset

Id reserved for "no features". Get returns an empty set for it.