Skip font inlining in whiteboard SVG export
Build and push server image / build-and-push (push) Successful in 2m6s
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:
@@ -96,6 +96,13 @@ app.post('/render', async (req, res) => {
|
|||||||
appState: appState || {},
|
appState: appState || {},
|
||||||
files: files || {},
|
files: files || {},
|
||||||
exportPadding: 20,
|
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
|
// Depending on the installed version, exportToSvg resolves to either
|
||||||
// an SVGSVGElement (needs serializing) or already a string -- handle
|
// an SVGSVGElement (needs serializing) or already a string -- handle
|
||||||
|
|||||||
Reference in New Issue
Block a user