mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 08:12:33 +03:00
Added fix for font getsize on empty string
This commit is contained in:
parent
5bd8cdfe5c
commit
3dd3a90646
|
@ -109,7 +109,7 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw)
|
||||||
unsigned char* font_bytes;
|
unsigned char* font_bytes;
|
||||||
int font_bytes_size = 0;
|
int font_bytes_size = 0;
|
||||||
static char* kwlist[] = {
|
static char* kwlist[] = {
|
||||||
"filename", "size", "index", "encoding", "font_bytes",
|
"filename", "size", "index", "encoding", "font_bytes",
|
||||||
"layout_engine", NULL
|
"layout_engine", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -449,8 +449,6 @@ font_getsize(FontObject* self, PyObject* args)
|
||||||
y_max = y_min = 0;
|
y_max = y_min = 0;
|
||||||
|
|
||||||
count = text_layout(string, self, dir, features, &glyph_info, 0);
|
count = text_layout(string, self, dir, features, &glyph_info, 0);
|
||||||
if (count == 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
for (x = i = 0; i < count; i++) {
|
for (x = i = 0; i < count; i++) {
|
||||||
int index, error;
|
int index, error;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user