diff --git a/CHANGELOG.md b/CHANGELOG.md index 2652f3ce..95aaab07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -121,6 +121,8 @@ * URL underlines sometimes still being visible after exiting URL mode. * Text-bindings, and pipe-* bindings, with multiple key mappings causing a crash (double-free) on exit ([#1259][1259]). +* Double-width glyphs glitching when surrounded by glyphs overflowing + into the double-width glyph ([#1256][1256]). [1173]: https://codeberg.org/dnkl/foot/issues/1173 [1190]: https://codeberg.org/dnkl/foot/issues/1190 @@ -128,6 +130,7 @@ [1209]: https://codeberg.org/dnkl/foot/issues/1209 [1218]: https://codeberg.org/dnkl/foot/issues/1218 [1259]: https://codeberg.org/dnkl/foot/issues/1259 +[1256]: https://codeberg.org/dnkl/foot/issues/1256 ### Security diff --git a/render.c b/render.c index f5e7f627..92a37d7c 100644 --- a/render.c +++ b/render.c @@ -646,17 +646,21 @@ render_cell(struct terminal *term, pixman_image_t *pix, } } - if (single == NULL && grapheme == NULL) { - xassert(base != 0); - single = fcft_rasterize_char_utf32(font, base, term->font_subpixel); - if (single == NULL) { + if (unlikely(base >= CELL_SPACER)) { glyph_count = 0; cell_cols = 1; } else { - glyph_count = 1; - glyphs = &single; + xassert(base != 0); + single = fcft_rasterize_char_utf32(font, base, term->font_subpixel); + if (single == NULL) { + glyph_count = 0; + cell_cols = 1; + } else { + glyph_count = 1; + glyphs = &single; cell_cols = single->cols; + } } } }