I'm implemented a game console, such as used in Doom, Quake, Stalker, Crysis and other 3D shooters.
It's very useful for debugging and works fast enough, but there is a little question about rendering colored texts.
I'm using colored text output to make it more readable.
For simplification purposes, I'm using special text codes to switch current text color. For exampe:
"$1Hello $2world!"
It will be rendered as white "Hello" and blue "world".
To render such texts I'm split it into several parts for each color and then render it with calling Text.GetLocalBounds to measure it's size.
So, the question - is there any better way to render text which consists of sub-strings with different colors?