This commit is contained in:
yasirarism 2023-07-03 21:03:27 +07:00 committed by GitHub
parent aeb2f1a9d6
commit 45eb99440f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,8 +28,9 @@ async def draw_meme_text(image_path, text):
current_h, pad = 10, 5
if upper_text:
for u_text in textwrap.wrap(upper_text, width=15):
low_test = draw.textlength(text=l_text, font=m_font)
LOGGER.info(low_test)
u_width, u_height = draw.textlength(text=u_text, font=m_font)
draw.text(
xy=(((i_width - u_width) / 2) - 1, int((current_h / 640) * i_width)),
text=u_text,
@ -72,6 +73,8 @@ async def draw_meme_text(image_path, text):
current_h += u_height + pad
if lower_text:
for l_text in textwrap.wrap(lower_text, width=15):
low_test = draw.textlength(text=l_text, font=m_font)
LOGGER.info(low_test)
u_width, u_height = draw.textlength(text=l_text, font=m_font)
draw.text(