effect-motion
API Referenceeffect-motionNamespacesFontFunctions

layer

function layer<ID, E, R>(

Function: layer()

function layer<ID, E, R>(
   font,
   load,
options?): Layer<FontLoader<ID>, E, R>;

Defined in: packages/motion/src/Font.ts:114

Provide a font's bytes. The load effect runs ONCE, at layer construction (runtime build) — never at frame time; compose retries/timeouts on the load effect itself. Every provided font loads regardless of whether the scene ends up using it (preload-all-provided policy).

Type Parameters

Type Parameter
ID extends string
E
R

Parameters

ParameterType
fontFontResource<ID>
loadEffect<Uint8Array<ArrayBufferLike>, E, R>
options?{ format?: "ttf" | "otf"; }
options.format?"ttf" | "otf"

Returns

Layer<FontLoader<ID>, E, R>

On this page