Font via DAV

This commit is contained in:
Jörn-Michael Miehe 2022-12-08 21:16:41 +00:00
parent a3583396ec
commit e6f1f77ec3

View file

@ -92,11 +92,14 @@ async def get_auto_image(
image = await load_image(images[index])
rnd = await Random.get(index)
lena_ttf = await dav_get_file("fonts/Lena.ttf")
lena_ttf.seek(0)
# Buchstabe verstecken
await image.hide_text(
xy=tuple(rnd.choices(range(30, 470), k=2)),
text=letter,
font=ImageFont.truetype("Lena.ttf", 50),
font=ImageFont.truetype(lena_ttf, 50),
)
return image