diff --git a/Iinstruction.py b/Iinstruction.py index 7561dad..3adb39d 100644 --- a/Iinstruction.py +++ b/Iinstruction.py @@ -131,5 +131,5 @@ if __name__ == "__main__": if_instruction("shouldNiet()", [ generic_instruction("hiet()") ], [generic_instruction("hiet()")]), ]) NSD_init(500, 500) - test.to_image(0, 0, 250, 500) + test.to_image(0, 0, 500, 500) NSD_save("Iinstruction") \ No newline at end of file diff --git a/code_to_image.py b/code_to_image.py index a5ee50c..6a36690 100644 --- a/code_to_image.py +++ b/code_to_image.py @@ -17,15 +17,15 @@ 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/NotoSans-Regular.ttf", 12) + font = ImageFont.truetype("res/fonts/SpaceGrotesk-Light.ttf", 12) def draw_generic_instruction(instruction: str, x, y, xsize, ysize) -> Iterable[float]: if not output_img: raise Exception("Output image was not initialized! Make sure to call NSD_init first") #size shit - text_y_size = font.getsize(instruction, direction="ltr")[1] - ysize = max(text_y_size, ysize) # ensure it is alway at least big enought to fit the text + #text_y_size = font.getsize(instruction, direction="ltr")[1] + #ysize = max(text_y_size, ysize) # ensure it is alway at least big enought to fit the text #draw shit output_img.rectangle((x,y) + (x + xsize, y + ysize), outline=(0), width=1) diff --git a/res/fonts/SpaceGrotesk-Light.ttf b/res/fonts/SpaceGrotesk-Light.ttf new file mode 100644 index 0000000..76a195f Binary files /dev/null and b/res/fonts/SpaceGrotesk-Light.ttf differ