Repos / mcross / 51163dbfdd
commit 51163dbfddc5e3923fb8734506cba73fc96c4e17
Author: Bùi Thành Nhân <hi@imnhan.com>
Date: Thu May 14 23:44:16 2020 +0700
customizable fallback font for pick_font()
diff --git a/src/mcross/gui/view.py b/src/mcross/gui/view.py
index 6565cba..602187a 100644
--- a/src/mcross/gui/view.py
+++ b/src/mcross/gui/view.py
@@ -15,7 +15,7 @@ def pick_font(names):
break
if not picked:
- picked = "TkTextFont"
+ picked = names[-1]
print("Picked font:", picked)
return picked
@@ -77,9 +77,10 @@ def __init__(self, root: Tk, model: Model):
"DejaVu Serif",
"Times New Roman",
"Times",
+ "TkTextFont",
]
)
- mono_font = pick_font(["Ubuntu Mono", "Consolas", "Courier"])
+ mono_font = pick_font(["Ubuntu Mono", "Consolas", "Courier", "TkFixedFont"])
text.config(
font=(text_font, 13), bg="#fff8dc", fg="black", padx=5, pady=5,
)