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
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
Retrieves own fonts.
const RenderforestClient = require('@renderforest/sdk-node')
const Renderforest = new RenderforestClient({ signKey: '<signKey>', clientId: -1 })
Renderforest.getOwnFonts()
.then(console.log) // handle the success
.catch(console.error) // handle the error
getOwnFonts
function returns an object containing own fonts.
In contrast with template fonts, own font object contains path parameter which is the url of the font file.
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.