From c74f4a816504fcd57a6d410069807c79b558158d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 28 Jan 2018 10:06:39 +0530 Subject: [PATCH] Fix extra columns cut-off from the right edge of italic characters that are too wide to fit in a cell --- kitty/freetype.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty/freetype.c b/kitty/freetype.c index c11199559..7c2ec5395 100644 --- a/kitty/freetype.c +++ b/kitty/freetype.c @@ -337,6 +337,7 @@ trim_borders(ProcessedBitmap *ans, size_t extra) { if (!column_has_text) { ans->width--; extra--; } } + // Remove any remaining extra columns from the left edge of the bitmap ans->start_x = extra; ans->width -= extra; } @@ -461,7 +462,7 @@ place_bitmap_in_canvas(pixel *cell, ProcessedBitmap *bm, size_t cell_width, size // We want the glyph to be positioned inside the cell based on the bearingX // and bearingY values, making sure that it does not overflow the cell. - Region src = { .left = bm->start_x, .bottom = bm->rows, .right = bm->width }, dest = { .bottom = cell_height, .right = cell_width }; + Region src = { .left = bm->start_x, .bottom = bm->rows, .right = bm->width + bm->start_x }, dest = { .bottom = cell_height, .right = cell_width }; // Calculate column bounds float bearing_x = (float)metrics->horiBearingX / 64.f;