This commit is contained in:
Kovid Goyal 2019-02-28 18:05:52 +05:30
parent 5adf7c2a3a
commit 719a9a5b64
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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
}