Skip font inlining in whiteboard SVG export
Build and push server image / build-and-push (push) Successful in 2m6s

exportToSvg's font-embedding path (base64 @font-face rules) goes through
the browser FontFace API, which jsdom doesn't implement -- that's what
crashed fontFacesStylesGenerator after the previous global-shimming fix
got past startup. skipInliningFonts avoids that path entirely; resvg
already falls back to system fonts for rasterizing regardless, so
embedded fonts were never going to affect the final PNG.
This commit is contained in:
2026-07-23 17:56:48 -04:00
parent dadd9ec164
commit 8556221b08
+7
View File
@@ -96,6 +96,13 @@ app.post('/render', async (req, res) => {
appState: appState || {},
files: files || {},
exportPadding: 20,
// Font embedding (base64 @font-face rules in the SVG's <defs>) goes
// through the browser's FontFace API, which jsdom doesn't implement
// and can't be meaningfully polyfilled here -- and we don't need
// it anyway: resvg (below) already falls back to whatever fonts
// fontconfig finds (see ../Dockerfile's fonts-dejavu-core), so
// embedded fonts were never going to make it into the final PNG.
skipInliningFonts: true,
});
// Depending on the installed version, exportToSvg resolves to either
// an SVGSVGElement (needs serializing) or already a string -- handle