mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-30 18:03:07 +03:00
Correction of the unbufferizing
This commit is contained in:
parent
b170c5627e
commit
af72132349
|
@ -140,9 +140,7 @@ class FreeTypeFont:
|
||||||
self.font = core.getfont(font, size, index, encoding)
|
self.font = core.getfont(font, size, index, encoding)
|
||||||
else:
|
else:
|
||||||
bytes = font.read()
|
bytes = font.read()
|
||||||
font.seek(0, 2)
|
self.font = core.getfont("", size, index, encoding, bytes)
|
||||||
size = font.tell()
|
|
||||||
self.font = core.getfont("", size, index, encoding, bytes, size)
|
|
||||||
|
|
||||||
def getname(self):
|
def getname(self):
|
||||||
return self.font.family, self.font.style
|
return self.font.family, self.font.style
|
||||||
|
|
|
@ -106,10 +106,10 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw)
|
||||||
unsigned char* file_like;
|
unsigned char* file_like;
|
||||||
int file_like_size = 0;
|
int file_like_size = 0;
|
||||||
static char* kwlist[] = {
|
static char* kwlist[] = {
|
||||||
"filename", "size", "index", "encoding", "file_like", "file_like_size", NULL
|
"filename", "size", "index", "encoding", "file_like", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "eti|isz*i", kwlist,
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "eti|iss#", kwlist,
|
||||||
Py_FileSystemDefaultEncoding, &filename,
|
Py_FileSystemDefaultEncoding, &filename,
|
||||||
&size, &index, &encoding, &file_like,
|
&size, &index, &encoding, &file_like,
|
||||||
&file_like_size))
|
&file_like_size))
|
||||||
|
@ -148,8 +148,6 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw)
|
||||||
return geterror(error);
|
return geterror(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "> %d %d %s\n", error, file_like_size, self);
|
|
||||||
|
|
||||||
return (PyObject*) self;
|
return (PyObject*) self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user