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.

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.3.1.tar.gz (8.8 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.3.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hidpi_tk-1.3.1.tar.gz
Algorithm Hash digest
SHA256 f89a79e2d6f77c04965273d3f63a01e4a6c9bbad9711a51abc97710f8aa1c37b
MD5 e662406e6410309563f37940ee95c1e1
BLAKE2b-256 13ddebf146c76cf2d0696036d0360cac9074e38d963d617220a2b46fe68d04e4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hidpi_tk-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f485d5f257711ee80416b2a5e7975e8344ac2f2d5f6462ee717057b42c6a3da3
MD5 9608843ba7f78abd369aab541188a0ba
BLAKE2b-256 039e8567acd18f4805c0eaab0d63c89fd6c0f9363c3933ec84fef1b255af1975

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