Closed webpig closed 1 year ago
👋 @webpig
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
@webpig
In order to communicate effectively, we have a certain format requirement for the issue, your issue is automatically closed because there is no recurring step or reproducible warehouse, and will be REOPEN after the offer.
You can use embedFontCss to skip parsing the element for font rules.
const fontCss = `@font-face {font-family: "DegularDisplayDemo-Bold.otf"; src: url("http://localhost:3000/get-font/DegularDisplayDemo-Light.otf") format("opentype"}`;
toPng(node, {
fontEmbedCSS: fontCss,
}).then(...
You can use embedFontCss to skip parsing the element for font rules.
const fontCss = `@font-face {font-family: "DegularDisplayDemo-Bold.otf"; src: url("http://localhost:3000/get-font/DegularDisplayDemo-Light.otf") format("opentype"}`; toPng(node, { fontEmbedCSS: fontCss, }).then(...
Thanks, I tried this way before, but I have two fonts: bold and regular, and one didn't render properly. I don't know what to do.
Yes, I'm having a lot of issues with fonts not rendering. Does that method work for one font, if so what format is it in?
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.
By default, html-to-image will load all fonts, it's too slow. I want to load a font. How to achieve?