https://github.com/matfax/kivysome
Font Awesome 5 Icons for Kivy
https://github.com/matfax/kivysome
awesome fa font icons kivy
Last synced: 3 months ago
JSON representation
Font Awesome 5 Icons for Kivy
- Host: GitHub
- URL: https://github.com/matfax/kivysome
- Owner: matfax
- License: mit
- Fork: true (kivy-garden/garden.iconfonts)
- Created: 2019-10-27T11:58:53.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-07-14T13:27:12.000Z (almost 2 years ago)
- Last Synced: 2024-04-29T08:45:01.853Z (about 1 year ago)
- Topics: awesome, fa, font, icons, kivy
- Language: Python
- Homepage: https://pypi.org/project/kivysome/
- Size: 296 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kivysome
[](https://github.com/matfax/kivysome/actions)
[](https://codecov.io/gh/matfax/kivysome)
[](https://github.com/matfax/kivysome/network/updates)
[](https://libraries.io/pypi/kivysome)
[](https://www.codefactor.io/repository/github/matfax/kivysome)
[](https://github.com/PyCQA/bandit)
[](https://github.com/psf/black)
[](https://pypi.org/project/kivysome/)
[](https://pypi.org/project/kivysome/)
[](https://pypistats.org/packages/kivysome)
[](https://github.com/matfax/kivysome/blob/master/LICENSE)
[](https://github.com/matfax/kivysome/commits/master)Font Awesome 5 Icons for Kivy
## Usage
### Enable it
#### Using a version
This will only work for free versions of Font Awesome.
```python
import kivysome
kivysome.enable(kivysome.LATEST, group=kivysome.FontGroup.REGULAR)
```#### Using a kit
Kits will not be maintained any further.
They will work as long as Font Awesome don't change their API.##### 1. Generate your kit
Go to [Font Awesome](https://fontawesome.com/kits) and generate your kit there.
The specified version is respected.
For the moment, only free licenses are supported.##### 2. Enable it
In your main.py register your font:
```python
import kivysome
kivysome.enable("https://kit.fontawesome.com/{YOURCODE}.js", group=kivysome.FontGroup.SOLID)
```### 3. Use it
In your `.kv` file or string, reference the short Font Awesome (i.e., without `fa-` prefix) as you can copy them from their website.
```yaml
#: import icon kivysome.icon
Button:
markup: True # Always turn markup on
text: "%s Comment" % icon('comment', 24)
```## Caching
Kivysome will cache the files in the font folder and not redownload them from GitHub.
If a kit is given, however, the kit version will have to be fetched from Font Awesome on every execution.
If `kivysome.LATEST` is given, the latest version will also have to be determined from GitHub's servers.
Font packs will only be downloaded if new versions are published, then.
To completely avoid regular server access, a pinned version will have to be given.
The initial download can also be circumvented by downloading it a single time on the developer's machine and publishing
the downloaded `fonts` folder with the project. The folder should then contain a `.css`, `.fontd`, and a `.ttf` file
matching the pinned Font Awesome version and font group.Check the `examples` folder for more insight.