generated from nhcarrigan/template
feat: add custom UI font support
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:
+14
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user