Kodi Community Forum
Change font in xml file using python? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Change font in xml file using python? (/showthread.php?tid=234090)



Change font in xml file using python? - vdb86 - 2015-08-02

Hi guys, I have another question!
I'm trying to change font in my xml script using python.
I have these in the xml:
<control type="label" id="30101">
With all other information.
<description>
<posx>
<posy>
<width>
<height>
<textcolor>
<align>
<aligny>
<label>
<font>
I'm trying to make python change the font depending on some things (It should change it to some font in the Fonts.xml).
In my python script I use self.firstlabel.setLabel to set the text I want.
But no clue how to change the font.

I was playing around with xbmcgui.ControlLabel but was unable to change the font, I'm probably not using it correctly.

Any ideas?

Thank you!


RE: Change font in xml file using python? - vdb86 - 2015-08-03

I have even tried changing <control type="label" id="30101"> to <control type="button" id="30101">
Since buttons should let us change font, color etc after creation.
I used self.firstlabel.setLabel('text','font13')
But unfortunately the font doesn't change Sad