Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,7 @@ def generate_profile():
|
|
64 |
|
65 |
# Centered text positions
|
66 |
def draw_centered_text(text, y, font):
|
67 |
-
text_width
|
68 |
x = (W - text_width) // 2 # Center the text
|
69 |
draw.text((x, y), text, font=font, fill=text_color)
|
70 |
|
|
|
64 |
|
65 |
# Centered text positions
|
66 |
def draw_centered_text(text, y, font):
|
67 |
+
text_width = draw.textbbox((0, 0), text, font=font)[2] # Fix: get text width
|
68 |
x = (W - text_width) // 2 # Center the text
|
69 |
draw.text((x, y), text, font=font, fill=text_color)
|
70 |
|