Files
excalidraw/packages
David Luzar bee01e3a12 fix(packages/excalidraw): load export fonts into a worker's font set, warn without one (#12374)
* fix: load export fonts into a worker's own font set

Since #12347 every export format loads the scene fonts before rendering,
SVG included. Without a `document.fonts` -- a DOM shim like linkedom, e.g.
Excalidraw+'s preview worker -- the loader returns early (#11997), so a
worker never loaded fonts into its own `self.fonts`, which an
OffscreenCanvas there measures and draws with.

`Fonts.loadElementsFonts` now falls back to the worker's font set, and
skips loading only where there is neither. Tested without the
`document.fonts` mock from setupTests.

Claude Opus 5.5 (xhigh)

* fix: warn once when export fonts have no font set to load into

Without a font set (Node, or a DOM shim like linkedom outside a worker)
and no `config.environment.loadFonts`, the export silently measures and
draws text with whatever fonts the environment has. Warn once per
process when the elements use fonts that would need loading (local fonts
like Helvetica never do).

Claude Opus 5.5 (xhigh)
2026-10-20 12:12:18 +02:00
..