How do you scale text based on the number of characters?

Is there a simple way to scale text to fit inside the RectTransform like in NGUI?

I am using the new UI canvas stuff and have a Text component. I want to make the Text size the same up to 5 characters, but able to grow to 10. This is for a scoreboard. I don’t want the text to wrap.

When the score passes 1,000, I want the characters to shrink so that it still fits in the Rect.

BestFit would definitly work indeed ^^ as @fafase said

But if you still want to make it hard, i believe font size is based on the width or height in px of the caracters, so you can take that value and multiply it by String.Length and the set it as your textbox size ^^