I want to fix my label width for whatever 10 character long is for given font.
Even label string length is 3 chars, i want it to have 10 character long width. How to achieve that?
Even label string length is 3 chars, i want it to have 10 character long width
That’s actually impossible to correctly predict a width of an unknown string, unless you’re using a monospaced font like Courier.
See this example below, both of these strings are 10 characters long, but have a vastly different width:
iiiiiiiiii
wwwwwwwwww
In the monospaced font, both of these would have the same width:
1. iiiiiiiiii
2. wwwwwwwwww
I think you need to pivot your idea to something else. If you gave us a bit more context of your issue, what you’re exactly trying to achieve, including some screenshots and whatnot, maybe we can help you decide the best course of action.
Sorry why i want this feature, let me show you,
I need this for a countdown label with bordered background. And the width is jiggling, wobbling 3-5 pixel for each frame which is a disturbing look.
Either use a monospace font, or make a Label for each character with a fixed width, filling each label with a single character from the string via script.
to skip complexity → have you tried setting the min width to the size which doesn’t wobble ? … basically making the min width the widest possible case.