renderToSvg and renderToPng call Satori with only width, height and fonts, so the rest of Satori's options aren't available.
My usecase is selectable text in SVGs. I'm using json-render in tsquare, which renders wireframes from text to SVG for docs and Notion. Satori's embedFont: false keeps text as <text> elements instead of outlines, so it can be selected and searched (for example, in a PDF). Today the only way to use it is to copy buildTree and call Satori directly.
The same pass-through would also cover non-Latin text and emoji. Satori draws a box for any character the given fonts don't cover, and its fix, loadAdditionalAsset (as in @vercel/og), can't be passed through either.
Would you accept either of these?
- An optional
satoriorsatoriOptionsfield in the options, spread into the Satori call:renderToSvg(spec, { fonts, satori: { embedFont: false } }) - Exporting
buildTree, so callers can run Satori themselves.
Happy to send a PR for whichever you prefer.
Activity
0No activity yet.