oficina / slides Public

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>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 07940753e7313ac5b3f411e317498dcf0b4a4d1a parent ea57daa
21 files changed, +1,218 −54
  • fixtures/deck-fonts.mjs +111 −0
  • fixtures/deck-fonts.test.mjs +76 −0
  • fixtures/inspector.mjs +7 −3
  • internal/slides/app.go +8 −0
  • internal/slides/credits/assets.json +1 −1
  • internal/slides/deckfonts.go +316 −0
  • internal/slides/decks.go +24 −6
  • internal/slides/editor.go +17 −1
  • internal/slides/export_fonts_test.go +74 −8
  • internal/slides/exports.go +1 −1
  • internal/slides/fontstore.go +18 −4
  • internal/slides/library.go +17 −13
  • internal/slides/locales/en.toml +4 −0
  • internal/slides/migrations/0012_create_deck_fonts.sql +4 −0
  • internal/slides/migrations/schema.sql +4 −0
  • internal/slides/models.go +18 −0
  • internal/slides/static/{editor.0c85f4ebe48fb386.js => editor.60bf02a1fe569bf3.js} +16 −16
  • internal/slides/templates/editor.html +9 −0
  • internal/slides/thumbs.go +1 −1
  • internal/slidestest/deckfonts_browser_test.go +154 −0
  • internal/slidestest/deckfonts_test.go +338 −0
fixtures/deck-fonts.mjs

Loading diff…

fixtures/deck-fonts.test.mjs

Loading diff…

fixtures/inspector.mjs

Loading diff…

internal/slides/app.go

Loading diff…

internal/slides/credits/assets.json

Loading diff…

internal/slides/deckfonts.go

Loading diff…

internal/slides/decks.go

Loading diff…

internal/slides/editor.go

Loading diff…

internal/slides/export_fonts_test.go

Loading diff…

internal/slides/exports.go

Loading diff…

internal/slides/fontstore.go

Loading diff…

internal/slides/library.go

Loading diff…

internal/slides/locales/en.toml

Loading diff…

internal/slides/migrations/0012_create_deck_fonts.sql

Loading diff…

internal/slides/migrations/schema.sql

Loading diff…

internal/slides/models.go

Loading diff…

internal/slides/static/{editor.0c85f4ebe48fb386.js => editor.60bf02a1fe569bf3.js}

Loading diff…

internal/slides/templates/editor.html

Loading diff…

internal/slides/thumbs.go

Loading diff…

internal/slidestest/deckfonts_browser_test.go

Loading diff…

internal/slidestest/deckfonts_test.go

Loading diff…