mirror of
https://github.com/Xevion/v1.xevion.dev.git
synced 2025-12-07 03:16:58 -06:00
don't use two different fonts for Panzer image generator
This commit is contained in:
@@ -21,14 +21,13 @@ def panzer(string="bionicles are cooler than sex"):
|
||||
def create_panzer(string):
|
||||
img = Image.open("./app/static/panzer.jpeg")
|
||||
draw = ImageDraw.Draw(img)
|
||||
font1 = ImageFont.truetype("./app/static/arial.ttf", size=30)
|
||||
draw.text((10, 20), "Oh panzer of the lake, what is your wisdom?", font=font1)
|
||||
font2 = ImageFont.truetype("./app/static/arial.ttf", size=30)
|
||||
font = ImageFont.truetype("./app/static/arial.ttf", size=30)
|
||||
draw.text((10, 20), "Oh panzer of the lake, what is your wisdom?", font=font)
|
||||
topleft = (250, 500)
|
||||
wrapped = wrap(string, width=25)
|
||||
wrapped = [text.replace("%0A", "\n") for text in wrapped]
|
||||
for y, text in enumerate(wrapped):
|
||||
draw.text((topleft[0], topleft[1] + (y * 33)), text, font=font2)
|
||||
draw.text((topleft[0], topleft[1] + (y * 33)), text, font=font)
|
||||
return img
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user