I have a few Grid SOPs which have text applied to them (Grid → Material SOP → Constant with a text TOP applied as color Map)
The text is on each grid periodically changes length.
I want to make sure that the font size always remains the same on the screen and the grid adapts to the width of the screen.
So, for example, if a short word came up, what would happen is that the text would change in the top, (I think it’s resolution would change so the text fills the whole top) and then the grid would shrink.
To do this I have the grids, sizeX relative to the the resolution of the TOP, but what I don’t know is how to make sure the text fills the width of the text TOP without changing font size.
Is there some sort of ratio between Font Size, Font, and the ResolutionX/Y in the Text TOP so that I can just change the amount of characters and the TOP’s res will increase or decrease?
An attached Info CHOP to the Text TOP will return channels for text_width and text_height which you can use to control the size of your rectangle and resolution of the Text TOP used in the material. If changing the resolution of the Text TOP becomes to expensive you can always just change the size of the rectangle and scale the fixed resolution texture into place as in attached little example.
There is also an older tscript expression textstr() which will calculate the size a string would require on a specific Text TOP.
I have some dynamic text tops that I’m trying to ‘recombine’ in a layout top, sort of like reconstructing a sentence. I thought the tox above might help with the spacing but it doesnt appear to. Any tips on how to combine text tops and have it appear as a sentence?
Hey! I’m currently trying to acheive something quite similar. a sort of “sentence maker” out of a database. Do you have any tips or clues in oirder to acheive the layout made out of different texts?