diff options
author | zandr <7629614+deathlyfrantic@users.noreply.github.com> | 2022-01-29 14:50:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-29 22:50:44 +0300 |
commit | 094c2c9269685e8759104f2e9c05eca323a57fe4 (patch) | |
tree | 2537bb8ee23e834fcd5315b825b7cd89a11339a4 /alacritty/src/renderer/mod.rs | |
parent | d1deff9fae05dec5a6a2af08dc34ed3230f68da9 (diff) | |
download | r-alacritty-094c2c9269685e8759104f2e9c05eca323a57fe4.tar.gz r-alacritty-094c2c9269685e8759104f2e9c05eca323a57fe4.tar.bz2 r-alacritty-094c2c9269685e8759104f2e9c05eca323a57fe4.zip |
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.
Diffstat (limited to 'alacritty/src/renderer/mod.rs')
-rw-r--r-- | alacritty/src/renderer/mod.rs | 10 |
1 files changed, 9 insertions, 1 deletions
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); |