From 0b90e16704a42b34e2a6fd99337c991341fb296a Mon Sep 17 00:00:00 2001 From: kthoden Date: Mon, 29 Apr 2019 17:06:07 +0200 Subject: [PATCH] Subtitles can be wrapped, as well --- mkimage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mkimage.py b/mkimage.py index 11ad51d..650f86b 100755 --- a/mkimage.py +++ b/mkimage.py @@ -191,7 +191,10 @@ def create_cover(metadata_dict, image_directory, cover_filename, image_is_file): text_draw.multiline_text((ttcenter, 200), title_text_joined, font=big_bold_font, align="center") if len(subtitle_text) > 0: - text_draw.text((centered(subtitle_text, medium_font), 350), subtitle_text, font=medium_font, fill=fill_colour_top) + subtitle_lines = textwrap.wrap(subtitle_text, width=40) + subtitle_lines_joined = "\n".join(subtitle_lines) + subtitle_center = centered(subtitle_lines_joined, medium_font) + text_draw.multiline_text((subtitle_center, 350), subtitle_lines_joined, font=medium_font, fill=fill_colour_top, align="center") authors_text_lines = textwrap.wrap(authors_text, width=50) authors_text_joined = "\n".join(authors_text_lines)