OatNapat commited on
Commit
fc785df
·
1 Parent(s): a9d9aa4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -20,7 +20,7 @@ def text_to_image(text):
20
  font_size = 20
21
 
22
  # Calculate text width and height
23
- text_width, text_height = draw.textsize(text, font)
24
 
25
  # Calculate the position to center the text in the image
26
  x = (image.width - text_width) / 2
 
20
  font_size = 20
21
 
22
  # Calculate text width and height
23
+ text_width, text_height = font.getsize(text)
24
 
25
  # Calculate the position to center the text in the image
26
  x = (image.width - text_width) / 2