multimodalart HF staff commited on
Commit
11feb2c
1 Parent(s): 13587bf

Update app_dialogue.py

Browse files
Files changed (1) hide show
  1. app_dialogue.py +2 -2
app_dialogue.py CHANGED
@@ -454,7 +454,7 @@ def make_meme_image(
454
  initial_font_size = 80
455
  text_is_too_long = True
456
  num_lines = 0
457
- while text_is_too_long and num_lines < 3:
458
  num_lines += 1
459
  font = ImageFont.truetype(f"fonts/{font_meme_text}.ttf", size=initial_font_size)
460
  text, font, text_width, text_is_too_long = test_font_size(
@@ -477,7 +477,7 @@ def make_meme_image(
477
 
478
  outline_width = 2
479
  text_x = (image_width - text_width) / 2
480
- text_y = image_height - num_lines * font.size - 10 - num_lines
481
  if text_at_the_top:
482
  text_y = 0
483
 
 
454
  initial_font_size = 80
455
  text_is_too_long = True
456
  num_lines = 0
457
+ while text_is_too_long and num_lines < 8:
458
  num_lines += 1
459
  font = ImageFont.truetype(f"fonts/{font_meme_text}.ttf", size=initial_font_size)
460
  text, font, text_width, text_is_too_long = test_font_size(
 
477
 
478
  outline_width = 2
479
  text_x = (image_width - text_width) / 2
480
+ text_y = image_height - num_lines * font.size - 10 - 2 * num_lines
481
  if text_at_the_top:
482
  text_y = 0
483