In the example of image below:

How can I make both the superscript and
I would not try to bend the TextView widget to make that. Instead, you could easily make your own widget that has 2 different paints: one for the element name (big font size) and one for the numbers (small size, italics).
You'd make proper setters and store each property separatly instead of storing a big spannable or string.
You'd also be able to easily align both horizontally and vertically (numbers at top and bottom of element name)
To compute the width, you can have a property to adjust the padding between numbers and element name. Then you can use each paint to compute the text width and add all this (don't forget to add the widget padding values).