From 71402fb6b7fa1e48ed6e5236fd625ff7e9554f1c Mon Sep 17 00:00:00 2001 From: Sarah Date: Fri, 29 Apr 2022 16:35:42 +0100 Subject: [PATCH] move and resize text --- generate_map_timelapse.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generate_map_timelapse.py b/generate_map_timelapse.py index 0f0599c..7faad19 100644 --- a/generate_map_timelapse.py +++ b/generate_map_timelapse.py @@ -41,7 +41,12 @@ def generate_map_timelapse(token_id, token_secret, filename): img = Image.open(stream) map_editable = ImageDraw.Draw(img) - map_editable.text((0, 0), "{}".format(date), (255, 64, 0)) + + # macos font path + font = ImageFont.truetype("/System/Library/Fonts/Supplemental/Arial.ttf", 48) + + # image is 655 high + map_editable.text((2, 605), "{}".format(date), (255, 64, 0), font=font) img_byte_arr = io.BytesIO() img.save(img_byte_arr, format='PNG')