ofTrueTypeFont::drawString() performance

Hi,
I’m going to deal with many drawString() call.
I’ve noticed that ofxGUI is storing ofMesh, not calling drawString() each frame.
Why ?
Is drawString() bad at performance ?

Thanks

1 Like

if you aren’t drawing a lot of texts you shouldn’t worry and it’s always better to optimize later but yes drawString has to calculate all the spacing and positions for each character so if you have to write a lot of texts it can be relatively slow

had similar issue, found the solution in arturo’s answers in this thread: Animating lots of font objects on 2d paths

I’ve used the vbo approach to draw about 18000-20000 random characters on screen, each with changing positions, colors & scales, works realtime at 30 fps.

1 Like