Merge pull request #842 from adroitwhiz/bitmap-convert-font-fix

When converting to bitmap, call inlineSvgFonts() on SVG string instead of SVG element
This commit is contained in:
Paul Kaplan 2019-05-23 14:26:08 -04:00 committed by GitHub
commit 7ead677426
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -379,8 +379,9 @@ const convertToBitmap = function (clearSelectedItems, onUpdateImage) {
// Get rid of anti-aliasing
// @todo get crisp text https://github.com/LLK/scratch-paint/issues/508
svg.setAttribute('shape-rendering', 'crispEdges');
inlineSvgFonts(svg);
const svgString = (new XMLSerializer()).serializeToString(svg);
let svgString = (new XMLSerializer()).serializeToString(svg);
svgString = inlineSvgFonts(svgString);
// Put anti-aliased SVG into image, and dump image back into canvas
const img = new Image();