More logical name for the font buffer

This commit is contained in:
wiredfool 2013-04-25 21:15:32 -07:00
parent 028e63865e
commit 43d0aaac24

View File

@ -103,16 +103,16 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw)
int size; int size;
int index = 0; int index = 0;
unsigned char* encoding; unsigned char* encoding;
unsigned char* file_like; unsigned char* font_bytes;
int file_like_size = 0; int font_bytes_size = 0;
static char* kwlist[] = { static char* kwlist[] = {
"filename", "size", "index", "encoding", "file_like", NULL "filename", "size", "index", "encoding", "font_bytes", NULL
}; };
if (!PyArg_ParseTupleAndKeywords(args, kw, "eti|iss#", kwlist, if (!PyArg_ParseTupleAndKeywords(args, kw, "eti|iss#", kwlist,
Py_FileSystemDefaultEncoding, &filename, Py_FileSystemDefaultEncoding, &filename,
&size, &index, &encoding, &file_like, &size, &index, &encoding, &font_bytes,
&file_like_size)) &font_bytes_size))
return NULL; return NULL;
if (!library) { if (!library) {
@ -127,10 +127,10 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw)
if (!self) if (!self)
return NULL; return NULL;
if (filename && file_like_size <= 0) { if (filename && font_bytes_size <= 0) {
error = FT_New_Face(library, filename, index, &self->face); error = FT_New_Face(library, filename, index, &self->face);
} else { } else {
error = FT_New_Memory_Face(library, (FT_Byte*)file_like, file_like_size, index, &self->face); error = FT_New_Memory_Face(library, (FT_Byte*)font_bytes, font_bytes_size, index, &self->face);
} }
if (!error) if (!error)