There is no handy way to get a text block into a material. The least terrible way is to use a render target, and render a text widget into that render target, and then use that render target as a texture in a material.
But why would you want text in a material? It sounds like you’d be better of with a 3D world text object of some sort.
Because I want the text to share attributes with the rest of the material.
Because I want the fastest possible UI and not going through UMG saves me time.
I’ve built a substantial chunk of UI in shaders on more than one occasion and had programmers say that it was performing far better than scaleform…but hey, that was scaleform for ya!