Display text on top of another in a RichTextLabel

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lpares12

I am trying to make a “markdown compiler” for my project with the idea of displaying some formatted text in godot. To do so I have a RichTextLabel with the bbcode activated and I run some regex to transform from my custom markdown to bbcode.

The problem though, is that one of the requirements I have is to display Furigana (a small text on top of another text). And I’m wondering if it’s even possible to do so…

You can see an example in this image: furigana image

My custom markdown is in this format [bottom text]{top text} so I would like to have the “bottom text” at the bottom with size X and the “top text” on top of it with size Y. I have set up a custom effect for the RichTextLabel to position the text on top of the last word. The problem is that the line height of the text does not change, so if there is another line on top of the line with Furigana, it will just print the text on top of it.

I also tried to create a table with two rows and put the upper part on top, but that just creates a new line just before the table. So if I had “What is [table=2][cell]Furigana[/cell][cell]some text[/cell][/table]” it would just add an end-of-line after "what is " which I don’t want.

Would like to know if there is any way of making this with the RichTextLabel container. Instead of overlapping labels on top of each other.

EDIT: another idea I had is to create an image with it and use the bbcode [img] tag but this is not ideal since users won’t be able to copy-paste the text.