diff options
-rw-r--r-- | src/renderer/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index b006f566..560685af 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -827,12 +827,13 @@ impl<'a> RenderApi<'a> { for cell in cells { // Get font key for cell // FIXME this is super inefficient. - let mut font_key = glyph_cache.font_key; - if cell.flags.contains(cell::Flags::BOLD) { - font_key = glyph_cache.bold_key; + let font_key = if cell.flags.contains(cell::Flags::BOLD) { + glyph_cache.bold_key } else if cell.flags.contains(cell::Flags::ITALIC) { - font_key = glyph_cache.italic_key; - } + glyph_cache.italic_key + } else { + glyph_cache.font_key + }; let glyph_key = GlyphKey { font_key, |