Hi!
I’m trying to modify a Text TOP’s fontfile parameter programmatically (and ideally a lot) but doing so drops FPS more than I expected.
I’m basically looking to make something that randomly changes the font file of a Text TOP. It does so fine (Noise Chop provides an index, which looks up the row in a folder DAT, which corresponds to a local folder containing lots and lots of fonts) but any time I’m loading a font my FPS drops from 60 to around 20 for a very noticable maybe half a second. I’m hoping to do this randomized font for many different characters at the same time smoothly but I don’t know how to speed up/optimize. Does anyone know how to make fonts load quickly, or think that this is intractable?
Create a TOX file that contains the Text TOP and have all parameters expose that you would need to use. Once that TOX is made, create an Engine COMP and load your TOX into that (you could replicate that Engine COMP using the Replicator if you need a lot of them). This way each of your Text TOPs will be on a seperate thread to your main project and will not lag your main project (although there may still be loading time for that specific Engine COMP/Text TOP.
Another method might be to have Text TOPs created for each font you will use, and instead of changing the font parameter, you will switch between the different Text TOPs you will have created. This means every font you need will always be loaded, however it will require some logic trickery to switch to the correct TOP you need.
If you are going to be using different fonts on the same line/word, check out the Text TOP class info (textTOP Class - Derivative) - you can pull out the width and height of the text in your Text TOP which can be handy when combining different Text TOPs together (you can also grab this info by placing your Text TOP into an Info CHOP).
These are all good ideas, will try them now- I already have a replicator creating one Text TOP per character so it’s an easy change ultimately to wrap it in an Engine comp