Skip to main content

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

Project description

https://github.com/Wulian233/hidpi-tk/actions/workflows/ci.yml/badge.svg 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.

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.1.0.tar.gz (8.0 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.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hidpi_tk-1.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for hidpi_tk-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d5b6de69ccad072ca3db5836c46d57ea6d7631073e2dd00392444d2f2a2fb549
MD5 a97f2d980e73973b4664a8ce7c26a768
BLAKE2b-256 eb9e4d793dd10b3ebc277abcd740461597af2de09a98ae69e08dcfd301cd5b38

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hidpi_tk-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for hidpi_tk-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3427c2c6a4b79da3867bb4abf6f2dcb4144efd130e2fe79490c91ca5442d9710
MD5 6cb9f5fc7176e7c3b187c3feda64afcd
BLAKE2b-256 84d816ab0241a491179ffa533c219f76067bd429bdbf207c3bdef5b4d14350f6

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