mirror of
https://github.com/penpot/penpot.git
synced 2026-11-20 09:00:49 +00:00
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