Old component based UI had an option for Text called “best fit”. This would choose a font size from a given range (min/max) such that the available space is filled as much as possible without cutting off anything.
How can I achieve a “best fit” font size with UIToolkit?
I tried size: 100% but this seems to be relative to something unrelated to the current VisualElement size as well as the parent VisualElement size (in Unity 2021.2.0.f1).
For example, it does not change when I resize the parent.
- What is the reference size when using percent in a font size?
- How to make text “best fit” the current (or parent) VisualElement