From: Radek Czajka Date: Thu, 7 Oct 2021 10:03:48 +0000 (+0200) Subject: Avoid hanging conjunction on covers. X-Git-Tag: 2.2~3 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/580442a3d316c4ca444dd629e24a16b1336f01d7?hp=9f778845b37c03a83f26ce1459b4b542affe4003 Avoid hanging conjunction on covers. --- 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() + ' '