Skip to content

Files

Latest commit

 

History

History
34 lines (22 loc) · 1.11 KB

FONTS.md

File metadata and controls

34 lines (22 loc) · 1.11 KB

Fonts API

Get template available fonts

Retrieves template available fonts.

const RenderforestClient = require('@renderforest/sdk-node')

const Renderforest = new RenderforestClient({ signKey: '<signKey>', clientId: -1 })

Renderforest.getTemplateAvailableFonts(1021)
  .then(console.log) // handle the success
  .catch(console.error) // handle the error

See example

getTemplateAvailabeFonts function returns an object containing all fonts. The returned object has getFontById method which accepts fontId parameter. getFontId method returns flattened font.

Be careful: setFonts() project data instance setter accepts only flattened font.

const primaryFont = fonts.getFontById(256) // returns flatten font with tuned character size

Now the flatten font can be used as parameter for setFonts setter in project data instance.

See setFonts() setter in project data

⬆ back to the top