Use any of the 2k+ free FontAwesome icons in your tkinter application.
Project description
TkFontAwesome
Requires Python 3.8+
A library that enables you to use FontAwesome icons in your tkinter application.
You may use any of the 2k+ free FontAwesome 6.5 icons.
The fill color and size are customized to your specifications and then converted
to an object via tksvg that can be used anywhere you would use a tkinter.PhotoImage
object.
Installation
python -m pip install tkfontawesome
Usage
import tkinter as tk
from tkfontawesome import icon_to_image
root = tk.Tk()
fb = icon_to_image("facebook", fill="#4267B2", scale_to_width=64)
send = icon_to_image("paper-plane", fill="#1D9F75", scale_to_width=64)
tk.Label(root, image=fb).pack(padx=10, pady=10)
tk.Button(root, image=send).pack(padx=10, pady=10)
root.mainloop()
API: icon_to_image()
(
name=None,
fill=None,
scale_to_width=None,
scale_to_height=None,
scale=1
)
Parameters
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the FontAwesome icon. | None |
fill | str | The fill color of the svg path. | None |
scale_to_width | int | Adjust image width to this size (in pixels); maintains aspect ratio. | None |
scale_to_height | int | Adjust image height to this size (in pixels); maintains aspect ratio. | None |
scale | float | Scale the image width and height by this factor. | 1 |
License
The CC BY 4.0 license applies to all FontAwesome free icons used in the library. The MIT License applies to all other work.
Author: Israel Dryer 📦 Available on PyPI | 🐙 GitHub
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 Distribution
File details
Details for the file tkfontawesome-0.3.2.tar.gz
.
File metadata
- Download URL: tkfontawesome-0.3.2.tar.gz
- Upload date:
- Size: 480.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8286d8be06d537e18bc670a0211b13af222ac564d6e0211608dfff97653eefde
|
|
MD5 |
1d4d43185c98a82d94a85d64de3363bc
|
|
BLAKE2b-256 |
059d13464ad97c6440234da802db4f681386341d8f78f4823c459dcb15c8bfb0
|
File details
Details for the file tkfontawesome-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: tkfontawesome-0.3.2-py3-none-any.whl
- Upload date:
- Size: 480.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
12b56d86206c5fc719012f5770f40d408da7acd59f6ea08bc07ce5cd921fab2a
|
|
MD5 |
56735e759d360c180e2d3ae9b5809ee2
|
|
BLAKE2b-256 |
a460cb35ababbb3fd09eb0e7b9008e9a787cc77c553a2811280cd5d0068f6601
|