Compare commits

..

No commits in common. "f3eebcdfa3b9ed9ca1bc24aa31f23fe6894dfc81" and "d4a8d92615ac2b1ea20e50ee98d5713c0f1bc051" have entirely different histories.

2 changed files with 22 additions and 22 deletions

View File

@ -143,10 +143,10 @@ datum, vreme, lokacija, tema, tip,
21-05-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton (radna akcija), hack, 21-05-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton (radna akcija), hack,
27-05-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Home-made SoC #3, lecture, 27-05-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Home-made SoC #3, lecture,
28-05-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Mesečna revizija, meeting, 28-05-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Mesečna revizija, meeting,
02-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ejabberd/xmpp server), workshop, 02-06-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ejabberd/xmpp server), workshop,
03-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pi (1998), movie, 03-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pi (1998), movie,
04-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hardverski hakaton, hack, 04-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hardverski hakaton, hack,
09-06-2024, 14:00, DC Krov https://www.openstreetmap.org/node/10594728522, Game Jam, hack, 09-06-2024, 16:00, DC Krov https://www.openstreetmap.org/node/10594728522, Game Jam, hack,
10-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Obrada prirodnih jezika kroz Python, lecture, 10-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Obrada prirodnih jezika kroz Python, lecture,
11-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Ideološka diskusija, discussion, 11-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Ideološka diskusija, discussion,
17-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Diskusija o P2P mrežama, discussion, 17-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Diskusija o P2P mrežama, discussion,

Can't render this file because it has a wrong number of fields in line 30.

View File

@ -40,30 +40,30 @@ def load_events(csv_path:str, month:int) -> list[dict]:
return events return events
def drawPoster(events, bg, fg, month:int): def drawPoster(events, bg, fg, month:int):
fontFacade = ImageFont.truetype('./site/font/Facade-Sud.woff', size=365) fontFacade = ImageFont.truetype('./site/font/Facade-Sud.woff', size=110)
fontIosevka = ImageFont.truetype('./site/font/iosevka-regular.woff', size=200) fontIosevka = ImageFont.truetype('./site/font/iosevka-regular.woff', size=60)
fontIosevkaSmall = ImageFont.truetype('./site/font/iosevka-regular.woff', size=150) fontIosevkaSmall = ImageFont.truetype('./site/font/iosevka-regular.woff', size=45)
W = 3508 W = 1200
H = 4960 H = 1500
img = Image.new('RGB', (W, H), bg) img = Image.new('RGB', (W, H), bg)
draw = ImageDraw.Draw(img) draw = ImageDraw.Draw(img)
header = "DECENTRALA" header = "DECENTRALA"
_, _, w, _ = draw.textbbox((0, 0), header, font=fontFacade) _, _, w, _ = draw.textbbox((0, 0), header, font=fontFacade)
draw.text(((W-w)/2, 165), header, font=fontFacade, fill=fg) draw.text(((W-w)/2, 50), header, font=fontFacade, fill=fg)
subheader = f"Plan za {MONTHS_SR[month.month - 1]}" subheader = f"Plan za {MONTHS_SR[month.month - 1]}"
_, _, w, _ = draw.textbbox((0, 0), subheader, font=fontIosevka) _, _, w, _ = draw.textbbox((0, 0), subheader, font=fontIosevka)
draw.text(((W-w)/2, 560), subheader, font=fontIosevka, fill=fg) draw.text(((W-w)/2, 170), subheader, font=fontIosevka, fill=fg)
height = 990 height = 300
draw.text((165, height), "Radionice pocinju u 19h u DC Krovu", font=fontIosevkaSmall, fill=fg) draw.text((50, height), "Radionice pocinju u 19h u DC Krovu", font=fontIosevkaSmall, fill=fg)
height += 200 height += 60
draw.text((165, height), "Svi dogadjaji su uvek besplatni", font=fontIosevkaSmall, fill=fg) draw.text((50, height), "Svi dogadjaji su uvek besplatni", font=fontIosevkaSmall, fill=fg)
height += 300 height += 90
# Write list of events to sperate text file as well # Write list of events to sperate text file as well
textfile=open("poster.txt","w") textfile=open("poster.txt","w")
@ -81,8 +81,8 @@ def drawPoster(events, bg, fg, month:int):
title = event["title"] title = event["title"]
pad = " " if event["date"].day < 10 else "" pad = " " if event["date"].day < 10 else ""
eventText = f"{date} {day}. {pad} {title}" eventText = f"{date} {day}. {pad} {title}"
draw.text((165, height), eventText, font=fontIosevkaSmall, fill=fg) draw.text((50, height), eventText, font=fontIosevkaSmall, fill=fg)
height += 200 height += 70
# Add event to textfile # Add event to textfile
textfile.write(eventText + "\n") textfile.write(eventText + "\n")
@ -90,20 +90,20 @@ def drawPoster(events, bg, fg, month:int):
textfile.close() textfile.close()
def drawCircle(x, y): def drawCircle(x, y):
r = 50 r = 10
draw.ellipse((x - r, y - r, x + r, y+r), fill=fg, outline=(0, 0, 0), width=0) draw.ellipse((x - r, y - r, x + r, y+r), fill=fg, outline=(0, 0, 0), width=0)
LCX = 3100 # logo center x LCX = 1050 # logo center x
LCY = 4350 # logo center y LCY = 1300 # logo center y
d = 190 # delta d = 50 # delta
drawCircle(LCX - d, LCY) drawCircle(LCX - d, LCY)
drawCircle(LCX, LCY) drawCircle(LCX, LCY)
drawCircle(LCX, LCY - d) drawCircle(LCX, LCY - d)
drawCircle(LCX, LCY + d) drawCircle(LCX, LCY + d)
drawCircle(LCX + d, LCY) drawCircle(LCX + d, LCY)
draw.line([(LCX - d, LCY), (LCX + d, LCY)], fill=fg, width=20, joint=None) draw.line([(LCX - d, LCY), (LCX + d, LCY)], fill=fg, width=5, joint=None)
draw.line([(LCX, LCY), (LCX, LCY + d), (LCX + d, LCY), (LCX, LCY - d)], fill=fg, width=20, joint=None) draw.line([(LCX, LCY), (LCX, LCY + d), (LCX + d, LCY), (LCX, LCY - d)], fill=fg, width=5, joint=None)
draw.text((LCX - 1.7*d, LCY + 1.5*d), "dmz.rs", font=fontIosevka, fill=fg) draw.text((LCX - 1.7*d, LCY + 1.5*d), "dmz.rs", font=fontIosevka, fill=fg)
return img return img