Fix #1428
This commit is contained in:
parent
5adf7c2a3a
commit
719a9a5b64
@ -281,12 +281,11 @@ int
|
|||||||
get_glyph_width(PyObject *s, glyph_index g) {
|
get_glyph_width(PyObject *s, glyph_index g) {
|
||||||
Face *self = (Face*)s;
|
Face *self = (Face*)s;
|
||||||
if (!load_glyph(self, g, FT_LOAD_DEFAULT)) { PyErr_Print(); return false; }
|
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 M self->face->glyph->metrics
|
||||||
#define B self->face->glyph->bitmap
|
#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", */
|
/* 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); */
|
/* 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 M
|
||||||
#undef B
|
#undef B
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user