How to draw a string onto an image

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

HI, I’ve got a text string (obviously), a color and a DynamicFont, and I’d like to draw this string (in the color and using the font) onto an Image, all in memory. The only examples I can find involve drawing it onto a Label using draw_string(), and then extracting the image data from the Label’s viewport, but this isn’t ideal as I need to do it in the background. Any help is much appreciated.