mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: load fonts for exportToCanvas
(#8298)
This commit is contained in:
parent
adcdbe2907
commit
5a0771ad9c
4 changed files with 73 additions and 20 deletions
|
@ -187,7 +187,13 @@ export const exportToCanvas = async (
|
|||
canvas.height = height * appState.exportScale;
|
||||
return { canvas, scale: appState.exportScale };
|
||||
},
|
||||
loadFonts: () => Promise<void> = async () => {
|
||||
await Fonts.loadFontsForElements(elements);
|
||||
},
|
||||
) => {
|
||||
// load font faces before continuing, by default leverages browsers' [FontFace API](https://developer.mozilla.org/en-US/docs/Web/API/FontFace)
|
||||
await loadFonts();
|
||||
|
||||
const frameRendering = getFrameRenderingConfig(
|
||||
exportingFrame ?? null,
|
||||
appState.frameRendering ?? null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue