Simple helper functions to make easier to use icon fonts in Labels and derived widgets
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:
iconfonts.register('default_font', 'iconfont_sample.ttf', 'iconfont_sample.fontd')
In your kv file or string:
#: import icon kivy.garden.iconfonts.icon
Button:
markup: True # Always turn markup on
text: "%s"%(icon('icon-comment'))
See init.py for another example.
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
iconfonts.create_fontdict_file('font-awesome.css', 'font-awesome.fontd')
MIT (except sample font that I got from http://fontello.com)
Author: Jeyson Molina jeyson.mco@gmail.com