load template and fonts from correct folder

This commit is contained in:
Fredrick W. Warren 2022-05-30 22:35:46 -07:00
parent 47467f9bdc
commit c99fa6d239

View File

@ -24,10 +24,11 @@ def update_image(original, title, subtitle):
renders text on full sized slide renders text on full sized slide
make half sized copy for preview and fill top/bottom with white. make half sized copy for preview and fill top/bottom with white.
""" """
font1 = ImageFont.truetype(resource_path('tahomabd.ttf'), 50)
font2 = ImageFont.truetype(resource_path('tahomabd.ttf'), 38)
# render text # render text
text = Image.new(mode="RGBA", size=(1280,720)) text = Image.new(mode="RGBA", size=(1280,720))
font1 = ImageFont.truetype('tahomabd.ttf', 50)
font2 = ImageFont.truetype('tahomabd.ttf', 38)
draw = ImageDraw.Draw(text) draw = ImageDraw.Draw(text)
draw.text((20,520), title, font=font1, fill='white', draw.text((20,520), title, font=font1, fill='white',
stroke_width=4, stroke_fill='black', spacing=4) stroke_width=4, stroke_fill='black', spacing=4)
@ -36,8 +37,6 @@ def update_image(original, title, subtitle):
# render drop dhadow # render drop dhadow
dropshadow = Image.new(mode="RGBA", size=(1280,720)) dropshadow = Image.new(mode="RGBA", size=(1280,720))
font1 = ImageFont.truetype('tahomabd.ttf', 50)
font2 = ImageFont.truetype('tahomabd.ttf', 38)
draw = ImageDraw.Draw(dropshadow) draw = ImageDraw.Draw(dropshadow)
draw.text((25,525), title, font=font1, fill='black', draw.text((25,525), title, font=font1, fill='black',
stroke_width=4, stroke_fill='black', spacing=4) stroke_width=4, stroke_fill='black', spacing=4)