Skip to main content

Fixed Tkinter-based GUI window blurry on high-DPI monitors.

Project description

https://img.shields.io/pypi/v/hidpi-tk.svg

hidpi-tk is a Python library designed to enhance Tkinter-based GUI applications by automatically adjusting DPI scaling and font sizes, particularly for high-DPI monitors.

./screenshot.png

Features

  • Automatic DPI Scaling

  • Automatic Font Size Adjustment

  • Without side-effects

  • Cross-Platform

Usage

To use this library, simply replace the standard Tk class with DPIAwareTk. The library will handle DPI and font adjustments automatically:

from hidpi_tk import DPIAwareTk
# from tkinter import Tk

# root = Tk()
root = DPIAwareTk()
# After that use like Tk instance
root.mainloop()

Details

On Windows systems, it provides full support for scaling on high-DPI monitors, particularly for Windows 8.1 and newer. For older Windows systems (Vista & Win7) , it still adjusts DPI and font scaling to an extent.

For other systems, such as macOS and Linux, the operating systems themselves provide excellent high-DPI support, so this library does not include specific code for DPI adjustments. However, using this library is still beneficial as it adjusts font scaling, which makes cross-platform development easier and more consistent.

License

hidpi-tk library is offered under Apache 2 license.

Thanks

The library development is based on high-dpi-tkinter.

Added: High-DPI font scaling support, legacy Windows support, bug fixes, and modern Python standards.

Developed from v1, the original project has now been completely rewritten.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hidpi_tk-1.4.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hidpi_tk-1.4.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file hidpi_tk-1.4.0.tar.gz.

File metadata

  • Download URL: hidpi_tk-1.4.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for hidpi_tk-1.4.0.tar.gz
Algorithm Hash digest
SHA256 4c752a7566537228f12ebcd4e50d3acef2e21edc80d53e61074801f3870f1a3f
MD5 d8ce079f45ac80d25d76299f762f73be
BLAKE2b-256 480a7a636025c0fd2af031f08ee0b76b225064c2f2442dade9db27640266c7d2

See more details on using hashes here.

File details

Details for the file hidpi_tk-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: hidpi_tk-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for hidpi_tk-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eea482733719c7788d5124aa4dcd4bbb4b0cc354ef670d0cbfa30b10701ce02e
MD5 56a5da47b374f4db00f1506d4aa5d6ed
BLAKE2b-256 d88f67e02e49ef38eb78479d1bc368d2c46b31eec81b92ce279ed17ca5e0d199

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page