From 90dc24b7eed756f11325634330cab22f613c4c60 Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Wed, 22 Nov 2017 09:51:22 +0100 Subject: [PATCH] Some more hints regarding text alignment --- mkimage.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mkimage.py b/mkimage.py index 779ea37..829bde0 100644 --- a/mkimage.py +++ b/mkimage.py @@ -138,6 +138,12 @@ def centered(textstring, font_spec): # get length of each line for centering # determine lineskip # return result + # + # or try and do that using multiline: + # https://pillow.readthedocs.io/en/3.3.x/reference/ImageDraw.html?highlight=multiline_text#PIL.ImageDraw.PIL.ImageDraw.Draw.multiline_text + # https://github.com/python-pillow/Pillow/issues/2067 + # https://docs.python.org/3.3/library/textwrap.html?highlight=textwrap#module-textwrap + tmp_draw = ImageDraw.Draw(Image.new("RGB", DIMENSIONS, BACKGROUND))