node-html-to-image icon indicating copy to clipboard operation
node-html-to-image copied to clipboard

@font-face font not working

Open ghost opened this issue 4 years ago • 1 comments
trafficstars

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

ghost avatar Oct 23 '21 10:10 ghost

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?

frinyvonnick avatar Feb 08 '22 14:02 frinyvonnick

Without any new answer I close this issue. Feels free to reopen it 👍

frinyvonnick avatar Aug 05 '23 09:08 frinyvonnick