Responsive text font size

This might be a simpler explanation of what I’m trying to accomplish.
When you create a picture in, for example, photoshop, then adding a text to it, and then save. Everything becomes a single unit, png or jpeg file. Everything is reduced and enlarged in the same way when you view the saved file.

Of course, I can do that. But then I lose the content.
Hope it became clearer now what I want to accomplish