If you need that much styling control over a text area, using a content editable region and Javascript for the interaction is almost certainly a better option.
An even better option is to use emscripten to bundle custom HTML rendering engine that would draw styled text input using Wayland server running on <canvas>