feat(compose): font family picker with bundled open-source fonts #72

Closed
opened 2026-07-01 21:22:44 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-01 21:22:44 +00:00 (Migrated from github.com)

Part of the compose rich-formatting epic — stacked on the rich-text foundation ticket (branch feat-richtext-foundation), which provides RichStyle.FontFamily(css) + serialization + the editor's font-resolver hook.

Scope

  • New res/font/ bundling 4 open-source fonts fetched from their official upstreams: Inter, Lora, Merriweather, JetBrains Mono (all SIL OFL 1.1). Commit the OFL license texts under THIRD_PARTY_LICENSES/; keep the total ≲2 MB (prefer variable fonts or regular+bold cuts). No build-time downloads (F-Droid-safe).
  • Font registry mapping display name ↔ email-safe CSS stack (e.g. 'Lora', Georgia, serif) ↔ Compose FontFamily; include generic Sans/Serif/Monospace entries that need no bundled file.
  • Toolbar dropdown (new ui/compose/format/FontPicker.kt) applying RichStyle.FontFamily(css) to the selection; "Default" clears it. Pass a real font resolver into RichTextBodyField so styled runs render in-editor.

Acceptance

  • CSS stack survives serialize→parse round-trip; picker reflects the selection's current font; androidTest for the picker; license texts present; recipients without the font fall back down the CSS stack.
Part of the compose rich-formatting epic — stacked on the rich-text foundation ticket (branch `feat-richtext-foundation`), which provides `RichStyle.FontFamily(css)` + serialization + the editor's font-resolver hook. **Scope** - New `res/font/` bundling 4 open-source fonts fetched from their official upstreams: **Inter, Lora, Merriweather, JetBrains Mono** (all SIL OFL 1.1). Commit the OFL license texts under `THIRD_PARTY_LICENSES/`; keep the total ≲2 MB (prefer variable fonts or regular+bold cuts). No build-time downloads (F-Droid-safe). - Font registry mapping display name ↔ email-safe CSS stack (e.g. `'Lora', Georgia, serif`) ↔ Compose `FontFamily`; include generic Sans/Serif/Monospace entries that need no bundled file. - Toolbar dropdown (new `ui/compose/format/FontPicker.kt`) applying `RichStyle.FontFamily(css)` to the selection; "Default" clears it. Pass a real font resolver into `RichTextBodyField` so styled runs render in-editor. **Acceptance** - CSS stack survives serialize→parse round-trip; picker reflects the selection's current font; androidTest for the picker; license texts present; recipients without the font fall back down the CSS stack.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#72