Before you can optimize text with batching there are a few considerations.
- The main one being: are text fields being drawn after one another or are other things drawn in between them.
ie.
button image, button text, button image, button text, button image, button text etc...
vs
button image, button image, button image, button text, button text, button text etc...
The second sequence is much easier to batch, though in certain instances the first is still sortable (provided there is no overlaps) but it is complex to resolve those issues.
If your textfields are being rendered in order then you can use a shared texture but that leads to the next consideration.
- Does the text change over its lifetime.
Depending on how often text changes it makes using a text texture atlas harder as you have to keep track of which rectangles in the atlas are active, and clear them when they are done, which will more than likely lead to holes that get harder and harder to fill but it would probably work for a while. You would need to implement an allocator of sorts that manages that. Coalescing the freed areas would be the hardest part.
[here](https://github.com/nical/guillotiere is one I found on github
here is a discussion on the idea
Now in terms of re-balancing/coalescing, I wonder if a much easier way would be to redraw the whole atlas with a ping-pong approach (2 textures) and each time you need to remove something just re-create an atlas with the ones that are left and redraw to the new texture as a renter target from the old one. (Should be one draw call as its just one source texture) - probably slower but easier to do!
- How big is the text content
Too big and you wont be able to store much of it in one texture, so small text elements are probably the best bet.
(Hopefully some of that makes sense - I wrote it in a mad rush)
:-)