Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowViet committed Dec 29, 2022
1 parent e4eeb83 commit 2d0d915
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions collectives/utils/certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ def generate_image(president, user):
font=font,
spacing=10,
)
current_line_position = ImageDraw.Draw(image).textlength(
text, font=font
)
current_line_position = ImageDraw.Draw(image).textlength(text, font=font)
text = f"{president.full_name().upper()}"
ImageDraw.Draw(image).multiline_text(
(350 + current_line_position, 900),
Expand All @@ -73,9 +71,7 @@ def generate_image(president, user):
font=font_bold,
spacing=10,
)
current_line_position += ImageDraw.Draw(image).textlength(
text, font=font_bold
)
current_line_position += ImageDraw.Draw(image).textlength(text, font=font_bold)
ImageDraw.Draw(image).multiline_text(
(350 + current_line_position, 900),
f", président du {club_name},",
Expand All @@ -99,9 +95,7 @@ def generate_image(president, user):
font=font,
spacing=10,
)
current_line_position = ImageDraw.Draw(image).textlength(
text, font=font
)
current_line_position = ImageDraw.Draw(image).textlength(text, font=font)
text = f"{user.full_name()}"
ImageDraw.Draw(image).multiline_text(
(600 + current_line_position, 1100),
Expand All @@ -110,9 +104,7 @@ def generate_image(president, user):
font=font_bold,
spacing=10,
)
current_line_position += ImageDraw.Draw(image).textlength(
text, font=font_bold
)
current_line_position += ImageDraw.Draw(image).textlength(text, font=font_bold)
ImageDraw.Draw(image).multiline_text(
(600 + current_line_position, 1100),
f", né{conjugate} le {user.date_of_birth.strftime('%d/%m/%Y')}, ",
Expand Down Expand Up @@ -191,6 +183,7 @@ def generate_image(president, user):

return image


def generate_background(template, user):
"""Generate an image containing the volunteer certificate.
Expand Down

0 comments on commit 2d0d915

Please sign in to comment.