Auto size shape and shrink wrap text

I have a Text Element of unknown height (1-5 lines of text) and I'd like to add a rectangular shape that will auto size around the text (taking into consideration the text padding).

Please help with a formula or a suggestion. Thank you!

Just realized it isn't possible yet.

Based on dev's response here:

Yeah thats something i am trying to add since quite a while and its a bit complex,i might just add a BG option to the textview at some point to overcome this easily, it will not be an universal solution but still work in most cases (so color + roundness + padding maybe as a first step)