Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -806,7 +806,7 @@ def add_song_cover_text(img,top_title=None,bottom_title=None):
|
|
806 |
labels_distance = 1/3
|
807 |
|
808 |
if top_title:
|
809 |
-
rows = len(
|
810 |
textheight=min(math.ceil( w / 10 ), math.ceil( h / 5 ))
|
811 |
font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
|
812 |
textwidth = draw.textlength(top_title,font)
|
@@ -816,7 +816,7 @@ def add_song_cover_text(img,top_title=None,bottom_title=None):
|
|
816 |
draw.text((x, y), top_title, (255,255,255), font=font, spacing=2, stroke_width=math.ceil(textheight/20), stroke_fill=(0,0,0))
|
817 |
|
818 |
if bottom_title:
|
819 |
-
rows = len(
|
820 |
textheight=min(math.ceil( w / 10 ), math.ceil( h / 5 ))
|
821 |
font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
|
822 |
textwidth = draw.textlength(bottom_title,font)
|
|
|
806 |
labels_distance = 1/3
|
807 |
|
808 |
if top_title:
|
809 |
+
rows = len(top_title.split("\n"))
|
810 |
textheight=min(math.ceil( w / 10 ), math.ceil( h / 5 ))
|
811 |
font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
|
812 |
textwidth = draw.textlength(top_title,font)
|
|
|
816 |
draw.text((x, y), top_title, (255,255,255), font=font, spacing=2, stroke_width=math.ceil(textheight/20), stroke_fill=(0,0,0))
|
817 |
|
818 |
if bottom_title:
|
819 |
+
rows = len(bottom_title.split("\n"))
|
820 |
textheight=min(math.ceil( w / 10 ), math.ceil( h / 5 ))
|
821 |
font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
|
822 |
textwidth = draw.textlength(bottom_title,font)
|