API reference
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddNativeElementaddPagecreateRichtextRangeeditContentgetCurrentPageContextgetDefaultPageDimensionsgetDesignTokeninitAppElementopenDesignoverlay.registerOnCanOpenrequestExportselection.registerOnChangesetCurrentPageBackgroundui.startDragToCursorui.startDragToPointui.startDrag
Intents: data
Intents: design
Platform
appProcessappProcess.broadcastMessageappProcess.currentappProcess.current.getInfoappProcess.current.requestCloseappProcess.current.setOnDisposeappProcess.requestCloseappProcess.registerOnMessageappProcess.registerOnStateChangefeatures.isSupportedfeatures.registerOnSupportChangegetPlatformInfonotification.addToastrequestOpenExternalUrl
findFonts
API reference for the findFonts method.
Retrieves a list of fonts.
Only a subset of Canva's fonts are returned.
Usage
Get a list of all available fonts
import { findFonts } from "@canva/asset";const response = await findFonts();
TYPESCRIPT
Get a specific font
import { type FontRef, findFonts } from "@canva/asset";const placeholderFontRef = "PLACEHOLDER_FONT_REF" as FontRef;const response = await findFonts({fontRefs: [placeholderFontRef]});
TYPESCRIPT
Get multiple specific fonts
import { type FontRef, findFonts } from "@canva/asset";const placeholderFontRef1 = "PLACEHOLDER_FONT_REF" as FontRef;const placeholderFontRef2 = "PLACEHOLDER_FONT_REF" as FontRef;const response = await findFonts({fontRefs: [placeholderFontRef1, placeholderFontRef2]});
TYPESCRIPT
Parameters
options
FindFontsOptions
Optional
Options for retrieving a list of fonts.
fontRefs
FontRef[]
Optional
The refs of the fonts to retrieve.
Returns
The result of retrieving a list of fonts. This is a Promise
that resolves with the following object:
fonts
Font[]
The retrieved fonts.
ref
FontRef
A unique identifier that points to a font asset in Canva's backend.
name
string
The name of the font.
weights
FontWeight[]
The available font weights for the font.
weight
FontWeightName
The name of the font weight.
Available values:
"normal"
"thin"
"extralight"
"light"
"medium"
"semibold"
"bold"
"ultrabold"
"heavy"
styles
FontStyle[]
The font styles available for this specific font weight.
Available values:
"normal"
"italic"
previewUrl
string
Optional
The URL of an image that renders a preview of the font.