Using external fonts with Kaleido to generate static image files?

Hi, I am using Kaleido to render SVG files and wonder how to add external fonts to the figures.

The syntax used is:

plotly.io.to_image(fig_json, format=“svg”, engine=“kaleido”)

Here fig_json contains the font name e.g. “ExternalFont”, for which the css and font files (woff et al) are available.

As tested, the external fonts work well with normal dash apps on the web, but there seems no way to let Kaleido pick up them and add to the offline rendered SVGs. The rendered SVG files ended up using the default font e.g. Arial. Would like to learn any idea here.

Thanks,

Josh

1 Like