feat: add custom UI font support
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m17s
CI / Lint & Test (pull_request) Successful in 18m28s
CI / Build Linux (pull_request) Successful in 22m18s
CI / Build Windows (cross-compile) (pull_request) Successful in 33m40s

Allow users to specify a custom font for the entire app interface
(menus, labels, buttons) separately from the terminal font. Supports
Google Fonts URLs, direct font file URLs, and local file paths.

- Add custom_ui_font_path and custom_ui_font_family to Rust config
- Refactor applyCustomFont into shared applyFontFromSource helper
- Add applyCustomUiFont function using --ui-font-family CSS variable
- Update app.css to use --ui-font-family with fallback
- Apply custom UI font on startup in +page.svelte
- Add Custom UI Font section to ConfigSidebar settings panel
- Add tests for applyCustomUiFont and setCustomUiFont
This commit is contained in:
2026-03-03 18:41:21 -08:00
committed by Naomi Carrigan
parent c5feb9b43c
commit d2c39fd5c2
7 changed files with 306 additions and 50 deletions
+14 -1
View File
@@ -145,12 +145,19 @@ pub struct HikariConfig {
#[serde(default)]
pub show_thinking_blocks: bool,
// Custom font settings
// Custom terminal font settings
#[serde(default)]
pub custom_font_path: Option<String>,
#[serde(default)]
pub custom_font_family: Option<String>,
// Custom UI font settings
#[serde(default)]
pub custom_ui_font_path: Option<String>,
#[serde(default)]
pub custom_ui_font_family: Option<String>,
}
impl Default for HikariConfig {
@@ -192,6 +199,8 @@ impl Default for HikariConfig {
show_thinking_blocks: false,
custom_font_path: None,
custom_font_family: None,
custom_ui_font_path: None,
custom_ui_font_family: None,
}
}
}
@@ -309,6 +318,8 @@ mod tests {
assert!(!config.show_thinking_blocks);
assert!(config.custom_font_path.is_none());
assert!(config.custom_font_family.is_none());
assert!(config.custom_ui_font_path.is_none());
assert!(config.custom_ui_font_family.is_none());
}
#[test]
@@ -350,6 +361,8 @@ mod tests {
show_thinking_blocks: true,
custom_font_path: Some("/home/naomi/.fonts/MyFont.ttf".to_string()),
custom_font_family: Some("MyFont".to_string()),
custom_ui_font_path: None,
custom_ui_font_family: None,
};
let json = serde_json::to_string(&config).unwrap();