On September 25th, 2024, we released v2 of the Apps SDK. To learn what’s new and how to upgrade, see Migration FAQ and Migration guide.

requestFontSelection

API reference for the requestFontSelection method.
This version of the API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.

Prompts the user to choose a font that can be used within Canva.

Parameters

requestFontSelectionRequestOptional

Options for configuring a font picker.

selectedFontRefFontRefOptional

The ref of a font to display as selected when the font picker is opened.

Returns

The result of selecting a font from a font picker. This is a Promise that resolves with the following object:

typestring

The type of result.

This must be "completed".

fontFont

The selected font.

refFontRef

A unique identifier that points to a font asset in Canva's backend.

namestring

The name of the font.

weightsFontWeight[]

The available font weights for the font.

weightFontWeightName

The name of the font weight.

Available values:

  • "normal"
  • "thin"
  • "extralight"
  • "light"
  • "medium"
  • "semibold"
  • "bold"
  • "ultrabold"
  • "heavy"
stylesFontStyle[]

The font styles available for this specific font weight.

Available values:

  • "normal"
  • "italic"
previewUrlstringOptional

The URL of an image that renders a preview of the font.

typestring

The type of result.

This must be "aborted".