Show glyph name under preview

This commit is contained in:
mrkubax10 2024-03-03 19:16:11 +01:00
parent 5ef7a7fcc0
commit fd356b5aa8

View File

@ -89,8 +89,11 @@ def number_only_validate(val):
def update_glyph_preview():
global canvas_editor
global canvas_preview
global label_glyph_name
canvas_preview.delete("all")
canvas_preview.create_text((50,100),text=chr(canvas_editor.current_char),fill="white",font="tkDefaultFont 70")
name=unicodedata.name(chr(canvas_editor.current_char),"unknown")
label_glyph_name.config(text=f"{name} U+{canvas_editor.current_char:04x}")
window=tkinter.Tk()
@ -113,7 +116,7 @@ frame_controls.pack(side="right")
canvas_preview=tkinter.Canvas(frame_controls,width=100,height=200,bg="black")
canvas_preview.pack(side="top")
label_glyph_name=tkinter.Label(frame_controls,text="Placeholder")
label_glyph_name=tkinter.Label(frame_controls)
label_glyph_name.pack(side="top")
frame_nav=tkinter.Frame(frame_controls)