From 5ef7a7fcc0dd27b9c70dcb0616f489b8d33ca62e Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Sun, 3 Mar 2024 17:55:29 +0100 Subject: [PATCH] Show glyph preview --- main.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index d5e32f4..f8453ad 100644 --- a/main.py +++ b/main.py @@ -43,6 +43,7 @@ def menu_file_open_project_click(): finally: canvas_editor.after_project_load() canvas_editor.draw() + update_glyph_preview() def menu_file_save_project_click(): @@ -71,17 +72,27 @@ def menu_file_save_project_as_click(): pass def button_prev_glyph_click(): + global canvas_editor canvas_editor.prev_glyph() - + update_glyph_preview() def button_next_glyph_click(): + global canvas_editor canvas_editor.next_glyph() + update_glyph_preview() def number_only_validate(val): return str.isdigit(val) or val=="" +def update_glyph_preview(): + global canvas_editor + global canvas_preview + canvas_preview.delete("all") + canvas_preview.create_text((50,100),text=chr(canvas_editor.current_char),fill="white",font="tkDefaultFont 70") + + window=tkinter.Tk() window.title("fonteditor") window.geometry(f"{WINDOW_SIZE[0]}x{WINDOW_SIZE[1]}")