feat: allow users to specify a custom font #176

Closed
opened 2026-03-03 15:50:16 -08:00 by hikari · 0 comments
Owner

Summary

Allow users to personalise the app's typography by specifying a custom font, either from a local file path or a remote URL (e.g. Google Fonts).

Motivation

The current font is fixed. Users with strong font preferences — or accessibility needs that are better served by a particular typeface — have no way to change it.

Proposed Behaviour

  • Add a Custom Font field to the Settings/Appearance section
  • Accept two input formats:
    • Local file path — e.g. /home/user/.fonts/MyFont.ttf or C:\Windows\Fonts\MyFont.ttf; load via Tauri's filesystem API and inject as a @font-face rule
    • Remote URL — e.g. a Google Fonts @import URL or a direct .woff2 link; inject as a <link> or @import in the app's CSS
  • Persist the setting in the existing config (new custom_font field on the Rust Config struct and the frontend configStore)
  • Apply the font to the terminal/chat area at minimum; ideally to the whole UI
  • Provide a Reset to default button to clear the custom font
  • Validate the URL/path before saving and show an inline error if it is malformed

Acceptance Criteria

  • New custom_font: Option<String> field on the Rust Config struct
  • Config migration handles missing field gracefully (defaults to None)
  • Frontend configStore exposes customFont and setCustomFont()
  • Settings UI has a text input for the font value with local/URL toggle or auto-detection
  • Font is applied dynamically when the setting changes (no restart required)
  • Reset to default clears the field and restores the original font
  • Invalid paths/URLs surface a user-visible error
  • Tests cover the new config field and store methods

Notes

  • For local files, consider using a CSS @font-face with a blob: URL created from the file's binary content, so it works cross-platform without filesystem restrictions
  • For remote URLs, simply injecting a <link rel="stylesheet"> or a CSS @import should suffice — no Tauri invoke needed

This issue was created with help from Hikari~ 🌸

## Summary Allow users to personalise the app's typography by specifying a custom font, either from a local file path or a remote URL (e.g. Google Fonts). ## Motivation The current font is fixed. Users with strong font preferences — or accessibility needs that are better served by a particular typeface — have no way to change it. ## Proposed Behaviour - Add a **Custom Font** field to the Settings/Appearance section - Accept two input formats: - **Local file path** — e.g. `/home/user/.fonts/MyFont.ttf` or `C:\Windows\Fonts\MyFont.ttf`; load via Tauri's filesystem API and inject as a `@font-face` rule - **Remote URL** — e.g. a Google Fonts `@import` URL or a direct `.woff2` link; inject as a `<link>` or `@import` in the app's CSS - Persist the setting in the existing config (new `custom_font` field on the Rust `Config` struct and the frontend `configStore`) - Apply the font to the terminal/chat area at minimum; ideally to the whole UI - Provide a **Reset to default** button to clear the custom font - Validate the URL/path before saving and show an inline error if it is malformed ## Acceptance Criteria - [ ] New `custom_font: Option<String>` field on the Rust `Config` struct - [ ] Config migration handles missing field gracefully (defaults to `None`) - [ ] Frontend `configStore` exposes `customFont` and `setCustomFont()` - [ ] Settings UI has a text input for the font value with local/URL toggle or auto-detection - [ ] Font is applied dynamically when the setting changes (no restart required) - [ ] Reset to default clears the field and restores the original font - [ ] Invalid paths/URLs surface a user-visible error - [ ] Tests cover the new config field and store methods ## Notes - For local files, consider using a CSS `@font-face` with a `blob:` URL created from the file's binary content, so it works cross-platform without filesystem restrictions - For remote URLs, simply injecting a `<link rel="stylesheet">` or a CSS `@import` should suffice — no Tauri invoke needed ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-03-03 20:21:58 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#176