Controlling formatting for individual portions of a note is done using SWML. Editing the note formatting using the UI or API calls are really just a way to read and write this SWML. You can use my NoteBrowser macro to read and edit the content of notes and see what the SWML is for certain formats, and you can directly edit or even type this SWML into a note to format it however you want.
This SWML actually works almost anywhere that you can have text, even if you can’t use the UI to edit it.
The argument for [Get/Set]TextFormat does not refer to the line. It refers to the piece of text. A multi-line note still only has one piece of text. From the Help for GetTextFormatCount:
This value is not necessarily the same as the number of text objects within a symbol. For example, there are multiple text objects in a geometric tolerance symbol, but they all share the same text format so SOLIDWORKS returns 1. In fact, for all of the annotations except blocks (and compound notes in documents created in SOLIDWORKS 2015 and earlier), this method should return 1. For blocks and compound notes, each piece of text within the symbol has its own text format, so the return value should match the number of TextFormat objects.