mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Use PyCapsule in _imagingft
This commit is contained in:
parent
ee65b305b1
commit
882ac783eb
|
@ -830,7 +830,6 @@ font_render(FontObject *self, PyObject *args) {
|
||||||
unsigned char convert_scale; /* scale factor for non-8bpp bitmaps */
|
unsigned char convert_scale; /* scale factor for non-8bpp bitmaps */
|
||||||
PyObject *image;
|
PyObject *image;
|
||||||
Imaging im;
|
Imaging im;
|
||||||
Py_ssize_t id;
|
|
||||||
int mask = 0; /* is FT_LOAD_TARGET_MONO enabled? */
|
int mask = 0; /* is FT_LOAD_TARGET_MONO enabled? */
|
||||||
int color = 0; /* is FT_LOAD_COLOR enabled? */
|
int color = 0; /* is FT_LOAD_COLOR enabled? */
|
||||||
int stroke_width = 0;
|
int stroke_width = 0;
|
||||||
|
@ -929,10 +928,9 @@ font_render(FontObject *self, PyObject *args) {
|
||||||
PyMem_Del(glyph_info);
|
PyMem_Del(glyph_info);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
PyObject *imageId = PyObject_GetAttrString(image, "id");
|
PyObject *imagePtr = PyObject_GetAttrString(image, "ptr");
|
||||||
id = PyLong_AsSsize_t(imageId);
|
im = (Imaging)PyCapsule_GetPointer(imagePtr, IMAGING_MAGIC);
|
||||||
Py_XDECREF(imageId);
|
Py_XDECREF(imagePtr);
|
||||||
im = (Imaging)id;
|
|
||||||
|
|
||||||
x_offset -= stroke_width;
|
x_offset -= stroke_width;
|
||||||
y_offset -= stroke_width;
|
y_offset -= stroke_width;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user