X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/db91f942ce46e3af1420f3469a83257ef5aca4c2..175c5cf4f727162fa5bddd2460d37595251bbe8e:/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() + ' '