Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src_c/font.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ font_set_strikethrough(PyObject *self, PyObject *arg)
}

static PyObject *
font_render(PyObject *self, PyObject *args)
font_render(PyObject *self, PyObject *args, PyObject *kwarg)
{
TTF_Font *font = PyFont_AsFont(self);
int antialias;
Expand All @@ -485,9 +485,12 @@ font_render(PyObject *self, PyObject *args)
SDL_Surface *surf;
const char *astring = "";
int wraplength = 0;
char *kwds[] = {"text", "antialias", "color",
"background", "wraplength", NULL};

if (!PyArg_ParseTuple(args, "OpO|Oi", &text, &antialias, &fg_rgba_obj,
&bg_rgba_obj, &wraplength)) {
if (!PyArg_ParseTupleAndKeywords(args, kwarg, "OpO|Oi", kwds, &text,
&antialias, &fg_rgba_obj, &bg_rgba_obj,
&wraplength)) {
return NULL;
}

Expand Down Expand Up @@ -871,7 +874,8 @@ static PyMethodDef font_methods[] = {
{"set_strikethrough", font_set_strikethrough, METH_O,
DOC_FONT_FONT_SETSTRIKETHROUGH},
{"metrics", font_metrics, METH_O, DOC_FONT_FONT_METRICS},
{"render", font_render, METH_VARARGS, DOC_FONT_FONT_RENDER},
{"render", font_render, METH_VARARGS | METH_KEYWORDS,
DOC_FONT_FONT_RENDER},
{"size", font_size, METH_O, DOC_FONT_FONT_SIZE},
{"set_script", font_set_script, METH_O, DOC_FONT_FONT_SETSCRIPT},
{"set_direction", (PyCFunction)font_set_direction,
Expand Down