Use any of the 1k+ free FontAwesome icons in your tkinter application.
Project description
TkFontAwesome
A library that enables you to use FontAwesome icons in your tkinter application.
You may use any of the 1k+ free FontAwesome 5.0 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()
tkfontawesome.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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tkfontawesome-0.2.0.tar.gz
(405.4 kB
view hashes)
Built Distribution
tkfontawesome-0.2.0-py3-none-any.whl
(406.0 kB
view hashes)
Close
Hashes for tkfontawesome-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbd072550f813f5611d04751b6c8b5d6706b01140df3e15e7762bbc05cd12f10 |
|
MD5 | 418c9f702d6307af2b1968b9c8a8e2ff |
|
BLAKE2b-256 | dc4ea645b4931fe9e08bcb0debd2438e354b8b885de796fdba31ae3e508bc201 |