@@ -880,7 +880,7 @@ font_render(FontObject *self, PyObject *args) {
880880 image = PyObject_CallFunction (fill , "ii" , width , height );
881881 if (image == Py_None ) {
882882 PyMem_Del (glyph_info );
883- return Py_BuildValue ("ii" , 0 , 0 );
883+ return Py_BuildValue ("N(ii)" , image , 0 , 0 );
884884 } else if (image == NULL ) {
885885 PyMem_Del (glyph_info );
886886 return NULL ;
@@ -894,7 +894,7 @@ font_render(FontObject *self, PyObject *args) {
894894 y_offset -= stroke_width ;
895895 if (count == 0 || width == 0 || height == 0 ) {
896896 PyMem_Del (glyph_info );
897- return Py_BuildValue ("ii" , x_offset , y_offset );
897+ return Py_BuildValue ("N(ii)" , image , x_offset , y_offset );
898898 }
899899
900900 if (stroke_width ) {
@@ -1130,18 +1130,12 @@ font_render(FontObject *self, PyObject *args) {
11301130 if (bitmap_converted_ready ) {
11311131 FT_Bitmap_Done (library , & bitmap_converted );
11321132 }
1133- Py_DECREF (image );
11341133 FT_Stroker_Done (stroker );
11351134 PyMem_Del (glyph_info );
1136- return Py_BuildValue ("ii" , x_offset , y_offset );
1135+ return Py_BuildValue ("N(ii)" , image , x_offset , y_offset );
11371136
11381137glyph_error :
1139- if (im -> destroy ) {
1140- im -> destroy (im );
1141- }
1142- if (im -> image ) {
1143- free (im -> image );
1144- }
1138+ Py_DECREF (image );
11451139 if (stroker != NULL ) {
11461140 FT_Done_Glyph (glyph );
11471141 }
0 commit comments