Fix Safari export not including custom fonts [#42]
This commit is contained in:
parent
326168b77d
commit
8344ab2a44
|
@ -5839,7 +5839,7 @@ define('sequence/Exporter',[],() => {
|
|||
document.body.appendChild(safariHackaround);
|
||||
}
|
||||
|
||||
img.addEventListener('load', () => {
|
||||
const render = () => {
|
||||
this.canvas.width = width;
|
||||
this.canvas.height = height;
|
||||
this.context.drawImage(img, 0, 0);
|
||||
|
@ -5847,6 +5847,15 @@ define('sequence/Exporter',[],() => {
|
|||
document.body.removeChild(safariHackaround);
|
||||
}
|
||||
this.canvas.toBlob(callback, 'image/png');
|
||||
};
|
||||
|
||||
img.addEventListener('load', () => {
|
||||
if(safariHackaround) {
|
||||
// Wait for custom fonts to load (Safari takes a moment)
|
||||
setTimeout(render, 50);
|
||||
} else {
|
||||
render();
|
||||
}
|
||||
}, {once: true});
|
||||
|
||||
img.src = this.getSVGURL(renderer, {width, height});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -80,7 +80,7 @@ define(() => {
|
|||
document.body.appendChild(safariHackaround);
|
||||
}
|
||||
|
||||
img.addEventListener('load', () => {
|
||||
const render = () => {
|
||||
this.canvas.width = width;
|
||||
this.canvas.height = height;
|
||||
this.context.drawImage(img, 0, 0);
|
||||
|
@ -88,6 +88,15 @@ define(() => {
|
|||
document.body.removeChild(safariHackaround);
|
||||
}
|
||||
this.canvas.toBlob(callback, 'image/png');
|
||||
};
|
||||
|
||||
img.addEventListener('load', () => {
|
||||
if(safariHackaround) {
|
||||
// Wait for custom fonts to load (Safari takes a moment)
|
||||
setTimeout(render, 50);
|
||||
} else {
|
||||
render();
|
||||
}
|
||||
}, {once: true});
|
||||
|
||||
img.src = this.getSVGURL(renderer, {width, height});
|
||||
|
|
Loading…
Reference in New Issue