Attempting to resolve blurred tkinter text + scaling on Windows 10 high DPI displays, but concerned my approach is not Pythonic or is unsafe

前端 未结 2 1129
感动是毒
感动是毒 2021-02-05 13:47

After hours of tweaking I have settled on this code which allows me to get round the familiar problem of blurry / fuzzy text in Windows 10 on high DPI displays when using Tkinte

相关标签:
2条回答
  • 2021-02-05 14:22

    Simply using windll.shcore.SetProcessDpiAwareness(1) and allowing font size adjustment solved my problems on Windows 10.

    Not sure why no one commented or assisted though. The blurry fonts are a pain, I would expect this thread had a debate and a best solution for this Tkinter nuisance..

    0 讨论(0)
  • 2021-02-05 14:44

    Not exactly answering your question but if you want to fix blurriness of tkinter windows on high dpi displays in Windows 10 (Fall Creators update) without having to insert lines of python code:

    1. Find your python.exe and pythonw.exe executables

    2. Right click on python.exe and click "Properties"

    3. Click on the "Compatibility" tab

    4. Click the "Change high DPI settings" button

    5. Tick "Override high DPI scaling behaviour" and select "Application" in the drop-down menu

    6. Repeat for pythonw.exe if necessary

    0 讨论(0)
提交回复
热议问题