Skip to content

Commit

Permalink
compatibility code for ancient FreeType
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Oct 12, 2020
1 parent df2ea75 commit 39ae5d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/_imagingft.c
Expand Up @@ -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);
Expand Down

0 comments on commit 39ae5d6

Please sign in to comment.