Skip to content

Commit

Permalink
merge-upstream: Fix custom fonts when converting svg to bitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jan 3, 2024
1 parent f42be99 commit a54a419
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/containers/paint-editor-wrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx';
import {openFontsModal} from '../reducers/modals';

import {connect} from 'react-redux';
import { isDark } from '../lib/themes/index.js';
import {isDark} from '../lib/themes/index.js';

class PaintEditorWrapper extends React.Component {
constructor (props) {
super(props);
bindAll(this, [
'handleUpdateImage',
'handleUpdateName',
'handleUpdateFonts'
'handleUpdateFonts',
'fontInlineFn'
]);
this.state = {
fonts: this.props.vm.runtime.fontManager.getFonts()
Expand Down Expand Up @@ -60,6 +61,9 @@ class PaintEditorWrapper extends React.Component {
2 /* bitmapResolution */);
}
}
fontInlineFn (svgString) {
return inlineSvgFonts(svgString, this.props.vm.renderer.customFonts);
}
render () {
if (!this.props.imageId) return null;
const {
Expand All @@ -74,7 +78,7 @@ class PaintEditorWrapper extends React.Component {
image={vm.getCostume(selectedCostumeIndex)}
onUpdateImage={this.handleUpdateImage}
onUpdateName={this.handleUpdateName}
fontInlineFn={inlineSvgFonts}
fontInlineFn={this.fontInlineFn}
theme={isDark(this.props.theme) ? 'dark' : 'light'}
customFonts={this.state.fonts}
width={this.props.customStageSize.width}
Expand Down

0 comments on commit a54a419

Please sign in to comment.