If you want something recognized as text, you should use real text on your web pages. Do not hide your text in images or in other elements that are not plain text. That’s what John Mueller said on Twitter.
Use text if you want something recognized as text. Don't assume magic will happen.
— ? John ? (@JohnMu) September 24, 2019
This is nothing new. Although Google can parse images and JavaScript to some extent, it’s much better to present your main content as easy to parse text.
How to check if search engines can parse the content of your web pages
Use the website audit tool in SEOprofiler to find out whether search engines can parse the content of your web pages or not. The website audit tool checks your website for things that can have a negative impact on your rankings.