Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kivy-garden/garden.iconfonts
Simple helper functions to make easier to use icon fonts in Labels and derived widgets
https://github.com/kivy-garden/garden.iconfonts
Last synced: about 1 month ago
JSON representation
Simple helper functions to make easier to use icon fonts in Labels and derived widgets
- Host: GitHub
- URL: https://github.com/kivy-garden/garden.iconfonts
- Owner: kivy-garden
- License: mit
- Created: 2015-02-24T23:15:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-06-28T12:50:34.000Z (over 7 years ago)
- Last Synced: 2023-03-30T18:26:09.884Z (over 1 year ago)
- Language: Python
- Size: 34.2 KB
- Stars: 30
- Watchers: 9
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Screenshot](https://github.com/jeysonmc/garden.iconfonts/blob/master/screenshot.png "Scrennshot")
Kivy-iconfonts
==============Simple helper functions to make easier to use icon fonts in Labels and derived widgets
Usage
=====Once you have a .fontd file (see below) for your ttf iconfont generated you can use it like this:
In your main.py register your font:
```python
iconfonts.register('default_font', 'iconfont_sample.ttf', 'iconfont_sample.fontd')
```In your kv file or string:
```yaml
#: import icon kivy.garden.iconfonts.icon
Button:
markup: True # Always turn markup on
text: "%s"%(icon('icon-comment'))
```
See __init__.py for another example.Generating a fontd file
=====================A .fontd file is just a python dictionary filled with icon_code: unicode_value entries. This information is extracted from a css file (all iconfonts packages I've seen have one).
**Example with Font-Awesome**
1. Download Font-Awesome (http://fortawesome.github.io/Font-Awesome/)
2. Copy both the TTF and CSS files (fonts/fontawesome-webfont.ttf and css/font-awesome.css) to your project
3. Create and execute a python script to generate your fontd file:
```python
iconfonts.create_fontdict_file('font-awesome.css', 'font-awesome.fontd')
```
4. If everything went well your font dictionary file exists. You can delete the css file (font-awesome.css)More IconFonts
==============
- http://fortawesome.github.io/Font-Awesome/
- http://fontello.com/
- https://icomoon.ioLICENSE
=======MIT (except sample font that I got from http://fontello.com)
Credits
=======Author: Jeyson Molina