Sans is what a document is set in, and serif is now something you can ask for
Google Docs defaults to Arial and Word to Aptos; ours defaulted to a serif, which was a reasonable identity and not what anyone expects when they open a document editor. The default is now sans. The reason this took a branch of its own rather than a changed font-family is that "no mark" used to mean serif. There was docs-font-sans and docs-font-mono and nothing for serif, so moving the default would have made serif inexpressible. So serif becomes a mark of its own first, across the five places that vocabulary spans — the Rust renderer's MARKS table, the editor schema, the stylesheet, the PDF's own handling and the toolbar — and only then does the default move. The font set is also the measurement baseline: the faces are self-hosted and the PDF exporter measures with those exact font programs, so screen and export paginate alike only while both use them. The screen's default and the exporter's are separate constants in separate languages and nothing structurally forces them to agree, so a test now reads both and fails if they diverge — verified by flipping the stylesheet back to serif and watching it say so. Page counts were measured before and after rather than assumed: four pages and two, either way, with no assertion loosened. Every document that already exists changes appearance, because none carries a font mark. That is the point of the change rather than a side effect of it. Reviewed by Fable, which found the toolbar resolving a run carrying two font marks in the opposite order to both renderers — mono wins the cascade on screen and in the PDF, and the control would have read "Sans serif" while drawing mono, with a test pinning that wrong answer as doctrine. Reachable only through a hand-crafted update, which is exactly the case the surrounding comments claim to have thought about. Fixed, along with a guard that could not throw for any input and a comment arguing the right decision from a backwards fact.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
19 files changed,
+698
−49
.amadan/ci.d/10-gate+14 −0core/src/fragment.rs+15 −5core/tests/fragment.rs+47 −0fixtures/browser-drive.mjs+11 −4fixtures/editor-entry.js+16 −0fixtures/fonts.mjs+143 −0fixtures/fonts.test.mjs+94 −0fixtures/generate-fragment.mjs+25 −1fixtures/toolbar.mjs+49 −4fixtures/vectors/fragment/fonts.binbinaryinternal/core/testdata/docs_core.wasmbinaryinternal/docs/export.go+11 −1internal/docs/export_test.go+103 −5internal/docs/static/{editor.98a16ab4d0c731c1.js => editor.5b869295084ed7fb.js}+13 −13internal/docs/views/show.html+31 −4internal/export/pdf.go+39 −1internal/export/pdf_test.go+50 −0internal/export/sample_pdf_test.go+1 −1internal/fonts/fonts.go+36 −10
.amadan/ci.d/10-gateLoading diff…
core/src/fragment.rsLoading diff…
core/tests/fragment.rsLoading diff…
fixtures/browser-drive.mjsLoading diff…
fixtures/editor-entry.jsLoading diff…
fixtures/fonts.mjsLoading diff…
fixtures/fonts.test.mjsLoading diff…
fixtures/generate-fragment.mjsLoading diff…
fixtures/toolbar.mjsLoading diff…
fixtures/vectors/fragment/fonts.binLoading diff…
internal/core/testdata/docs_core.wasmLoading diff…
internal/docs/export.goLoading diff…
internal/docs/export_test.goLoading diff…
internal/docs/static/{editor.98a16ab4d0c731c1.js => editor.5b869295084ed7fb.js}Loading diff…
internal/docs/views/show.htmlLoading diff…
internal/export/pdf.goLoading diff…
internal/export/pdf_test.goLoading diff…
internal/export/sample_pdf_test.goLoading diff…
internal/fonts/fonts.goLoading diff…