diff --git a/package.json b/package.json index bb140afc..ea66c9b4 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "regenerator-runtime": "^0.11.1", "rimraf": "^2.6.1", "scratch-l10n": "^2.0.0", + "scratch-svg-renderer": "0.1.0-prerelease.20180510171850", "style-loader": "^0.21.0", "svg-url-loader": "^2.3.2", "tap": "^11.1.0", diff --git a/src/containers/paper-canvas.jsx b/src/containers/paper-canvas.jsx index 7382d9d2..32cb5001 100644 --- a/src/containers/paper-canvas.jsx +++ b/src/containers/paper-canvas.jsx @@ -7,6 +7,8 @@ import Formats from '../lib/format'; import Modes from '../lib/modes'; import log from '../log/log'; +import {inlineSvgFonts} from 'scratch-svg-renderer'; + import {trim} from '../helper/bitmap'; import {performSnapshot} from '../helper/undo'; import {undoSnapshot, clearUndoState} from '../reducers/undo'; @@ -95,6 +97,7 @@ class PaperCanvas extends React.Component { // Get rid of anti-aliasing // @todo get crisp text? svg.setAttribute('shape-rendering', 'crispEdges'); + inlineSvgFonts(svg); const svgString = (new XMLSerializer()).serializeToString(svg); // Put anti-aliased SVG into image, and dump image back into canvas