Ah! The real goal seems to be to scale the text based upon changes to either height or width or both. Both would allow just a single shape. Hope that's correct.
The problem with char size based upon height is that wrapping is based upon the horizontal span of the text.
Going in small steps you could
a.) use the max function to set an upper limit on text size. For example, for your shape that bases the char size using shape width, you could set a max limit based upon some percent of the textbox height.
Similarly for the shape using height as the control, set the max limit to some percent of textbox width. That would avoid wrapping.
b.) use a formula that controls the char size based upon both height and width. Perhaps something like
1. char size = 0.5*(width + height) or
2. char size = sqrt(width*height) or
3. some other relationship that you find works
c.) use combination of functions to limit size in development (b.)
Something like if (char size > max height) then (set max char size), else (if char size > max width) then (set max char size),
else (use your formula) from (b). Example: if(CS>0.9*ht, CS=0.9*ht, if(CS > 0.8*width, CS=0.8*width,0.5*(width+height)))
The catenated if statements check for oversize violations and if none exist, uses the formula to calculate new size. This then allows just the need for a single shape.
HTH
Wapperdude