From 3cf6ad1895ce6a77245d3bc96c8d19c440ad6132 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 5 Jul 2018 00:54:52 +0300 Subject: [PATCH] Remove ununsed font_getabc --- src/_imagingft.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/src/_imagingft.c b/src/_imagingft.c index 86e0fe45b..f94e55803 100644 --- a/src/_imagingft.c +++ b/src/_imagingft.c @@ -674,47 +674,6 @@ font_getsize(FontObject* self, PyObject* args) ); } -static PyObject* -font_getabc(FontObject* self, PyObject* args) -{ - FT_ULong ch; - FT_Face face; - double a, b, c; - - /* calculate ABC values for a given string */ - - PyObject* string; - if (!PyArg_ParseTuple(args, "O:getabc", &string)) - return NULL; - -#if PY_VERSION_HEX >= 0x03000000 - if (!PyUnicode_Check(string)) { -#else - if (!PyUnicode_Check(string) && !PyString_Check(string)) { -#endif - PyErr_SetString(PyExc_TypeError, "expected string"); - return NULL; - } - - if (font_getchar(string, 0, &ch)) { - int index, error; - face = self->face; - index = FT_Get_Char_Index(face, ch); - /* Note: bitmap fonts within ttf fonts do not work, see #891/pr#960 */ - error = FT_Load_Glyph(face, index, FT_LOAD_DEFAULT|FT_LOAD_NO_BITMAP); - if (error) - return geterror(error); - a = face->glyph->metrics.horiBearingX / 64.0; - b = face->glyph->metrics.width / 64.0; - c = (face->glyph->metrics.horiAdvance - - face->glyph->metrics.horiBearingX - - face->glyph->metrics.width) / 64.0; - } else - a = b = c = 0.0; - - return Py_BuildValue("ddd", a, b, c); -} - static PyObject* font_render(FontObject* self, PyObject* args) { @@ -854,7 +813,6 @@ font_dealloc(FontObject* self) static PyMethodDef font_methods[] = { {"render", (PyCFunction) font_render, METH_VARARGS}, {"getsize", (PyCFunction) font_getsize, METH_VARARGS}, - {"getabc", (PyCFunction) font_getabc, METH_VARARGS}, {NULL, NULL} };