- Edited
Hello @ all,
I would like to display in a label taxt with the maximum font size. So that all characters are still readable. I have already found a solution which works. However, my code (exported to an Android phone) needs a small eternity during execution and is not usable.
fragenLabel.visible = false
fragenLabel.text = new_text
dynamic_font_size = 112
dynamic_font_frage.size = dynamic_font_size
fragenLabel.add_font_override("font", dynamic_font_frage)
while (fragenLabel.get_line_count() > fragenLabel.get_visible_line_count()):
dynamic_font_size -= 2
if (dynamic_font_size <= 42):
break
dynamic_font_frage.size = dynamic_font_size
fragenLabel.add_font_override("font", dynamic_font_frage)
fragenLabel.visible = true
Does anyone have any other ideas? I am thankful for any tip, best regards cya Thommy