'afterEffect, How to automatically shrink the text?

I want to make an AE template for others to use, in which I want the text to always be within the specified range. If the text content increases, it will automatically shrink.

Like This:

enter image description here

Please How to set this effect, or how to write the expression



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source