Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 =
|
| 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
|