When using the following in Python’s Pillow:
textsize = 14
font = ImageFont.truetype("Arial Unicode.ttf", size=textsize)
txw, txh = draw.textlength(label, font=font)
The following error occurred.
AttributeError: ‘ImageDraw’ object has no attribute ’textsize’
The following was helpful as a solution.
Specifically, I rewrote it as follows.
textsize = 14
font = ImageFont.truetype("Arial Unicode.ttf", size=textsize)
txw = draw.textlength(label, font=font)
txh = textsize
I hope this is helpful.