Question about Spans, TextDecorations, and custom RichText support
Posted: 07 Apr 2025, 18:37
Good afternoon!
I am currently trying to add in support to our game, for feature parity rich-text support of legacy content that our users have created. Our previous game was shipped with Unity and we used TextMeshPro, allowing a subset of their RichText tags to be shown when presenting content in game. This is incredibly important for our studio since, almost the entirety of our content is user-authored. The tags we supported specifically were these ones:
italic, bold, strikethrough, underline, super-script, sub-script, vertical-offset, lowercase, uppercase, small-caps, character-space, color, monospace, and line break.
I've been writing modifications to the RichText class that's include with the Noesis SDK, but I am struggling to add in support for strikethrough, monospace, super-script, sub-script, and oddly enough very important one within our community, vertical-offset.
Here's what I've tried so far:
- I tried adding a TextDecorations="Strikethrough" in the markdown for a span but this is not working for me.
- I wanted to add a RenderTransform to a Span element hoping it would allow me to support the super-script/sub-script/vertical-offset with a simple translation on the Y-axis. For our purposes, this would be MORE than enough and offer the perfect amount of customization, since the voffset tag is used heavily in our old game. If this was/is possible, it would be the most flexible solution.
- For the monospace tag, I think I can achieve this effect simply by swapping out the font, and maybe using a tool to convert our primary font to a monospace variant, maybe using a tool like this one: https://github.com/cpitclaudel/monospacifier. But if there's support for this already then I'd love to know about it before going this route!
Please let me know if there's any way I can achieve any of these extra rich-tags within the confines of a simple extension, similar to your provided RichText extension,
Thank you,
David
I am currently trying to add in support to our game, for feature parity rich-text support of legacy content that our users have created. Our previous game was shipped with Unity and we used TextMeshPro, allowing a subset of their RichText tags to be shown when presenting content in game. This is incredibly important for our studio since, almost the entirety of our content is user-authored. The tags we supported specifically were these ones:
italic, bold, strikethrough, underline, super-script, sub-script, vertical-offset, lowercase, uppercase, small-caps, character-space, color, monospace, and line break.
I've been writing modifications to the RichText class that's include with the Noesis SDK, but I am struggling to add in support for strikethrough, monospace, super-script, sub-script, and oddly enough very important one within our community, vertical-offset.
Here's what I've tried so far:
- I tried adding a TextDecorations="Strikethrough" in the markdown for a span but this is not working for me.
- I wanted to add a RenderTransform to a Span element hoping it would allow me to support the super-script/sub-script/vertical-offset with a simple translation on the Y-axis. For our purposes, this would be MORE than enough and offer the perfect amount of customization, since the voffset tag is used heavily in our old game. If this was/is possible, it would be the most flexible solution.
- For the monospace tag, I think I can achieve this effect simply by swapping out the font, and maybe using a tool to convert our primary font to a monospace variant, maybe using a tool like this one: https://github.com/cpitclaudel/monospacifier. But if there's support for this already then I'd love to know about it before going this route!
Please let me know if there's any way I can achieve any of these extra rich-tags within the confines of a simple extension, similar to your provided RichText extension,
Thank you,
David