From 075f93cdee3cfecb3fa3de1cf28ba5f8962ddc54 Mon Sep 17 00:00:00 2001 From: weckyy702 Date: Sat, 26 Dec 2020 17:51:59 +0100 Subject: [PATCH] fixed error involving text orientation --- draw/code_to_image.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/draw/code_to_image.py b/draw/code_to_image.py index f94d10e..8a76419 100644 --- a/draw/code_to_image.py +++ b/draw/code_to_image.py @@ -1,4 +1,3 @@ -import sys from typing import Iterable from PIL import Image, ImageDraw, ImageFont @@ -16,12 +15,12 @@ def NSD_init(x: float, y: float): img = Image.new("RGB", (x, y), "white") output_img = ImageDraw.Draw(img) #font = ImageFont.load_default() - font = ImageFont.truetype("res/fonts/SpaceGrotesk-Light.ttf", 14) + font = ImageFont.truetype("res/fonts/SpaceGrotesk-Light.ttf", 12) def get_text_size(text: str): if not font: raise Exception("Output image was not initialized! Make sure to call NSD_init first") - return font.getsize(text, direction="ltr") + return font.getsize(text) def draw_debug_tile(x, y, x_sz, y_sz): from random import randint