mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 08:13:01 +00:00
Font via DAV
This commit is contained in:
parent
a3583396ec
commit
e6f1f77ec3
1 changed files with 4 additions and 1 deletions
|
@ -92,11 +92,14 @@ async def get_auto_image(
|
||||||
image = await load_image(images[index])
|
image = await load_image(images[index])
|
||||||
rnd = await Random.get(index)
|
rnd = await Random.get(index)
|
||||||
|
|
||||||
|
lena_ttf = await dav_get_file("fonts/Lena.ttf")
|
||||||
|
lena_ttf.seek(0)
|
||||||
|
|
||||||
# Buchstabe verstecken
|
# Buchstabe verstecken
|
||||||
await image.hide_text(
|
await image.hide_text(
|
||||||
xy=tuple(rnd.choices(range(30, 470), k=2)),
|
xy=tuple(rnd.choices(range(30, 470), k=2)),
|
||||||
text=letter,
|
text=letter,
|
||||||
font=ImageFont.truetype("Lena.ttf", 50),
|
font=ImageFont.truetype(lena_ttf, 50),
|
||||||
)
|
)
|
||||||
|
|
||||||
return image
|
return image
|
||||||
|
|
Loading…
Reference in a new issue