Load Custom Fonts


(name:
Description: Load custom fonts (only for React Native implementation). The return value specifies the name to access the font with, which might be different from the name you sent.

Request Parameters

Parameter Name

Type

Description

name

string

Name of the font you would like to keep

base64FontString

string

Base 64 encoded font file

type

string

Only 'ttf' supported for now

Returns:
Promise
Resolves with the name of the font to be used. This might be different than the name sent earlier in the method parameters.
Rejects if there was an issue in adding the font.

Usage:

sdk.loadFont('name', value, 'ttf').then((nameOfTheFont) => {
  console.log('Name received = ' + nameOfTheFont)
}).catch((err) => {
  console.log('Error received = ' + err)
})