From 580442a3d316c4ca444dd629e24a16b1336f01d7 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 7 Oct 2021 12:03:48 +0200 Subject: [PATCH] Avoid hanging conjunction on covers. --- src/librarian/cover.py | 4 ++++ 1 file changed, 4 insertions(+) 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() + ' ' -- 2.20.1