-
I'm using But now i have a part where i need to load the saved project and generate a So is it possible to load those fonts in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You need to use canvas.registerFont to load all the fonts first and then init your canvas on nodejs and generate base64 image. But registerFont uses file path directory to load the fonts, if your fonts are google fonts or ttf/otf files saved somewhere, you need to download all the files first and save it locally and then use registerFont, after that when you have generated base64 image delete all those fonts saved locally by calling fs.unlinkSync(filePath);
|
Beta Was this translation helpful? Give feedback.
You need to use canvas.registerFont to load all the fonts first and then init your canvas on nodejs and generate base64 image.
But registerFont uses file path directory to load the fonts, if your fonts are google fonts or ttf/otf files saved somewhere, you need to download all the files first and save it locally and then use registerFont, after that when you have generated base64 image delete all those fonts saved locally by calling fs.unlinkSync(filePath);