Interface: FontProvider
@fastlabai/design-editor / FontProvider
Interface: FontProvider
Section titled “Interface: 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).
Methods
Section titled “Methods”list()
Section titled “list()”list():
Promise<FontDescriptor[]>
Defined in: providers/fonts.ts:17
Return the full list of available fonts.
Returns
Section titled “Returns”Promise<FontDescriptor[]>
load()
Section titled “load()”load(
family):Promise<void>
Defined in: providers/fonts.ts:19
Load a font family so it can be rendered on canvas.
Parameters
Section titled “Parameters”family
Section titled “family”string
Returns
Section titled “Returns”Promise<void>
onChange()?
Section titled “onChange()?”
optionalonChange(handler): () =>void
Defined in: providers/fonts.ts:23
Subscribe to changes (e.g. new uploads). Returns an unsubscribe function.
Parameters
Section titled “Parameters”handler
Section titled “handler”Returns
Section titled “Returns”() => void
upload()
Section titled “upload()”upload(
file):Promise<FontDescriptor>
Defined in: providers/fonts.ts:21
Upload a font file and register it as a custom font.
Parameters
Section titled “Parameters”File
Returns
Section titled “Returns”Promise<FontDescriptor>