from pathlib import Path
from html import escape
from PIL import Image, ImageDraw, ImageFont
p=Path(__file__).parent
N='#071632';P='#12356b';Y='#ffde59';M='#b7cbe8';W='#ffffff';C='#f7eac8'
def build(section):
a=['');(p/('orboffice.svg' if section=='office' else 'orbit-menu.svg')).write_text('\n'.join(a))
for section in ['office','menu']:build(section)
# A font comparison rendered from the actual local TTFs, without installing system fonts.
base=p/'fonts'
im=Image.new('RGB',(1600,1100),N);d=ImageDraw.Draw(im)
def line(x,y,s,path,size,color=W):d.text((x,y),s,font=ImageFont.truetype(str(path),size),fill=color)
def font(name):return base/name
line(65,45,'Orbit / type study',font('barlow-semibold.ttf'),60)
line(65,123,'Actual fonts from your Documents collection',font('barlow-regular.ttf'),28,M)
for i,(name,path,description) in enumerate([
('Barlow',font('barlow-regular.ttf'),'Selected for the new menu and event descriptions'),
('Barlow Condensed',font('barlow-condensed-medium.ttf'),'Selected for OrbOffice titles and ticket lettering'),
('Instrument Sans',font('instrument-sans.ttf'),'Alternative: a quieter contemporary UI')]):
y=215+i*285;d.rectangle((64,y,1536,y+245),fill=P)
line(90,y+23,name,path,36,Y)
line(90,y+82,'The Last Shuttle Home',path,62)
line(90,y+169,'101 Orbit One Tonight 21:30 Admit one',path,27)
line(90,y+210,description,font('barlow-regular.ttf'),22,M)
im.save(p/'font-comparison.png')