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
Release files for tkfontawesome 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tkfontawesome-0.3.2.tar.gz | 480.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tkfontawesome-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 961.2 kB
Release files / tkfontawesome-0.3.2.tar.gz
| Download URL | tkfontawesome-0.3.2.tar.gz |
|---|---|
| Size | 480.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8286d8be06d537e18bc670a0211b13af222ac564d6e0211608dfff97653eefde
|
|
BLAKE2b-256 checksum How to use checksums |
059d13464ad97c6440234da802db4f681386341d8f78f4823c459dcb15c8bfb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / tkfontawesome-0.3.2-py3-none-any.whl
| Download URL | tkfontawesome-0.3.2-py3-none-any.whl |
|---|---|
| Size | 480.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12b56d86206c5fc719012f5770f40d408da7acd59f6ea08bc07ce5cd921fab2a
|
|
BLAKE2b-256 checksum How to use checksums |
a460cb35ababbb3fd09eb0e7b9008e9a787cc77c553a2811280cd5d0068f6601
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|