Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,9 @@ except IOError:
|
|
19 |
text = "Este é um exemplo de texto em uma imagem."
|
20 |
|
21 |
# Calcular a posição do texto para centralizá-lo
|
22 |
-
|
|
|
|
|
23 |
text_x = (width - text_width) / 2
|
24 |
text_y = (height - text_height) / 2
|
25 |
|
|
|
19 |
text = "Este é um exemplo de texto em uma imagem."
|
20 |
|
21 |
# Calcular a posição do texto para centralizá-lo
|
22 |
+
bbox = draw.textbbox((0, 0), text, font=font)
|
23 |
+
text_width = bbox[2] - bbox[0]
|
24 |
+
text_height = bbox[3] - bbox[1]
|
25 |
text_x = (width - text_width) / 2
|
26 |
text_y = (height - text_height) / 2
|
27 |
|