Changing font size of settings widget

244 views
Skip to first unread message

Atanu Dey

unread,
Dec 11, 2013, 9:03:20 AM12/11/13
to kivy-...@googlegroups.com
Hi,

I've searched and tried to change font size of the settings widget but failed. I did following things - 

def build_settings(self, settings):
if settings:
jsondata = open("settings.json").read()
settings.add_json_panel('QTest', self.config, data=jsondata)
settings.padding = 20
#settings.size_hint = (1, 0.8)
settings.pos = (10, 10)
settings.font_size = settings.size[0]*.028
settings.text_size = (settings.size[0], None)

Padding and Position are working but font_size is not working. Can somebody suggest a way-out. In iPad, settings options text size is so tiny that I can't go with the default font-size.

Thanks

ZenCODE

unread,
Dec 11, 2013, 9:34:31 AM12/11/13
to kivy-...@googlegroups.com
Howdy

Looking at http://kivy.org/docs/api-kivy.uix.settings.html#kivy.uix.settings.Settings, settings is the layout. Then it's children are probably the widgets you are looking for (Star Wats reference intended). Try using introspection and looping over the children, setting their font size? (Or printing their type so you can find out what the children are).

Disclaimer. That may not be the best long term solution, as if anyone changes the implementation, it may well break you code....

Cheers

Alexander Taylor

unread,
Dec 11, 2013, 10:55:13 AM12/11/13
to kivy-...@googlegroups.com
There isn't really an option exposed for this right now, but there probably should be - and it sounds like the widget is also using resolution dependent fonts which likely counts as a bug. You could create an issue on kivy's github page, describing the problem so that people can fix it.

As ZenCODE says, you currently need to do some fiddling with the widget tree to get at the right properties. Actually, an easier short term solution is likely to modify kivy's style.kv file in your kivy installation to manually set the font size of the relevant widgets.
Reply all
Reply to author
Forward
0 new messages