TextEntity Supported RTF Control Words and Formatting

playing around and trying to use Rich Text Format (RTF) inside a TextEntity (via Rhino.Geometry.TextEntity.CreateWithRichText()).

Which RTF control words, symbols, and features are supported by Rhino’s text rendering engine ? are there differences Mac / Windows ?

Specifically:

  • Does Rhino support table formatting (e.g., \trowd, \cell, \row)?
  • Are advanced text formats like font sizes, font styles (bold, italic, underline), and color fully supported?
  • What about paragraph control (e.g., \par, \tab, \fi) and things like alignment?

would be nice if the documentation
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.textentity/createwithrichtext

includes a List of supported features.

Thanks in advance! kind regards - tom

I think this method indicates what RTF formatting is supported:

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.annotationbase/formatrtfstring

And this discussion also talk about it:

RTF is more supported in UI components – but the full RTF spec isn’t supported in text entities from what I’ve experience – bold/underline/italic/font/bullet points all work. I don’t believe any of the alignment or paragraph controls, or table formatting works, but tab does…

For codes:

  • \b Bold
  • \i Italic
  • \strike Strike
  • \tab Tab
  • \ul Underline text
  • \f0 font references
  • { } for groups

You can play around with the spec to see if any of the other spacing/table codes work but I haven’t had luck using them…

And apologies for the partial reply, pressed enter too quickly…

Hope this helps!

did you miss / forget a link ?

Apologies, accidentally posted too early. Have updated the reply.

I would add that DimStyles can add more control for things like text alignment and text box size. For new lines you can use \n (environment newline) but not sure how well that will work when mixing with RTF codes (you’ll need to escape the RTF codes?). We tend to use work with insert planes if its something more complicated.

ok but this looks like the try and error i stumble into as well…
would be nice to have a documentation of supported codes

but thanks a lot for digging into this topic

Agreed, it would be nice if it was explicitly stated in the documentation.