On Jan 29, 2021, at 8:55 AM, Henrik R. <henrik.r...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/c7a86015-b866-4fd7-958f-bba46ee7235cn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/484d0ad2-f3c0-47e4-98a3-7c565c14ba17n%40googlegroups.com.
Here you go… If you want to change the font size dynamically you could make the font size a kivy property and use the string.format() method.
from kivy.app import App
from kivy.lang import Builder
kv = """
BoxLayout:
Label:
markup: True
text: f'[color=#3333ff][b][size={app.large_font}]MyApp[/size][/b][/color]\\nChoose language:'
"""
class MarkupApp(App):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.large_font = 40
self.small_font = 9
def build(self):
return Builder.load_string(kv)
MarkupApp().run()
--