Adjust text-size to fit to fixed-sized input or display field

Is it possible to tell the program to adjust text size to fit a fixed-size text box? so when the character count increases, the text size decreases

Exactly the opposite of shrinking a text-box to the text, instead i want to shrink text to the box-size, not cut off content, rather adjust text size

Maybe somebody can write me a formula to put in a condition that says : If Character count increase then text size decrease based on a percent, so i shouldnt have to specify all possible character counts with a separate condition


Would love an answer to this as well.