Change font size based on if the text fits the box?

Hey,

I have font size as an exposed variable, And I can change it for specific cases, which is really helpful.

But on dynamically made text, it slightly too big.

Is there a way to have it automatically remove 5 from font size if it doesn’t fit the box?

I need like a node that’s like “If text clips or something” xD.

Ill post some pictures.

image
This is the hierachy.


Some exposed variables.

or…Alternatively Ill make the font smaller, and then scale it up to fit the box instead?