Gate on every face the marks use; nested paste fonts; a check that can fail
Branch review 3 on #83. 1 (P1). A font used only by spaces skipped the gate, so a late font moved visible text. export.FacesUsed counted only glyph-drawing pieces. It now counts every face the marks and blocks put text or line boxes in: whitespace-only runs, marked hard breaks, and each block's own strut face (an empty heading's bold). Only glyphs rank the preloads. The editor's own walk over its log adds the struts too. The reviewer's case is spaces.bin: Carlito words whose spaces alone are Caveat, with Caveat 8 s late and no editor. It failed in Chromium and WebKit before the fix (the pixels changed at about 3.5 s), and TestFacesUsedCounts... failed first in Go. 2 (P2). An explicit font-family inside another font kept the outer font. The default family's mark now has a font-family rule that clears an inherited font mark, for a stack that maps to the default or to nothing. So Calibri or Wingdings inside an Inter paragraph is Carlito, Cambria is Caladea, and a span with no font-family still inherits. TestFontANestedPastedFontWinsOverItsParent failed on a8a9f3e with the reviewer's result (Inter). 3 (P2). The engines check skipped hidden and blank captures after text had appeared. Now every capture must be "nothing painted yet" before the first text, or exactly the final picture, gaps and height after it. Captures no longer wait for document.fonts.ready. A control scenario hides the sheet for a second after it is shown, and must be caught in each engine or the check fails as blind. Mutation: restoring the old skip made it fail as blind in both engines. fixtures/vectors/font-stacks.json gains the five copied-out stacks the native branch found: "Docs Source Sans 3", "Docs IBM Plex Sans", "Docs Source Serif 4", "Docs Literata" and "Docs JetBrains Mono", each followed by its family's fallback list. Each maps to the wrong family without the private-name check, as removing that check here showed. The file is re-indented, one value per line. Nothing else shared changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 files changed,
+335
−97
AGENTS.md+10 −3fixtures/editor-entry.js+13 −0fixtures/engines/first-reveal.mjs+87 −42fixtures/generate-fragment.mjs+19 −1fixtures/vectors/font-stacks.json+92 −18fixtures/vectors/fragment/spaces.binbinaryinternal/docs/fonts_browser_test.go+30 −0internal/docs/fonts_engines_browser_test.go+24 −16internal/docs/static/{editor.03dea77e8c83cf70.js => editor.34b4e027d49157cc.js}+13 −13internal/export/pdf.go+19 −4internal/export/pdf_test.go+28 −0
CI passed — run details
Intent
AGENTS.mdLoading diff…
fixtures/editor-entry.jsLoading diff…
fixtures/engines/first-reveal.mjsLoading diff…
fixtures/generate-fragment.mjsLoading diff…
fixtures/vectors/font-stacks.jsonLoading diff…
fixtures/vectors/fragment/spaces.binLoading diff…
internal/docs/fonts_browser_test.goLoading diff…
internal/docs/fonts_engines_browser_test.goLoading diff…
internal/docs/static/{editor.03dea77e8c83cf70.js => editor.34b4e027d49157cc.js}Loading diff…
internal/export/pdf.goLoading diff…
internal/export/pdf_test.goLoading diff…