max_width = item.get('max-width', newimg.size[0])
for line in split_to_lines(text, draw, font, max_width):
realheight = draw.textsize(line, font=font)[1]
if cursor + realheight > newimg.size[1]:
return False
max_width = item.get('max-width', newimg.size[0])
for line in split_to_lines(text, draw, font, max_width):
realheight = draw.textsize(line, font=font)[1]
if cursor + realheight > newimg.size[1]:
return False