Skip to content

israel-dryer/TkFontAwesome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prefer ttkbootstrap-icons?

If you want a modern icon set for Tk/ttk, consider the unified ttkbootstrap-icons collection. It includes a dedicated Font Awesome pack: ttkbootstrap-icons-fa.

pip install ttkbootstrap-icons-fa

PyPI Downloads GitHub issues GitHub issues closed License Stars Forks Code Size

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.

example-2

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()

example-1

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

About

Use any of the 1k+ free FontAwesome icons in your tkinter application.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages