thanks to fmw42 for the answer above. I slightly modified this to allow for a transparent background and to do negative angles as well. My first submission to give back to this wonderful community :)
import wand
def curved_text_to_image(
text: str,
font_filepath: str,
font_size: int,
color: str, #assumes hex string
curve_degree: int):
"""
Uses ImageMagik / wand - so have to ensure its installed.
"""
with wand.image.Image(width=1, height=1, resolution=(600, 600)) as img: # open an image
with wand.drawing.Drawing() as draw: # open a drawing objetc
# assign font details
draw.font = font_filepath
draw.font_size = font_size
draw.fill_color = wand.color.Color(color)
# get size of text
metrics = draw.get_font_metrics(img, text)
height, width = int(metrics.text_height), int(metrics.text_width)
# resize the image
img.resize(width=width, height=height)
# draw the text
draw.text(0, height, text)
draw(img)
img.virtual_pixel = 'transparent'
# curve_degree arc, rotated 0 degrees - ie at the top
if curve_degree >= 0:
img.distort('arc', (curve_degree, 0))
else:
# rotate it 180 degrees, then distory and rotate back 180 degrees
img.rotate(180)
img.distort('arc', (abs(curve_degree), 180))
img.format = 'png'
wand.display.display(img)
return img