Getting text object bold/italic/underline info via RhinoCommon

In the text editing/properties box, there are buttons for Bold, Italic, and Underline:

These are “modifiers” added by Rhino to the text, they do not represent changing type styles. Looking at all the parameters (a huge number) that are associated with an annotation object, I can only find one place where these modifiers are actually accessible - that is within the rich text ‘string’.

{\rtf1\deff0{\fonttbl{\f0 Arial;}}\f0 \fs26{\f0\b\i\ul Some text}}

The b\i\ul in the above indicate the modifiers applied. Is the only way to get that information to actually parse the rich text string and see if they are present? If so, that seems highly convoluted. If there is another easier/better way, I would like to know it.

It is indeed following the RTF spec. There.are no toolings in our SDK that give you this info directly AFAIK.

That said the dialog is based on RichTextArea Class so maybe you can utilize that to get some of the functionality you are looking for.

OK, thanks Nathan. I am trying to get this info from the annotation object itself, not the ETO dialog, so I guess I will need to make an RT string parser…

If you know for a fact that the entire string has the same bold, italic, underline properties you could call the FirstCharFont property of the TextEntity object.

I was suggesting to somehow create a RichTextArea component, feed the annotation string into it and then use the API provided ny the control.

Ah, interesting, thanks Alain! I think that will do for my purposes here.