Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,7 +133,10 @@ def create_basic_animation(text, audio_file):
|
|
| 133 |
y_start = (height - len(lines) * font_size) // 2
|
| 134 |
for j, line in enumerate(lines):
|
| 135 |
try:
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
| 137 |
except AttributeError as e:
|
| 138 |
print(f"AttributeError: {e}")
|
| 139 |
print(f"Pillow version: {pillow_version}")
|
|
|
|
| 133 |
y_start = (height - len(lines) * font_size) // 2
|
| 134 |
for j, line in enumerate(lines):
|
| 135 |
try:
|
| 136 |
+
bbox = d.textbbox((0, 0), line, font=font)
|
| 137 |
+
text_width = bbox[2] - bbox[0]
|
| 138 |
+
text_x = (width - text_width) // 2
|
| 139 |
+
|
| 140 |
except AttributeError as e:
|
| 141 |
print(f"AttributeError: {e}")
|
| 142 |
print(f"Pillow version: {pillow_version}")
|