from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
font = ImageFont.truetype('10423.ttf', 70)
text = '18 懈褞谢褟'
img = Image.open('18144592.jpg')
draw = ImageDraw.Draw(img)
w1, h1 = draw.textsize(text)
An error occurred while executing the code:

How can I fix it?
Font:
10423.zip
You're using the default font, not 10423.ttf.
Change your last line to:
w1, h1 = draw.textsize(text, font)
@hugovk
Thank you for your help. Everything is working!
Most helpful comment
You're using the default font, not 10423.ttf.
Change your last line to:
Docs: https://pillow.readthedocs.io/en/latest/reference/ImageDraw.html#PIL.ImageDraw.PIL.ImageDraw.ImageDraw.textsize