From 094c2c9269685e8759104f2e9c05eca323a57fe4 Mon Sep 17 00:00:00 2001 From: zandr <7629614+deathlyfrantic@users.noreply.github.com> Date: Sat, 29 Jan 2022 14:50:44 -0500 Subject: Add option to control built-in box drawing chars This commit adds the config `font.builtin_box_drawing` option to control built-in font, which is enabled by default. --- alacritty/src/renderer/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'alacritty/src/renderer/mod.rs') diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index 33c6a7e3..50a0e7d7 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -137,6 +137,9 @@ pub struct GlyphCache { /// Font metrics. metrics: crossfont::Metrics, + + /// Whether to use the built-in font for box drawing characters. + builtin_box_drawing: bool, } impl GlyphCache { @@ -167,6 +170,7 @@ impl GlyphCache { bold_italic_key: bold_italic, glyph_offset: font.glyph_offset, metrics, + builtin_box_drawing: font.builtin_box_drawing, }; cache.load_common_glyphs(loader); @@ -268,7 +272,10 @@ impl GlyphCache { // Rasterize the glyph using the built-in font for special characters or the user's font // for everything else. - let rasterized = builtin_font::builtin_glyph(glyph_key.character, &self.metrics) + let rasterized = self + .builtin_box_drawing + .then(|| builtin_font::builtin_glyph(glyph_key.character, &self.metrics)) + .flatten() .map_or_else(|| self.rasterizer.get_glyph(glyph_key), Ok); let glyph = match rasterized { @@ -355,6 +362,7 @@ impl GlyphCache { self.italic_key = italic; self.bold_italic_key = bold_italic; self.metrics = metrics; + self.builtin_box_drawing = font.builtin_box_drawing; self.clear_glyph_cache(loader); -- cgit