Skip to main content

SVG support for PhotoImage in Tk 8.6

Project description

tksvg for Python's Tkinter

Build status Build Status

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

tksvg-0.7.3.tar.gz (50.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tksvg-0.7.3-cp39-cp39-manylinux2014_x86_64.whl (50.4 kB view details)

Uploaded CPython 3.9

tksvg-0.7.3-cp38-cp38-manylinux2014_x86_64.whl (50.4 kB view details)

Uploaded CPython 3.8

tksvg-0.7.3-cp37-cp37m-manylinux2014_x86_64.whl (50.4 kB view details)

Uploaded CPython 3.7m

tksvg-0.7.3-cp36-cp36m-manylinux2014_x86_64.whl (50.4 kB view details)

Uploaded CPython 3.6m

File details

Details for the file tksvg-0.7.3.tar.gz.

File metadata

  • Download URL: tksvg-0.7.3.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for tksvg-0.7.3.tar.gz
Algorithm Hash digest
SHA256 9e6805fd1107c4af71ce8e8b754fbff10eb9a7e14bd44eccef328a1d464c88b0
MD5 3cac737ac35d95f45cdd6c16253ed8f3
BLAKE2b-256 1228940c4e8997d2a282854dc23c0a2c719a138c92fd5d6bbe8345f57ce1afaf

See more details on using hashes here.

File details

Details for the file tksvg-0.7.3-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: tksvg-0.7.3-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 50.4 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for tksvg-0.7.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fc5c3cf9bb21cbd7da06bb6e2c9bc0297be7db20000ccb6e113ad1628da164d8
MD5 44fcbd992f4582460a689a2bf4617146
BLAKE2b-256 fca43fa0588dc0a8cfea36febb5debe3ef3e2489c98b7065cdbf411f8899f801

See more details on using hashes here.

File details

Details for the file tksvg-0.7.3-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: tksvg-0.7.3-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 50.4 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for tksvg-0.7.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 197aa34d960d86509840af956d3245c8235b4ec98e90ba22f4e594a6cbd044cd
MD5 8622d6276292f85966de599e436dcb52
BLAKE2b-256 93d660b428f906f46ad3cd15050900f0bbce0529e5996abb4ecc69af08f6519a

See more details on using hashes here.

File details

Details for the file tksvg-0.7.3-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: tksvg-0.7.3-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 50.4 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for tksvg-0.7.3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 137a561affc0837dd502ff914738ef06ac342c98b877ea3779e2fb48a9cec1f6
MD5 39fe02ce00677283da8908fe66b55629
BLAKE2b-256 343861c499257c8d7e31c689e3ad9308ef1c7e86ac527b7b1c39397718cb376d

See more details on using hashes here.

File details

Details for the file tksvg-0.7.3-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: tksvg-0.7.3-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 50.4 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for tksvg-0.7.3-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3f88146b9e915ab76678f89ff05621beca741c0641093aaeab8a1e6e7c04e36
MD5 c86ad2730332c7a4fdc5c4c4d3a8a64d
BLAKE2b-256 d742ea556d9e7ee1a2c2e83baaabf73c8fadb831a71a2c78134539ef599ef460

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