Have a look in the TextDoc documentation. There are methods like start_bold
and start_underline
that you can use. I can’t see an equivalent for italics though.
You can also define you own ParagraphStyle containing a FontStyle.
If you want to make these styles user definable options then things can a bit more complex.
The best examples can be found in the code.