Reaperxxxx commited on
Commit
2ae5bd2
·
verified ·
1 Parent(s): 5336f57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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, _ = draw.textsize(text, font=font)
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