I have been using Python 3 and Pillow in Jupyter Notebook to take a string that was input by the user and turn it into an image.
Once the string has been successfully changed to an image, the font size and style of the image remains tiny and won't change when I try to edit the variable associated with the text width and height, but the bordering space does change.
For example, if I enlarge the text width or height, the font does not change but the white boarder around the font will change. Please let me know if anyone knows how to fix this.
from PIL import Image, ImageDraw, ImageFont
font = ImageFont.truetype("Verdana.ttf", 100) #seems to have no impact on the program
userinput0000 = input("Enter String Here:")
bgcolor = 'white'
txtcolor = 'black'
text_width, text_height = (5 , 5) # (w,h) changes the size of the white box surrounding the string
userinput0000img = Image.new("RGB",(text_width, text_height), bgcolor)
draw = ImageDraw.Draw(userinput0000img)
draw.text((5, 5), userinput0000, txtcolor) #(x,y)changes the xy coordinates of the string
userinput0000img.show()
im = Image.open("Desktop/0001.jpg")
x, y = userinput0000img.size
im.paste(userinput0000img,(0,0,x,y))
im.show()
Current code output:

These are two Stack Overflow posts that I found to be useful but neither seemed to be addressing the same type of problem.
How I can load a font file with PIL.ImageFont.truetype without specifying the absolute path?
Convert HTML string to image data and display it as an image in a template using Python
I have also read through the Pillow handbook (linked bellow) and found no reference to a similar situation.
https://pillow.readthedocs.io/en/latest/handbook/tutorial.html