compatibility code for ancient FreeType

This commit is contained in:
nulano 2020-10-12 01:45:52 +01:00
parent df2ea75683
commit 39ae5d62f0

View File

@ -1007,7 +1007,13 @@ font_render(FontObject* self, PyObject* args)
case FT_PIXEL_MODE_GRAY2:
case FT_PIXEL_MODE_GRAY4:
if (!bitmap_converted_ready) {
#if FREETYPE_MAJOR > 2 ||\
(FREETYPE_MAJOR == 2 && FREETYPE_MINOR > 6)
FT_Bitmap_Init(&bitmap_converted);
#else
FT_Bitmap_New(&bitmap_converted);
#endif
bitmap_converted_ready = 1;
}
error = FT_Bitmap_Convert(library, &bitmap, &bitmap_converted, 1);