"""The name and mark, in one place. Separate from `settings.app_name` on purpose, even though both now read "stocktake". They answer different questions and change at different times: `app_name` is the *storage* key — appcore derives the SQLite path from it, so changing it moves the database — while this is what a person reads on a page. Keeping them apart means a wording change ("Stocktake" → "Stocktake Pro") cannot quietly repoint a running installation at an empty file. """ from __future__ import annotations NAME = "Stocktake" TAGLINE = "Know what you hold, what it cost, and what the tax will be." # The geometry, and the ONLY copy of it: `tools/render_brand.py` generates the # partial, the favicon and the banners from here, and test_branding.py fails on # drift. A 24-grid, matching every nav icon. # Crates stacked one higher each column. The flag marks the accent crate. MARK_RECTS = ( (2.5, 15.5, False), (9.25, 15.5, False), (9.25, 9.0, False), (16.0, 15.5, False), (16.0, 9.0, False), (16.0, 2.5, True), ) WORDMARK_TYPEFACE = "IBM Plex Sans Condensed SemiBold" WORDMARK_VIEWBOX = "-12 -12 813 170" WORDMARK_WIDTH, WORDMARK_DEPTH = 789, 146 # Lowercase IBM Plex Sans Condensed SemiBold, converted to paths so the # mark stays stable without loading a font at runtime. The offsets retain # the font's advances and kerning rather than replacing them with a grid. WORDMARK_LETTERS = ( (0, ''), (86.52, ''), (150.74, ''), (248.9, ''), (338.92, ''), (436.31, ''), (501.1, ''), (599.46, ''), (697.04, ''), ) # Standalone artefacts (favicon, README banner) render outside the page and # cannot read its custom properties, so they carry their own colours. INK_LIGHT, INK_DARK = "#1a1d29", "#e7eaf4" ACCENT_LIGHT, ACCENT_DARK = "#4338ca", "#8b83f0" def mark_svg(css_class: str = "brandmark") -> str: """The mark, taking its colour from the page.""" rects = "".join( f'' for x, y, accent in MARK_RECTS ) return (f'") def wordmark_svg(css_class: str = "brandword") -> str: """The word, as paths.""" body = "".join(f'{g}' for x, g in WORDMARK_LETTERS) return (f'{body}')