I think the most obvious improvement would be: just make it a free function which returns a surface, text rendering is slow and allocation is fast
That is a good point. If text rendering is slow, why are you not doing it in parallel? This is what 9rx called out earlier.
That is a good point. If text rendering is slow, why are you not doing it in parallel? This is what 9rx called out earlier.