oficina / slides Public

Docs: custom fonts after the final review's fixes

AGENTS.md says what the fix wave changed: Inspect's overlap and
outline checks, the one alias pattern, the deck naming a picked
family, the Fonts page sample and JSON list, CSS weight matching and
fonts embedded in thumbnails, the bounded rename, face sets in the
gate, and readers learning a font mid-visit. The API docs list the
new fontFiles refusals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev b245530b04c772d52c2d41a63a9b620f05990aea parent 2e64ba7
2 files changed, +36 −9
  • AGENTS.md +31 −7
  • docs/api.md +5 −2
diff --git a/AGENTS.md b/AGENTS.md
index 7402981..30a9852 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -159,12 +159,22 @@ seeded on first sign-in — and comes back out as a PDF.
the app (TTF, OTF, WOFF, WOFF2; `typeface.Inspect` reads the family,
weight, italic and whether a face may go in a picture or PDF, as
`Pictures()`). Limits: 10 MiB a file, 16 faces to a family, 32
- families. A name a catalog family or a CSS generic keyword holds gets
- a number. Uploads and deletes take `fontMu`, so the limits hold under
+ families. `typeface.Inspect` also refuses tables that overlap or sum
+ past the file, and checks outline structure (loca against glyf and
+ maxp, CFF/CFF2 INDEXes; not a WOFF2's transformed glyf). A name is
+ made by `deck.FontCSSName`'s one pattern, the one the document and
+ layout take; a catalog family's or a CSS generic keyword's gets a
+ number. Uploads and deletes take `fontMu`, so the limits hold under
two at once. A file lives in the object store under its own hash, and
- `typeface.Headers` serves it with private caching. Deck settings
+ `typeface.Headers` serves it with private caching; the page shows each
+ family's name set in it, from `/fonts/files/{ref}` (its owner only),
+ and answers its families as JSON for Deck settings, which asks again
+ when the editor's window has focus. Deck settings
picks a library family (`POST /d/{sqid}/fonts`: `DeckFont` rows and
- the `meta.fontFiles` set_meta). Agents can write `meta.fontFiles` but
+ the `meta.fontFiles` set_meta). The deck names the family, not the
+ library: a listed family sharing a file with it keeps its name, any
+ other gets a number while a listed family has the name in any case,
+ so two people's Brands are Brand and Brand 2. Agents can write `meta.fontFiles` but
cannot upload bytes: a ref is served only through a deck that
recorded it **and** lists it (`/d`, `/s`, `/p` `.../fonts/{ref}`; `/d`
also serves a recorded ref to its library owner, so a pick loads
@@ -178,10 +188,16 @@ seeded on first sign-in — and comes back out as a PDF.
TrueType faces (`meta.fontFiles` faces marked `pictures`: static TrueType whose
flags allow subsetting), read from
the object store (`fontstore.go`) and parsed once per render through
- `layout.New`; anything else (variable, CFF, no subsetting) falls
- back down the stack, and the export
+ `layout.New`, a face chosen for 400 and 700 as CSS font matching
+ chooses (a bold with no bold face is the face CSS picks, unthickened);
+ anything else (variable, CFF, no subsetting) falls
+ back down the stack. A thumbnail carries each uploaded face it draws
+ in as an `@font-face` of a web subset (`fonts.WebSubset`,
+ `svg.Options.EmbedFonts`), since an SVG in an `<img>` sees no page
+ font; the export
hands the PDF module those faces renamed to the deck's CSS name
- (`fonts.Renamed`), because the module matches the name inside a font.
+ (`fonts.Renamed`, never more than twice the file), because the module
+ matches the name inside a font.
The editor strip and the remote are that picture. The presenter
window is not: it draws live slides (see the last section); only
sessions begun before positions keep the pictures.
@@ -818,6 +834,14 @@ Docs' AGENTS.md fonts section for the reasoning behind each rule.
learned from it (`font-session.mjs`'s `learn`, under `/d/{sqid}`) and
the change waits for it like any family it brings in; one the deck
already shows that the tab never learned is committed where it is.
+ An uploaded family is known by its name and its set of faces: a new
+ set (a bold added, the family picked again) is learned again, waited
+ for, and put on in place of the old set in one task; undo and redo
+ swap sets with the change (`afterHistory`). Readers learn too: the
+ viewer's in-place paging and `static/present.js` learn the incoming
+ page's `manifest.uploaded`, and the talk payload carries `uploaded`
+ for `talk-store.mjs` (`learnUploaded`), so a font the deck takes on
+ mid-visit is waited for, not fallen back from.
`/d/{sqid}/fonts/{ref}` serves a recorded ref the deck does not list
yet to the person whose library holds it, so a pick can load before
its set_meta lands. A library never gives a family a catalog
diff --git a/docs/api.md b/docs/api.md
index 330287d..a20a0bb 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -419,8 +419,11 @@ that recorded it from its owner's library (`GET /d/{sqid}/fonts/{ref}`,
and the same under `/s/{token}` and `/p/{session}`; a ref the deck
doesn't list is a 404). A `ref` you write by hand loads nothing until
then. A list that doesn't check out (more than 32
-families or 16 faces to a family, a `css` used twice, a bad `ref`,
-`format` or `weight`) is refused like any other bad op.
+families or 16 faces to a family, a `css` that doesn't start with a
+letter or digit or holds anything but letters, digits, spaces, `.`, `_`
+and `-`, a `css` used twice in any case, a `css` that is a catalog
+family's or a CSS generic family's name, a bad `ref`, `format` or
+`weight`) is refused like any other bad op.
```sh
curl -X POST -H "Authorization: Bearer $SLIDES_TOKEN" -H "Content-Type: application/json" \