I have a richtextlabel with bbcodetext. I know I can scroll to a line with the RichTextLabel function "scroll_to_line()". However, is there a way to search the text of the label for a certain phrase, find the phrase index, then find the line it is on?

No, it doesn't look like that is supported. You can search for strings, and get the index (in the whole character array) but it doesn't really help. Since you don't know what line it's on. Also, the scroll to line function only works on actual lines (after a line break) not on auto-wrapped text, which makes it even more difficult. I tried to get a rough idea where the text is (you can sort of get a percentage based on the substring index and the total character count) but this is unreliable.

12 days later

I wonder if this is possible with the RichTextLabel work done with 4.0?

Perhaps Font.get_wordwrap_string_size() may be helpful.

Yeah, you're a genius! That does help. I still couldn't get it pixel perfect (and I needed a magic number) but it's pretty close to working. Anyhow, here is my test project @ondesic hope it helps you.

The problem gets magnified if you use bbcode and different fonts

a year later