i am having some problems and can't seem to find an answer. I Want to write a string into a .png with the PIL lib, but scince my string is too long to fit the image, and i can't change the size of the image, i want that the string automatticly fits itself to the image.
fontsize = 20
img = Image.open('pythontest.png')
draw = ImageDraw.Draw(img)
font = ImageFont.truetype("fonts/NotoSans-Black.ttf", fontsize)
#Here is my problem
draw.text((140, 140), "A String that is way to long for this picture, i want to format
this sting so that it can automatticly fit this image",font=font,fill=(255, 255, 255))
img.save("Done.png")
I hope, that i could elaborate my problem clearly, if not i can answer questions.
Thanks for your help! (my image has the format x = 720, y = 357)