mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
fixed font loading init
This commit is contained in:
parent
afe44f4ff7
commit
4b48bf57b2
@ -27,6 +27,8 @@ FontManager.load_font(os.path.join(script_directory, "assets", "fonts", "Roboto"
|
|||||||
# load font necessary for rendering the widgets on Windows, Linux
|
# load font necessary for rendering the widgets on Windows, Linux
|
||||||
if FontManager.load_font(os.path.join(script_directory, "assets", "fonts", "CustomTkinter_shapes_font-fine.otf")) is True:
|
if FontManager.load_font(os.path.join(script_directory, "assets", "fonts", "CustomTkinter_shapes_font-fine.otf")) is True:
|
||||||
Settings.circle_font_is_ready = True
|
Settings.circle_font_is_ready = True
|
||||||
|
else:
|
||||||
|
Settings.circle_font_is_ready = False
|
||||||
|
|
||||||
if Settings.preferred_drawing_method == "font_shapes":
|
if Settings.preferred_drawing_method == "font_shapes":
|
||||||
sys.stderr.write("customtkinter.__init__ warning: " +
|
sys.stderr.write("customtkinter.__init__ warning: " +
|
||||||
|
@ -10,8 +10,10 @@ try:
|
|||||||
sys.stderr.write("WARNING: You have to update the darkdetect library: pip3 install --upgrade darkdetect\n")
|
sys.stderr.write("WARNING: You have to update the darkdetect library: pip3 install --upgrade darkdetect\n")
|
||||||
if sys.platform != "darwin":
|
if sys.platform != "darwin":
|
||||||
exit()
|
exit()
|
||||||
except:
|
except ImportError as err:
|
||||||
pass
|
raise err
|
||||||
|
except Exception:
|
||||||
|
sys.stderr.write("customtkinter.appearance_mode_tracker warning: failed to import darkdetect")
|
||||||
|
|
||||||
|
|
||||||
class AppearanceModeTracker:
|
class AppearanceModeTracker:
|
||||||
|
@ -29,9 +29,9 @@ f4.grid(row=0, column=3, rowspan=1, columnspan=1, sticky="nsew")
|
|||||||
f4.grid_columnconfigure(0, weight=1)
|
f4.grid_columnconfigure(0, weight=1)
|
||||||
|
|
||||||
for i in range(0, 21, 1):
|
for i in range(0, 21, 1):
|
||||||
#b = customtkinter.CTkButton(f1, corner_radius=i, current_height=34, border_width=2, text=f"{i} {i-2}",
|
b = customtkinter.CTkButton(f1, corner_radius=i, height=34, border_width=2, text=f"{i} {i-2}",
|
||||||
# border_color="white", fg_color=None, text_color="white")
|
border_color="white", fg_color=None, text_color="white")
|
||||||
b = tkinter.Button(f1, text=f"{i} {i-2}", width=20)
|
# b = tkinter.Button(f1, text=f"{i} {i-2}", width=20)
|
||||||
b.grid(row=i, column=0, pady=5, padx=15, sticky="nsew")
|
b.grid(row=i, column=0, pady=5, padx=15, sticky="nsew")
|
||||||
|
|
||||||
b = customtkinter.CTkButton(f2, corner_radius=i, height=34, border_width=0, text=f"{i}",
|
b = customtkinter.CTkButton(f2, corner_radius=i, height=34, border_width=0, text=f"{i}",
|
||||||
@ -46,5 +46,4 @@ for i in range(0, 21, 1):
|
|||||||
border_color="gray10", fg_color="#228da8")
|
border_color="gray10", fg_color="#228da8")
|
||||||
b.grid(row=i, column=0, pady=5, padx=15, sticky="nsew")
|
b.grid(row=i, column=0, pady=5, padx=15, sticky="nsew")
|
||||||
|
|
||||||
customtkinter.Settings.print_settings()
|
|
||||||
app.mainloop()
|
app.mainloop()
|
||||||
|
Loading…
Reference in New Issue
Block a user