X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/db91f942ce46e3af1420f3469a83257ef5aca4c2..4cd6cb040e4938a726585e678d72dbd67b8f005d:/src/librarian/cover.py diff --git a/src/librarian/cover.py b/src/librarian/cover.py index 7d7964d..8f7b656 100644 --- a/src/librarian/cover.py +++ b/src/librarian/cover.py @@ -68,6 +68,10 @@ class TextBox(object): line_width = self.max_text_width break line = parts[0] + + if line[-2] == ' ': + line = line[:-2] + line_width = self.draw.textsize(line, font=font)[0] line = line.strip() + ' '