Skip to content

Interface: FontProvider

@fastlabai/design-editor


@fastlabai/design-editor / FontProvider

Defined in: providers/fonts.ts:15

Plug in your own font source. The editor calls list to populate the font picker, load when the user selects a font, upload to add a custom font from a file, and onChange to subscribe to updates (e.g. after an upload).

list(): Promise<FontDescriptor[]>

Defined in: providers/fonts.ts:17

Return the full list of available fonts.

Promise<FontDescriptor[]>


load(family): Promise<void>

Defined in: providers/fonts.ts:19

Load a font family so it can be rendered on canvas.

string

Promise<void>


optional onChange(handler): () => void

Defined in: providers/fonts.ts:23

Subscribe to changes (e.g. new uploads). Returns an unsubscribe function.

FontChangeHandler

() => void


upload(file): Promise<FontDescriptor>

Defined in: providers/fonts.ts:21

Upload a font file and register it as a custom font.

File

Promise<FontDescriptor>