text_layer = cast(TextLayer, image.layers[1])
text_data = text_layer.text_data

default_style = text_data.produce_portion().style
default_paragraph = text_data.produce_portion().paragraph

default_style.fill_color = Color.from_name("DimGray")
default_style.font_size = 51

text_data.items[1].style.strikethrough = True

new_portions = text_data.produce_portions(
    [
        "E=mc",
        "2\r",
        "Bold",
        "Italic\r",
        "Lowercasetext"
    ],
    default_style,
    default_paragraph
)

new_portions[0].style.underline = True
new_portions[1].style.font_baseline = FontBaseline.SUPERSCRIPT
new_portions[2].style.faux_bold = True
new_portions[3].style.faux_italic = True
new_portions[3].style.baseline_shift = -25
new_portions[4].style.font_caps = FontCaps.SMALL_CAPS

for new_portion in new_portions:
    text_data.add_portion(new_portion)

text_data.update_layer_data()