Adjusting text size to fit into defined space automatically (shrinking / enlarging)

Hello,

I’m researching how to enable a static scene but with text that is unknown in length (on the scale of 30 to 150 characters, as an order of magnitude.)

I’ve looked into nativlay supported blender features but couldn’t find something that seems to solve the problem.

Could you please advise? Has someone implemented this before, or perhaps knows of a good feature that can allow this behavior?

how about testing for size with

bpy.context.active_object.bound_box[0].data.dimensions

and taking it from there?