Hayden Ravenscroft
Hayden Ravenscroft

Reputation: 101

Improving the look of tkinter fonts on a High DPI screen

When using tkinter to create a more modern looking application, I looked to MS Word to inspire my design. Then I noticed that only when I'm using the application on a High DPI device that it looks so terrible.

Example Image

Is there a way to compensate and make it look just as crisp?

NOTE: "Don't use tkinter" is not on the table.

Upvotes: 0

Views: 1613

Answers (2)

Anas Hamad
Anas Hamad

Reputation: 11

Try typing this at the beginning of your code

try:
    from ctypes import windll
    windll.shcore.SetProcessDpiAwareness(1)
except:
    pass

I think this will solve your problem.

Upvotes: 0

Hayden Ravenscroft
Hayden Ravenscroft

Reputation: 101

The best solution I have found for this is to create a custom widget using the WCK (Widget Construction Kit). Text displayed using this is automatically Anti-Aliased.

Upvotes: 0

Related Questions