1
Fork 0

Tweak font sizes

This commit is contained in:
Jake Howard 2024-12-07 23:09:20 +00:00
parent 987d16a617
commit bb7f45ffbd
Signed by: jake
GPG key ID: 57AFB45680EDD477

15
main.py
View file

@ -3,13 +3,13 @@ import requests
from resizeimage import resizeimage from resizeimage import resizeimage
OUTPUT_RESOLUTION = (1280, 720) OUTPUT_RESOLUTION = (1280, 720)
TITLE_FONT = ImageFont.truetype("Roboto-Regular.ttf", 92) TITLE_FONT = ImageFont.truetype("Roboto-Regular.ttf", 90)
TAGS_FONT = ImageFont.truetype("RobotoMono-Regular.ttf", 40) TAGS_FONT = ImageFont.truetype("RobotoMono-Regular.ttf", 35)
FOOTER_FONT = ImageFont.truetype("RobotoMono-Regular.ttf", 25) FOOTER_FONT = ImageFont.truetype("RobotoMono-Regular.ttf", 30)
TITLE_PADDING = 75 TITLE_PADDING = 75
TITLE = "Accessing Tailscale whilst using Mullvad" TITLE = "Accessing Tailscale whilst using Mullvad"
TAGS = "#linux #containers #foobar" TAGS = "#linux"
def get_text_width(text, font): def get_text_width(text, font):
@ -85,11 +85,12 @@ draw.text(
print("Drawing footer") print("Drawing footer")
draw.rectangle( draw.rectangle(
[(0, OUTPUT_RESOLUTION[1] - 50), OUTPUT_RESOLUTION], fill=(0, 0, 0, int(255 * 0.5)) [(0, OUTPUT_RESOLUTION[1] - (FOOTER_FONT.size * 2)), OUTPUT_RESOLUTION],
fill=(0, 0, 0, int(255 * 0.66)),
) )
draw.text( draw.text(
(25, OUTPUT_RESOLUTION[1] - 25), (25, OUTPUT_RESOLUTION[1] - FOOTER_FONT.size),
text="theorangeone.net", text="theorangeone.net",
font=FOOTER_FONT, font=FOOTER_FONT,
fill="#e85537", fill="#e85537",
@ -99,7 +100,7 @@ draw.text(
draw.text( draw.text(
(OUTPUT_RESOLUTION[0] - 25, OUTPUT_RESOLUTION[1] - 25), (OUTPUT_RESOLUTION[0] - 25, OUTPUT_RESOLUTION[1] - FOOTER_FONT.size),
text="2024-01-01", text="2024-01-01",
font=FOOTER_FONT, font=FOOTER_FONT,
fill="white", fill="white",