I might have missed something in the code - but it seems like you’re just painting the text on a transparent CanvasTexture and apply it to a plane to get a flat, transparent text?
If that’s the case - maybe Troika would be helpful? It renders flat text using fancy, performant maths and also supports multilines out-of-the-box.