Font size is not a property of the theme, it's a property of Font
. Or more specifically, DynamicFont
. So to change the font size of all your controls, you have to get the font (from the theme, from the control, or just load
it) and set its size
property.
If you want this to be applied only to specific controls, you may want to make another version of that font (but using the same DynamicFontData
), or make a duplicate in code, set its size and add a font override to the control. In code, that's done with add_font_override()
.
In regard to the above, if a player wants to change fonts size of the game, you'd have to get all dynamic fonts in your project and set their size.
Note that if you did use multiple fonts in your project, you may want to keep them loaded when the game runs by maintaining a reference to them, so the change will persist. The reason is, in Godot, resources that are not referenced by anything are unloaded, which would make the size override to revert to what it was in the resource file. However if you have only one main font referenced in your Theme
, you won't need this.