Since the introduction of the new spreadsheet version one can change text attributes inside a single cell (or merged cells) manually like in this example :
(left = raw text, right = formatted text, easier to read)
I don't see any way to achieve that by script... I don't see any issue nor feature request in the issue tracker either.
Is that possible ?
Every method I try to get the text attributes only returns a single value so I'm afraid I just can't do it... but who knows ?