Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 251ae54

Browse files
committed
Deprecate draw_rect and get_xys
1 parent cc56def commit 251ae54

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/ft2font_wrapper.cpp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,21 @@ static void PyFT2Image_dealloc(PyFT2Image *self)
6969
const char *PyFT2Image_draw_rect__doc__ =
7070
"draw_rect(self, x0, y0, x1, y1)\n"
7171
"--\n\n"
72-
"Draw an empty rectangle to the image.\n";
72+
"Draw an empty rectangle to the image.\n"
73+
"\n"
74+
".. deprecated:: 3.8\n";
75+
;
7376

7477
static PyObject *PyFT2Image_draw_rect(PyFT2Image *self, PyObject *args)
7578
{
79+
char const* msg =
80+
"FT2Image.draw_rect is deprecated since Matplotlib 3.8 and will be removed "
81+
"two minor releases later as it is not used in the library. If you rely on "
82+
"it, please let us know.";
83+
if (PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1)) {
84+
return NULL;
85+
}
86+
7687
double x0, y0, x1, y1;
7788

7889
if (!PyArg_ParseTuple(args, "dddd:draw_rect", &x0, &y0, &x1, &y1)) {
@@ -820,10 +831,20 @@ static PyObject *PyFT2Font_draw_glyphs_to_bitmap(PyFT2Font *self, PyObject *args
820831
const char *PyFT2Font_get_xys__doc__ =
821832
"get_xys(self, antialiased=True)\n"
822833
"--\n\n"
823-
"Get the xy locations of the current glyphs.\n";
834+
"Get the xy locations of the current glyphs.\n"
835+
"\n"
836+
".. deprecated:: 3.8\n";
824837

825838
static PyObject *PyFT2Font_get_xys(PyFT2Font *self, PyObject *args, PyObject *kwds)
826839
{
840+
char const* msg =
841+
"FT2Font.get_xys is deprecated since Matplotlib 3.8 and will be removed two "
842+
"minor releases later as it is not used in the library. If you rely on it, "
843+
"please let us know.";
844+
if (PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1)) {
845+
return NULL;
846+
}
847+
827848
bool antialiased = true;
828849
std::vector<double> xys;
829850
const char *names[] = { "antialiased", NULL };

0 commit comments

Comments
 (0)