hidpi-tk


Namehidpi-tk JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/Wulian233/hidpi-tk
SummaryFixed Tkinter-based GUI window blurry on high-DPI monitors.
upload_time2024-10-05 06:03:54
maintainerNone
docs_urlNone
authorWulian233 <xiguawulian@gmail.com>
requires_python>=3.6
licenseApache 2
keywords hidpi-tk tkinter dpi highdpi blurry tkdpi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ===================
hidpi-tk
===================
.. image:: https://github.com/Wulian233/hidpi-tk/actions/workflows/ci.yml/badge.svg
    :target: https://github.com/Wulian233/hidpi-tk/actions/workflows/ci.yml
.. image:: https://codecov.io/gh/Wulian233/hidpi-tk/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/Wulian233/hidpi-tk
.. image:: https://img.shields.io/pypi/v/hidpi-tk.svg
    :target: https://pypi.python.org/pypi/hidpi-tk



``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.

.. image:: https://raw.githubusercontent.com/Wulian233/hidpi-tk/refs/heads/main/screenshot.png
    :target: https://raw.githubusercontent.com/Wulian233/hidpi-tk/refs/heads/main/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:

.. code:: python

    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.

Font scaling is called from idlelib, so the minimum required version is Python 3.6.
See: `<https://github.com/python/cpython/pull/3639>`


License
=======

``hidpi-tk`` library is offered under Apache 2 license.

Thanks
======

The library development is based on `high-dpi-tkinter <https://github.com/not-dev/high-dpi-tkinter>`_.

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Wulian233/hidpi-tk",
    "name": "hidpi-tk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "hidpi-tk, tkinter, dpi, highdpi, blurry, tkdpi",
    "author": "Wulian233 <xiguawulian@gmail.com>",
    "author_email": "xiguawulian@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/37/99/dd35ff07ef6d284d836b6c8e21cb8c35d2ab54a4f744e0668cfb109e2191/hidpi_tk-1.0.0.tar.gz",
    "platform": null,
    "description": "===================\r\nhidpi-tk\r\n===================\r\n.. image:: https://github.com/Wulian233/hidpi-tk/actions/workflows/ci.yml/badge.svg\r\n    :target: https://github.com/Wulian233/hidpi-tk/actions/workflows/ci.yml\r\n.. image:: https://codecov.io/gh/Wulian233/hidpi-tk/branch/main/graph/badge.svg\r\n    :target: https://codecov.io/gh/Wulian233/hidpi-tk\r\n.. image:: https://img.shields.io/pypi/v/hidpi-tk.svg\r\n    :target: https://pypi.python.org/pypi/hidpi-tk\r\n\r\n\r\n\r\n``hidpi-tk`` is a Python library designed to enhance Tkinter-based GUI applications\r\nby automatically adjusting DPI scaling and font sizes, particularly for high-DPI monitors.\r\n\r\n.. image:: https://raw.githubusercontent.com/Wulian233/hidpi-tk/refs/heads/main/screenshot.png\r\n    :target: https://raw.githubusercontent.com/Wulian233/hidpi-tk/refs/heads/main/screenshot.png\r\n\r\nFeatures\r\n===================\r\n\r\n- **Automatic DPI Scaling**\r\n\r\n- **Automatic Font Size Adjustment**\r\n\r\n- **Without side-effects**\r\n\r\n- **Cross-Platform**\r\n\r\nUsage\r\n===========================\r\n\r\nTo use this library, simply replace the standard ``Tk`` class with ``DPIAwareTk``.\r\nThe library will handle DPI and font adjustments automatically:\r\n\r\n.. code:: python\r\n\r\n    from hidpi_tk import DPIAwareTk\r\n    # from tkinter import Tk\r\n\r\n    # root = Tk()\r\n    root = DPIAwareTk()\r\n    # After that use like Tk instance\r\n    root.mainloop()\r\n\r\nDetails\r\n======================\r\n\r\nOn Windows systems, it provides full support for scaling on high-DPI monitors,\r\nparticularly for Windows 8.1 and newer. For older Windows systems (Vista & Win7)\r\n, it still adjusts DPI and font scaling to an extent.\r\n\r\nFor other systems, such as macOS and Linux, the operating systems themselves\r\nprovide excellent high-DPI support, so this library does not include specific\r\ncode for DPI adjustments. However, using this library is still beneficial as\r\nit adjusts font scaling, which makes cross-platform development easier and\r\nmore consistent.\r\n\r\nFont scaling is called from idlelib, so the minimum required version is Python 3.6.\r\nSee: `<https://github.com/python/cpython/pull/3639>`\r\n\r\n\r\nLicense\r\n=======\r\n\r\n``hidpi-tk`` library is offered under Apache 2 license.\r\n\r\nThanks\r\n======\r\n\r\nThe library development is based on `high-dpi-tkinter <https://github.com/not-dev/high-dpi-tkinter>`_.\r\n\r\nAdded: High-DPI font scaling support, legacy Windows support, bug fixes, and modern Python standards.\r\n",
    "bugtrack_url": null,
    "license": "Apache 2",
    "summary": "Fixed Tkinter-based GUI window blurry on high-DPI monitors.",
    "version": "1.0.0",
    "project_urls": {
        "CI: GitHub Actions": "https://github.com/Wulian233/hidpi-tk/actions/workflows/ci.yml",
        "Coverage: codecov": "https://codecov.io/github/Wulian233/hidpi-tk",
        "GitHub: issues": "https://github.com/Wulian233/hidpi-tk/issues",
        "GitHub: repo": "https://github.com/Wulian233/hidpi-tk",
        "Homepage": "https://github.com/Wulian233/hidpi-tk"
    },
    "split_keywords": [
        "hidpi-tk",
        " tkinter",
        " dpi",
        " highdpi",
        " blurry",
        " tkdpi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84ea0cb8b0c774d03cf94f487ceba7a8d4d0a5944626324d38224022e198cec0",
                "md5": "d3b5cb5ccac5de4c51b5aa3a985adb3a",
                "sha256": "7dc6664003e74084e5432938dac49d1f37bcd70750873735f97920589da3974d"
            },
            "downloads": -1,
            "filename": "hidpi_tk-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d3b5cb5ccac5de4c51b5aa3a985adb3a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 7546,
            "upload_time": "2024-10-05T06:03:52",
            "upload_time_iso_8601": "2024-10-05T06:03:52.727218Z",
            "url": "https://files.pythonhosted.org/packages/84/ea/0cb8b0c774d03cf94f487ceba7a8d4d0a5944626324d38224022e198cec0/hidpi_tk-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3799dd35ff07ef6d284d836b6c8e21cb8c35d2ab54a4f744e0668cfb109e2191",
                "md5": "3a38211e6257c7d25a2ee9a4f493228b",
                "sha256": "2f6c1921ec22d1f24d0f720cc5dfdbc764ad68c4e98f44fb9df8fb0e2ba22975"
            },
            "downloads": -1,
            "filename": "hidpi_tk-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3a38211e6257c7d25a2ee9a4f493228b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 7911,
            "upload_time": "2024-10-05T06:03:54",
            "upload_time_iso_8601": "2024-10-05T06:03:54.735380Z",
            "url": "https://files.pythonhosted.org/packages/37/99/dd35ff07ef6d284d836b6c8e21cb8c35d2ab54a4f744e0668cfb109e2191/hidpi_tk-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-05 06:03:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Wulian233",
    "github_project": "hidpi-tk",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "hidpi-tk"
}
        
Elapsed time: 0.30393s