#!/usr/bin/env bash # Regenerate every app and tray icon from the ArtCraft "A" mark in docs/brand/, rendered exactly as # supplied. The mark is an ArtCraft trademark, NOT MIT/Apache: docs/brand/LICENSE-brand.txt. # # - App icon (Dock, taskbar, Start menu, Linux menus, installers): the blue mark, which is also # getartcraft.com's favicon. # - Tray: the black mark as the macOS menu-bar template; the blue mark on Windows, Linux and BSD. # # Needs: resvg (brew install resvg / cargo install resvg). The .ico and .icns are packed by # `cargo xtask ico` / `cargo xtask icns`, so this runs on any OS. The outputs are committed, so # packaging (and the Rust build, which include_bytes!s some of them) never needs these tools. # # packaging/icons.sh set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" DIR="$ROOT/assets/app-icon" BRAND="$ROOT/docs/brand" SVG="$BRAND/artcraft-mark.svg" ID="ai.storyteller.artcraft-launcher" TMP="$(mktemp -d)" trap 'rm -rf "$TMP"' EXIT command -v resvg >/dev/null || { echo "error: resvg not found (brew install resvg)" >&2; exit 1; } # The mark's artwork is untouched. macOS icons get a little more transparent margin (Apple's # 824/1024 icon grid) by widening the view box around it; everything else uses the file as is. BOX='viewBox="-10 -19.42 136.34 136.34"' grep -q "$BOX" "$SVG" || { echo "error: expected $BOX in $SVG" >&2; exit 1; } MAC="$TMP/mac.svg" sed "s/$BOX/viewBox=\"-17.5 -26.92 151.34 151.34\"/" "$SVG" >"$MAC" FLAT="$SVG" render() { resvg -w "$2" -h "$2" "$1" "$3"