From 719a9a5b6414bad904d9908c0ad1a14ac29388ef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 28 Feb 2019 18:05:52 +0530 Subject: [PATCH] Fix #1428 --- kitty/freetype.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kitty/freetype.c b/kitty/freetype.c index c05f3c04f..d1538bd81 100644 --- a/kitty/freetype.c +++ b/kitty/freetype.c @@ -281,12 +281,11 @@ int get_glyph_width(PyObject *s, glyph_index g) { Face *self = (Face*)s; if (!load_glyph(self, g, FT_LOAD_DEFAULT)) { PyErr_Print(); return false; } - FT_Bitmap *bitmap = &self->face->glyph->bitmap; #define M self->face->glyph->metrics #define B self->face->glyph->bitmap /* printf("glyph: %u bitmap.width: %d bitmap.rows: %d horiAdvance: %ld horiBearingX: %ld horiBearingY: %ld vertBearingX: %ld vertBearingY: %ld vertAdvance: %ld width: %ld height: %ld\n", */ /* g, B.width, B.rows, M.horiAdvance, M.horiBearingX, M.horiBearingY, M.vertBearingX, M.vertBearingY, M.vertAdvance, M.width, M.height); */ - return bitmap->width; + return B.width ? B.width : (M.width / 64); #undef M #undef B }