Slides: use a font from your library in a deck
Deck settings' two font fields offer the person's own library families
under "Your fonts", with an "Upload a font…" link to /fonts. Picking one
posts to /d/{sqid}/fonts, which records a DeckFont row per face (only
for the family's owner, on a deck they can edit) and answers the family;
the editor then commits one set_meta with fontFiles and the role's stack
in front of the theme's. Any other choice drops families neither role
uses, in the same op.
/d/{sqid}, /s/{token} and /p/{session} serve /fonts/{ref} only when the
deck has a DeckFont row for the ref and lists it in meta.fontFiles, with
typeface.Headers. The font loader for pictures and the PDF reads only
the deck's recorded refs. Deleting a library family keeps any object a
deck still records; deleting a deck takes its rows and the objects
nothing else names. Migration 0012 adds deck_fonts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 files changed,
+1,218
−54
fixtures/deck-fonts.mjs+111 −0fixtures/deck-fonts.test.mjs+76 −0fixtures/inspector.mjs+7 −3internal/slides/app.go+8 −0internal/slides/credits/assets.json+1 −1internal/slides/deckfonts.go+316 −0internal/slides/decks.go+24 −6internal/slides/editor.go+17 −1internal/slides/export_fonts_test.go+74 −8internal/slides/exports.go+1 −1internal/slides/fontstore.go+18 −4internal/slides/library.go+17 −13internal/slides/locales/en.toml+4 −0internal/slides/migrations/0012_create_deck_fonts.sql+4 −0internal/slides/migrations/schema.sql+4 −0internal/slides/models.go+18 −0internal/slides/static/{editor.0c85f4ebe48fb386.js => editor.60bf02a1fe569bf3.js}+16 −16internal/slides/templates/editor.html+9 −0internal/slides/thumbs.go+1 −1internal/slidestest/deckfonts_browser_test.go+154 −0internal/slidestest/deckfonts_test.go+338 −0
fixtures/deck-fonts.mjsLoading diff…
fixtures/deck-fonts.test.mjsLoading diff…
fixtures/inspector.mjsLoading diff…
internal/slides/app.goLoading diff…
internal/slides/credits/assets.jsonLoading diff…
internal/slides/deckfonts.goLoading diff…
internal/slides/decks.goLoading diff…
internal/slides/editor.goLoading diff…
internal/slides/export_fonts_test.goLoading diff…
internal/slides/exports.goLoading diff…
internal/slides/fontstore.goLoading diff…
internal/slides/library.goLoading diff…
internal/slides/locales/en.tomlLoading diff…
internal/slides/migrations/0012_create_deck_fonts.sqlLoading diff…
internal/slides/migrations/schema.sqlLoading diff…
internal/slides/models.goLoading diff…
internal/slides/static/{editor.0c85f4ebe48fb386.js => editor.60bf02a1fe569bf3.js}Loading diff…
internal/slides/templates/editor.htmlLoading diff…
internal/slides/thumbs.goLoading diff…
internal/slidestest/deckfonts_browser_test.goLoading diff…
internal/slidestest/deckfonts_test.goLoading diff…