open-design-sdk icon indicating copy to clipboard operation
open-design-sdk copied to clipboard

Font warnings displayed even when fonts are found

Open ted537 opened this issue 2 years ago • 0 comments

When running the following, where ./font/ has all the required custom fonts,

sdk.setGlobalFontDirectory('./font/');
// Import a Figma design
const design = await sdk.importFigmaDesign({
	figmaToken: FIGMA_TOKEN,
	figmaFileKey: FIGMA_FILE_KEY
})
design.setFontDirectory('./font/');
const artboard = design.getArtboards()[2]

// Render the artboard
await artboard.renderToFile(`rendered.png`)

The following warnings are printed to the console, even though the fonts are resolved and rendered correctly in the exported image.

  warn | Font not available: MontserratRoman-Bold
  warn | Font not available: MontserratRoman-Regular

Presumably, the warning is coming from design-facade.ts

This is of course, not a huge blocker on anything, but it would be nice if these false positives were cleaned up.

ted537 avatar Aug 04 '22 13:08 ted537