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.
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.
Release files for hidpi-tk 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hidpi_tk-1.4.0.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hidpi_tk-1.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:18.6 kB
Release files / hidpi_tk-1.4.0.tar.gz
| Download URL | hidpi_tk-1.4.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c752a7566537228f12ebcd4e50d3acef2e21edc80d53e61074801f3870f1a3f
|
|
BLAKE2b-256 checksum How to use checksums |
480a7a636025c0fd2af031f08ee0b76b225064c2f2442dade9db27640266c7d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / hidpi_tk-1.4.0-py3-none-any.whl
| Download URL | hidpi_tk-1.4.0-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eea482733719c7788d5124aa4dcd4bbb4b0cc354ef670d0cbfa30b10701ce02e
|
|
BLAKE2b-256 checksum How to use checksums |
d88f67e02e49ef38eb78479d1bc368d2c46b31eec81b92ce279ed17ca5e0d199
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|