kivy-garden / garden.iconfonts

Simple helper functions to make easier to use icon fonts in Labels and derived widgets
MIT License
32 stars 9 forks source link

error with garden.iconfonts working #6

Open ShristiBisht opened 4 years ago

ShristiBisht commented 4 years ago

... BuilderException: Parser: File "c:\Users\shris\PycharmProjects\PPLAB\Mini Project\mainclass.kv", line 31: ... 29: points: [0,self.size[1],self.size[0], self.size[1],self.size[0],self.size[1]-(.4*self.size[1])] 30: Label:

31: text: "%s"%(icon('fa-bold')) 32: font_size: mtx.sp('34') 33: markup: True ... IndexError: list index out of range File "C:\Users\shris\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\lang\builder.py", line 249, in create_handler return eval(value, idmap), bound_list File "c:\Users\shris\PycharmProjects\PPLAB\Mini Project\mainclass.kv", line 31, in text: "%s"%(icon('fa-bold')) File "c:\Users\shris\PycharmProjects\PPLAB\Mini Project\libs\garden\garden.iconfonts\iconfonts.py", line 31, in icon font = list(_register.keys())[0] if font_name is None else font_name

File "C:\Users\shris\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\lang\builder.py", line 692, in _apply_rule rctx['ids']) File "C:\Users\shris\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\lang\builder.py", line 254, in create_handler cause=tb)

My .kv file

:kivy 1.11.1

:import rgba kivy.utils.rgba

:import mtx kivy.metrics

:import icon kivy.garden.iconfonts.icon

Label: text: "%s"%(icon('fa-bold')) font_size: mtx.sp('34') markup: True

pwdavari commented 4 years ago

@ShristiBisht Were you able to resolve this or figure out another way to incorporate kivy metrics sp functionality?