penpot/frontend
Pablo Alba 8a9e87e33e 🐛 Skip WebGL auto-grow heals for texts with a failed font
On the WebGL renderer, a face that failed to load counts as ready,
because WASM lays the text out with a fallback font. The page-open
check skipped only texts waiting for a font, so it measured texts with
a failed face using the fallback and saved that size with no undo
step, on every page open. A team font that was deleted or returns 404
changed the size of every auto-grow text using it.

The check after fonts load had the same problem: a face that was
pending at page load and then failed was measured with the fallback
and resized, also without undo.

Both checks now skip texts that use a failed face, as the SVG :check
phase already does. The font relayout still runs for them, so they
show in the fallback font, but their stored size stays as it was.
app.render-wasm.api.fonts/font-failed? reports a failed face, and
shape-ids-for-failed-fonts finds the texts that use one.

Tests: frontend-tests.render-wasm.stale-text-selrects-test covers a
page load and a font load where one stale text uses a failed face;
only the other text is resized. The tests now mock font-failed?, so
they do not read failed faces left by other tests.

Relates to #12721

AI-assisted-by: claude-opus-5-5
2026-11-19 21:12:21 +01:00
..
2026-04-07 21:35:00 +02:00
2026-10-07 10:41:29 +02:00