node-html-to-image
node-html-to-image copied to clipboard
@font-face font not working
The font not loading my code
js: let image = await nhti({ ... content: { font1: data:font/truetype;base64,${new Buffer.from(fs.readFileSync("Magmawave-Caps.ttf")).toString("base64")} }, ... });
html: @font-face { font-family: Magmawave; src: url({{font1}}) format('truetype'); }
i tryed truetype & woff & woff2 formats and still not working
& i tryed to do that @font-face { font-family: Magmawave; src: url(data:font/truetype;base64,<myBuffer>) format('truetype'); } and still not working
Hello @Mohammed523 👋
Thank you for opening this pull request 🙏 . In the README there is a guide which explains how to deal with fonts. I see that you did something different. Can you try the approach explained in the README and tell me if it fixes your issue, please?
Without any new answer I close this issue. Feels free to reopen it 👍