From 59a5e23466f2f64ff409c7406b18011ee6516474 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 4 Feb 2018 22:57:20 +0530 Subject: [PATCH] Almost always resize glyphs that are too wide When using FreeType, rescale glyphs that dont fit if they are more than 1px wider than the cell rather than 25% of the cell width. This matches the behavior of CoreText and is needed for rendering the various Emoji with default text presentation (i.e. emoji that have wcwidth() == 1) --- kitty/freetype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/freetype.c b/kitty/freetype.c index 7c2ec5395..70e8d0011 100644 --- a/kitty/freetype.c +++ b/kitty/freetype.c @@ -357,7 +357,7 @@ render_bitmap(Face *self, int glyph_id, ProcessedBitmap *ans, unsigned int cell_ size_t extra = bitmap->width - max_width; if (italic && extra < cell_width / 2) { trim_borders(ans, extra); - } else if (rescale && self->is_scalable && extra > MAX(2, cell_width / 4)) { + } else if (rescale && self->is_scalable && extra > 1) { FT_F26Dot6 char_width = self->char_width, char_height = self->char_height; float ar = (float)max_width / (float)bitmap->width; if (set_font_size(self, (FT_F26Dot6)((float)self->char_width * ar), (FT_F26Dot6)((float)self->char_height * ar), self->xdpi, self->ydpi, 0)) {