I am making for myself a simple application, similar to Anki, for memorizing vocabulary of foreign languages, using the interval repetition method. Anki uses the Qt GUI. But I use tkinter because it is simple, does not force me to write code in the OOP style, and allows me to write in the style of structured programming.

I show the "card" in the "Label". And I noticed that the text looks less clear than in Anki. Even if I use the Arial font of the same size in both Anki and tkinter. The other fonts in Anki are a bit blurry too.

Here is a screenshot. On the left is Anki on Qt6. On the right is tkinter. Both use the Arial font of the same size.

Screenshot of Anki and Tkinter.

Why is this happening? Maybe I should use a different widget instead of a Label? Maybe I should use third-party ttk widgets? Maybe a Custom Tkinter or something similar?

Is there a way to make the white font in tkinter as clear as in Qt?

Sample code:

import tkinter as tk
from tkinter import *
from tkinter import font

field_1 = """Wednesday

[ˈwenzdeɪ]

--------------------------------------

среда"""

defalt_top_frame_bg_color = "grey17"

top_frame_bg_color: str = str(defalt_top_frame_bg_color)
top_frame_fg_color: str = "white"

bottom_frame_bg_color = "grey25"
bottom_frame_fg_color = "white"

root = Tk()
# root.title("")
root.geometry('450x500+820+1')
root.configure(background=top_frame_bg_color)

font = font.Font(root, family="Aril", size=19)

top_frame = Frame(root, background=top_frame_bg_color)
bottom_frame = Frame(root,
                     background="grey25",
                     height=60)

top_frame.grid(row=0,
               column=0,
               sticky="nsew")
bottom_frame.grid(row=1,
                  column=0,
                  sticky="nsew")

root.rowconfigure(0, weight=1)
root.columnconfigure(0, weight=1)

root.rowconfigure(1, minsize=50)


#------------------------------------------------

label1 = tk.Label(top_frame,
                  text=field_1,
                  background=top_frame_bg_color,
                  foreground=top_frame_fg_color,
                  font=font)
label1.pack(anchor="center",
            expand=True)


bottom_center_frame = Frame(bottom_frame,
                            background=bottom_frame_bg_color)
bottom_center_frame.pack(anchor="center",
                         expand=True)

btn1 = Button(bottom_center_frame,
              text="1",
              font=("arial", 12))
btn1.pack(side="left")

empty_lbl_1 = Label(bottom_center_frame,
                    background=bottom_frame_bg_color,
                    foreground=bottom_frame_fg_color)
empty_lbl_1.pack(side="left")

btn2 = Button(bottom_center_frame,
              text="2",
              font=("arial", 12))
btn2.pack(side="left")

empty_lbl_2 = Label(bottom_center_frame,
                    background=bottom_frame_bg_color,
                    foreground=bottom_frame_fg_color)
empty_lbl_2.pack(side="left")

btn3 = Button(bottom_center_frame,
              text="3",
              font=("arial", 12))
btn3.pack(side="left")

empty_lbl_3 = Label(bottom_center_frame,
                    background=bottom_frame_bg_color,
                    foreground=bottom_frame_fg_color)
empty_lbl_3.pack(side="left")

btn4 = Button(bottom_center_frame,
              text="4",
              font=("arial", 12))
btn4.pack(side="left")



root.mainloop()
0

There are 0 best solutions below