Skip to content

Commit

Permalink
todo: move builtin_box_drawing logic inside of sugarloaf
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Feb 24, 2025
1 parent 482a7e1 commit 8b86218
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion frontends/rioterm/src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl Renderer {
}

Renderer {
builtin_box_drawing: config.builtin_box_drawing,
builtin_box_drawing: config.fonts.builtin_box_drawing,
draw_bold_text_with_light_colors: config.draw_bold_text_with_light_colors,
macos_use_unified_titlebar: config.window.macos_use_unified_titlebar,
config_blinking_interval: config.cursor.blinking_interval.clamp(350, 1200),
Expand Down
3 changes: 0 additions & 3 deletions rio-backend/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ pub struct Config {
pub renderer: Renderer,
#[serde(default = "bool::default", rename = "draw-bold-text-with-light-colors")]
pub draw_bold_text_with_light_colors: bool,
#[serde(default = "default_bool_true", rename = "builtin-box-drawing")]
pub builtin_box_drawing: bool,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
Expand Down Expand Up @@ -509,7 +507,6 @@ impl Default for Config {
confirm_before_quit: true,
hide_cursor_when_typing: false,
draw_bold_text_with_light_colors: false,
builtin_box_drawing: true,
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions sugarloaf/src/font/fonts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn default_font_size() -> f32 {
}

#[inline]
pub fn default_font_hinting() -> bool {
pub fn default_bool_true() -> bool {
true
}

Expand Down Expand Up @@ -105,7 +105,7 @@ pub fn default_font_bold_italic() -> SugarloafFont {
}
}

#[derive(Clone, Debug, PartialEq,Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SymbolMap {
pub start: String,
pub end: String,
Expand All @@ -117,7 +117,7 @@ pub struct SymbolMap {
pub struct SugarloafFonts {
#[serde(default = "default_font_size")]
pub size: f32,
#[serde(default = "default_font_hinting")]
#[serde(default = "default_bool_true")]
pub hinting: bool,
#[serde(default = "Option::default")]
pub features: Option<Vec<String>>,
Expand All @@ -137,6 +137,8 @@ pub struct SugarloafFonts {
pub emoji: Option<SugarloafFont>,
#[serde(default = "Vec::default")]
pub extras: Vec<SugarloafFont>,
#[serde(default = "default_bool_true", rename = "builtin-box-drawing")]
pub builtin_box_drawing: bool,
#[serde(default = "Option::default", rename = "symbol-map")]
pub symbol_map: Option<Vec<SymbolMap>>,
}
Expand All @@ -155,6 +157,7 @@ impl Default for SugarloafFonts {
bold_italic: default_font_bold_italic(),
italic: default_font_italic(),
extras: vec![],
builtin_box_drawing: true,
symbol_map: None,
}
}
Expand Down

0 comments on commit 8b86218

Please sign in to comment.