oficina / docs Public

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>
Paul Campbell pushed by paul@keymail.dev 66662d318043dd48b913b1538f2ddedc2518d3d6 parent a8a9f3e
11 files changed, +335 −97
  • AGENTS.md +10 −3
  • fixtures/editor-entry.js +13 −0
  • fixtures/engines/first-reveal.mjs +87 −42
  • fixtures/generate-fragment.mjs +19 −1
  • fixtures/vectors/font-stacks.json +92 −18
  • fixtures/vectors/fragment/spaces.bin binary
  • internal/docs/fonts_browser_test.go +30 −0
  • internal/docs/fonts_engines_browser_test.go +24 −16
  • internal/docs/static/{editor.03dea77e8c83cf70.js => editor.34b4e027d49157cc.js} +13 −13
  • internal/export/pdf.go +19 −4
  • internal/export/pdf_test.go +28 −0

CI passed — run details

AGENTS.md

Loading diff…

fixtures/editor-entry.js

Loading diff…

fixtures/engines/first-reveal.mjs

Loading diff…

fixtures/generate-fragment.mjs

Loading diff…

fixtures/vectors/font-stacks.json

Loading diff…

fixtures/vectors/fragment/spaces.bin

Loading diff…

internal/docs/fonts_browser_test.go

Loading diff…

internal/docs/fonts_engines_browser_test.go

Loading diff…

internal/docs/static/{editor.03dea77e8c83cf70.js => editor.34b4e027d49157cc.js}

Loading diff…

internal/export/pdf.go

Loading diff…

internal/export/pdf_test.go

Loading diff…