mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-02 10:44:50 +00:00
debug
This commit is contained in:
parent
96392f3d9d
commit
273356f9f7
1 changed files with 12 additions and 2 deletions
|
|
@ -28,7 +28,12 @@ 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):
|
||||
u_width, u_height = draw.textsize(u_text, font=m_font)
|
||||
text_bbox = m_font.getbbox(u_text)
|
||||
(left, top, right, bottom) = text_bbox
|
||||
i_width = abs(right - left)
|
||||
i_height = abs(top - bottom)
|
||||
text_size = (i_width, i_height)
|
||||
# u_width, u_height = draw.textsize(u_text, font=m_font)
|
||||
|
||||
draw.text(
|
||||
xy=(((i_width - u_width) / 2) - 1, int((current_h / 640) * i_width)),
|
||||
|
|
@ -72,7 +77,12 @@ 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):
|
||||
u_width, u_height = draw.textsize(l_text, font=m_font)
|
||||
text_bbox = m_font.getbbox(u_text)
|
||||
(left, top, right, bottom) = text_bbox
|
||||
i_width = abs(right - left)
|
||||
i_height = abs(top - bottom)
|
||||
text_size = (i_width, i_height)
|
||||
# u_width, u_height = draw.textsize(l_text, font=m_font)
|
||||
|
||||
draw.text(
|
||||
xy=(
|
||||
|
|
|
|||
Loading…
Reference in a new issue