Metadata-Version: 2.4
Name: tkfontawesome
Version: 0.3.1
Summary: Use any of the 2k+ free FontAwesome icons in your tkinter application.
Author-email: Israel Dryer <israel.dryer@gmail.com>
License: MIT License
        
        Copyright (c) 2021 Israel Dryer
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/israel-dryer/tkfontawesome
Project-URL: Repository, https://github.com/israel-dryer/tkfontawesome
Project-URL: Issues, https://github.com/israel-dryer/tkfontawesome/issues
Keywords: svg,fontawesome,icons,tkinter,ttk
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lxml==5.4.0
Requires-Dist: tksvg==0.7.4
Dynamic: license-file

[![PyPI](https://img.shields.io/pypi/v/tkfontawesome.svg)](https://pypi.org/project/tkfontawesome/)
[![Downloads](https://static.pepy.tech/badge/tkfontawesome/month)](https://pepy.tech/project/tkfontawesome)
[![GitHub issues](https://img.shields.io/github/issues/israel-dryer/tkfontawesome.svg)](https://github.com/israel-dryer/tkfontawesome/issues)
[![GitHub issues closed](https://img.shields.io/github/issues-closed/israel-dryer/tkfontawesome.svg)](https://github.com/israel-dryer/tkfontawesome/issues?q=is%3Aissue+is%3Aclosed)
[![License](https://img.shields.io/github/license/israel-dryer/tkfontawesome.svg)](https://github.com/israel-dryer/tkfontawesome/blob/main/LICENSE)
[![Stars](https://img.shields.io/github/stars/israel-dryer/tkfontawesome.svg)](https://github.com/israel-dryer/tkfontawesome/stargazers)
[![Forks](https://img.shields.io/github/forks/israel-dryer/tkfontawesome.svg)](https://github.com/israel-dryer/tkfontawesome/network)
[![Code Size](https://img.shields.io/github/languages/code-size/israel-dryer/tkfontawesome)](https://github.com/israel-dryer/tkfontawesome)

# TkFontAwesome

> Requires Python **3.8+**

A library that enables you to use [FontAwesome icons](https://fontawesome.com/v6/icons?o=r&m=free)
in your tkinter application.

You may use any of the 2k+ *free* [FontAwesome 6.5 icons](https://fontawesome.com/v6/icons?o=r&m=free).
The **fill color** and **size** are customized to your specifications and then converted
to an object via [tksvg](https://pypi.org/project/tksvg/) that can be used anywhere you would use a `tkinter.PhotoImage` object.

![example-2](https://raw.githubusercontent.com/israel-dryer/TkFontAwesome/main/assets/example-2.png)

## Installation

```shell
python -m pip install tkfontawesome
```

## Usage

```python
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](https://raw.githubusercontent.com/israel-dryer/TkFontAwesome/main/assets/example-1.png)

## API: `icon_to_image()`

```python
(
    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](https://fontawesome.com/license/free) license applies to all FontAwesome *free* icons used in the library.
The MIT License applies to all other work.

---

**Author**: [Israel Dryer](https://github.com/israel-dryer)
📦 Available on [PyPI](https://pypi.org/project/tkfontawesome/) | 🐙 [GitHub](https://github.com/israel-dryer/tkfontawesome)
