SVG support for PhotoImage in Tk 8.6
Project description
tksvg for Python's Tkinter
tksvg is a package for Tcl/Tk that
adds support for SVG image files. Tkinter makes use of Tcl/Tk under the
hood, and thus can benefit from this addition. Note that SVG support
has been included in Tk 8.7 and thus this package can be made obsolete
in the future when Python gets distributed with Tk 8.7. This repository
is merely a repackaging of the tksvg
library for Python with a
modified build system.
Building and installation
This package makes use of the same build system as gttk
and other Tcl C-extensions with CMake. This means that on both Windows
and Linux you will need a working CMake installation that can find the
Tcl development files. If you wish to build with Visual Studio, you can
build with the build system of the upstream.
Linux
Adapt the commands to your specific distribution. The commands given here assume Ubuntu 20.04.
sudo apt install cmake build-essential tcl-dev tk-dev python3-tk
python -m pip install scikit-build
python setup.py install
Windows
Due to the rolling-release type distribution of MSYS, no up-to-date
build instructions are provided in this file. Please refer to the
AppVeyor build configuration in .appveyor.yml
to derive the latest
build instructions. Some general pointers:
- The commands assume that you have a working MSYS2 environment. If you do not have this, you'll have to set it up to make use of the Windows build system.
- Dependencies of the compiled binaries are detected and found using
Dependencies. Make sure it
is available before running the
setup.py install
command. - The AppVeyor configuration may have to work around bugs in MSYS that
you might not encounter if you're using a different version. If you're
confused by how the dependencies are installed, simply refer to the
list found in
setup.py
.
Usage
Using the library has been made as similar as possible to using a normal
tk.PhotoImage
. Simply create an SvgImage
instance and the tksvg
library will automatically be loaded for you.
import tkinter as tk
import tksvg
window = tk.Tk()
svg_image = tksvg.SvgImage(file="tests/orb.svg")
label = tk.Label(image=svg_image)
label.pack()
window.mainloop()
License & Copyright
This repository merely provides a version of the original tksvg
for Python's Tkinter. The package is available under the BSD-like
Tcl License.
The build system (setup.py
, .appveyor.yml
and .travis.yml
) are
available under the terms of GNU GPLv3,
as any changes to these should be shared under permissive terms so as to
preserve the possibility of building these packages.
Copyright (C) 2002-2004 Maxim Shemanarev http://antigrain.com
Copyright (c) 2013-14 Mikko Mononen memon@inside.org
Copyright (c) 2018 Christian Gollwitzer auriocus@gmx.de
Copyright (c) 2018 Christian Werner https://www.androwish.org/
Copyright (c) 2018 Rene Zaumseil r.zaumseil@freenet.de
Copyright (c) 2020 Juliette Monsel
Copyright (c) 2021 RedFantom <redfantom@outlook.com>
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
Built Distributions
File details
Details for the file tksvg-0.7.4.tar.gz
.
File metadata
- Download URL: tksvg-0.7.4.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e451c4301814306547afca80680e6db0cc6720b7d6cc3dca56beb17c2b29c0f5 |
|
MD5 | 7fce7682464f5006ce95cd0fee3a2404 |
|
BLAKE2b-256 | c57339960696fa563162edcf21bef52453cc7cfb965a0bb1e413730237de0aa3 |
File details
Details for the file tksvg-0.7.4-py3-none-win_amd64.whl
.
File metadata
- Download URL: tksvg-0.7.4-py3-none-win_amd64.whl
- Upload date:
- Size: 173.3 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e96830e3e92d12390aee3460dab2aab169bd3b1cb59ba478329c1e6bc3edd2a |
|
MD5 | 03c9806522e794b9c5a7ce8112881484 |
|
BLAKE2b-256 | c131bb2da3f9ea480b273d3319430e24bb74e8b202fb8a90fa0a3689b9e5c51f |
File details
Details for the file tksvg-0.7.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: tksvg-0.7.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 50.0 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2baa23b1f07cb88199a05c8bee825522520fd780ed3365bd54803407ffd03780 |
|
MD5 | 1b8c05875c96f77ee9919e5210ee698a |
|
BLAKE2b-256 | e168f25753893ab9b01876993dcf5b4674cafcb4aa7cde35d0e34877638bffd4 |
File details
Details for the file tksvg-0.7.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: tksvg-0.7.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 50.0 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad6991c1a9fdca48f1a195519facb8c8a2c3cb1c3443b9910b39600e8bf63d0d |
|
MD5 | b35eb53ffbad458dce10dbbe26164f18 |
|
BLAKE2b-256 | 59950ed77223f0bef438012ce30fbeb569d4cad2ae519a9b0981a82fe67ef68a |
File details
Details for the file tksvg-0.7.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: tksvg-0.7.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 50.0 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0771586ba3bf56443185ae29fa2d49619c9d208f0dee4f2fefb4a6bad7edc7f0 |
|
MD5 | a7ddd24d1ce938566196b840d3f55dbc |
|
BLAKE2b-256 | e35f49b15f80e85a63139fd98355b238e808e70590b5f092b7daba72cfba65ba |
File details
Details for the file tksvg-0.7.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: tksvg-0.7.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 50.0 kB
- Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be180c76c4a417f5ddaa2a08e39df5177e32a1d2698f9cdc241d5e42b6bf69d7 |
|
MD5 | dc9bd5f9e4598954fa35b4943f9ff0f7 |
|
BLAKE2b-256 | 00f14e801108db693491f111ab9955b1af4981e16656a5a4f65f0aa7cdb3e71e |