diff --git a/src/dom/document-cloner.ts b/src/dom/document-cloner.ts index 796e5579f..859e1dbaf 100644 --- a/src/dom/document-cloner.ts +++ b/src/dom/document-cloner.ts @@ -109,8 +109,18 @@ export class DocumentCloner { return Promise.reject(`Error finding the ${this.referenceElement.nodeName} in the cloned document`); } - if (documentClone.fonts && documentClone.fonts.ready) { - await documentClone.fonts.ready; + if (documentClone.fonts && documentClone.fonts.status === 'loading') { + return Promise.race([ + documentClone.fonts.ready, + new Promise((resolve) => { + const fontLoadTimer = setInterval(() => { + if (documentClone.fonts.status === 'loaded') { + clearInterval(fontLoadTimer); + resolve(); + } + }, 1000); + }) + ]); } if (/(AppleWebKit)/g.test(navigator.userAgent)) {