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.2.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.2.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hidpi_tk-1.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 3ab415bc79677c1bdf6c8dbcc338fd8e60650963d32a74eb14128e55ae8c8dc7
MD5 97aab1c0fc160f1e3d6e7bb2112440a8
BLAKE2b-256 655d7cf07da4be10a34156514555ee86cd5bd4cf70f6a5a618af2b57480c07c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hidpi_tk-1.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30146f774b2f495df218685c27ffbc92d0cac6fac2af6aa8569ca0596ad414a9
MD5 37499d748ba66b2e9504f8ef0ef20082
BLAKE2b-256 968c3d2f2e5eceba507ad19db118868eac3ec52ee79ff4ed810baa5be2629fab

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