diff --git a/apps/photocraft/src/main.rs b/apps/photocraft/src/main.rs index 76f25c46..02b551a7 100644 --- a/apps/photocraft/src/main.rs +++ b/apps/photocraft/src/main.rs @@ -16,6 +16,19 @@ mod services; use photocraft_engine::Session; use photocraft_ui_egui::PhotocraftApp; +/// Matches the `.desktop` file and hicolor icon name, so Wayland docks pick up the icon. +const APP_ID: &str = "ai.storyteller.photocraft"; + +/// Window, taskbar and (when running unbundled) Dock icon. macOS gets the padded 1024 px render +/// on Apple's icon grid; elsewhere the tighter 256 px hicolor render reads better at small sizes. +fn app_icon() -> egui::IconData { + #[cfg(target_os = "macos")] + const PNG: &[u8] = include_bytes!("../../../assets/app-icon/photocraft-1024.png"); + #[cfg(not(target_os = "macos"))] + const PNG: &[u8] = include_bytes!("../../../assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png"); + eframe::icon_data::from_png_bytes(PNG).unwrap_or_default() +} + fn main() -> eframe::Result { let mut control_port: Option = std::env::var("PHOTOCRAFT_CONTROL_PORT").ok().and_then(|p| p.parse().ok()); let mut files = Vec::new(); @@ -34,7 +47,10 @@ fn main() -> eframe::Result { } let options = eframe::NativeOptions { - viewport: egui::ViewportBuilder::default().with_title("PhotoCraft").with_inner_size([1440.0, 900.0]).with_min_inner_size([760.0, 480.0]).with_drag_and_drop(true).with_fullsize_content_view(true).with_titlebar_shown(false).with_title_shown(false), + viewport: egui::ViewportBuilder::default() + .with_icon(app_icon()) + .with_app_id(APP_ID) + .with_title("PhotoCraft").with_inner_size([1440.0, 900.0]).with_min_inner_size([760.0, 480.0]).with_drag_and_drop(true).with_fullsize_content_view(true).with_titlebar_shown(false).with_title_shown(false), ..Default::default() }; eframe::run_native( diff --git a/assets/app-icon/LICENSE.txt b/assets/app-icon/LICENSE.txt index 607cac76..b28ccee0 100644 --- a/assets/app-icon/LICENSE.txt +++ b/assets/app-icon/LICENSE.txt @@ -1,8 +1,9 @@ -Photocraft app icon (photocraft.svg and every file derived from it in this directory: -photocraft-1024.png, photocraft.icns, photocraft.ico, hicolor/). +PhotoCraft app icon (photocraft.svg, photocraft-small.svg and every file derived from them in +this directory: photocraft-1024.png, photocraft.icns, photocraft.ico, hicolor/). -Original artwork by the Photocraft authors, made for this project (no third-party material). -Licensed like the rest of Photocraft, under either of +Original artwork made for this project by the project owner: an engraving-style drawing created +in ArtCraft, then vectorised. No third-party material. Licensed like the rest of PhotoCraft, +under either of * Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0) * MIT license (https://opensource.org/licenses/MIT) diff --git a/assets/app-icon/README.md b/assets/app-icon/README.md new file mode 100644 index 00000000..fcac3a7d --- /dev/null +++ b/assets/app-icon/README.md @@ -0,0 +1,44 @@ +# PhotoCraft app icon + +A **nine-tailed kitsune with a brow diamond**: an engraving portrait, seated, looking back at the +viewer, in the Crafting Apps' owl-template framing (full-bleed field, head and body filling the +tile, tails running off the edges). + +## Palette + +Exactly three colours: + +| Colour | Hex | Used for | +|---|---|---| +| Ink | `#0b0b0c` | line work and contours | +| Paper | `#efe9dc` | the figure | +| PhotoCraft blue (app colour) | `#2f7bf5` | the full-bleed field | + +## Geometry + +A 512-unit tile (`viewBox="0 0 512 512"`), rounded square with `rx=112`, no border. The macOS +renders pad it onto Apple's 824/1024 icon grid; the Windows and Linux renders crop 22 units off +each side so the figure reads at 16–48 px. + +## Provenance + +The owner's original drawing, made in ArtCraft (2880 px, engraving style, keyed to the palette), +vectorised with craftrules `assets/logo-options/_tools/vectorize_tile.py`. The source PNG stays in +craftrules at `assets/app-icons/photocraft/source.png`. License: see `LICENSE.txt`. + +## Files + +- `photocraft.svg`: canonical master (traced at 2048 px). +- `photocraft-small.svg`: lighter trace (traced at 1024 px); also the hicolor scalable icon. +- `photocraft-1024.png`: 1024 px render on the macOS grid. +- `photocraft.icns`: macOS bundle icon (`CFBundleIconFile`). +- `photocraft.ico`: Windows icon, 16–256 px, embedded in the `.exe` by `apps/photocraft/build.rs`. +- `hicolor//apps/ai.storyteller.photocraft.png` (16–512) and `hicolor/scalable/...svg`: + Linux icon theme. + +The app also sets the window icon and Wayland app ID at runtime (`apps/photocraft/src/main.rs`). + +## Regenerate + +Replace `photocraft.svg` (and `photocraft-small.svg`), then run `packaging/icons.sh`. It needs +`resvg`, plus `iconutil` on macOS; the `.ico` is packed by `cargo xtask ico`. diff --git a/assets/app-icon/hicolor/128x128/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/128x128/apps/ai.storyteller.photocraft.png index 01901e1d..a28597fc 100644 Binary files a/assets/app-icon/hicolor/128x128/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/128x128/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/16x16/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/16x16/apps/ai.storyteller.photocraft.png index fedc75be..ec4cb496 100644 Binary files a/assets/app-icon/hicolor/16x16/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/16x16/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/24x24/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/24x24/apps/ai.storyteller.photocraft.png index 92eaaf59..249b9478 100644 Binary files a/assets/app-icon/hicolor/24x24/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/24x24/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png index 45fbb207..db2eb42d 100644 Binary files a/assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/256x256/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/32x32/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/32x32/apps/ai.storyteller.photocraft.png index 958dabfa..ad50ecb4 100644 Binary files a/assets/app-icon/hicolor/32x32/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/32x32/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/48x48/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/48x48/apps/ai.storyteller.photocraft.png index e2c50f23..341185fd 100644 Binary files a/assets/app-icon/hicolor/48x48/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/48x48/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/512x512/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/512x512/apps/ai.storyteller.photocraft.png index 106afb00..e54f75c9 100644 Binary files a/assets/app-icon/hicolor/512x512/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/512x512/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/64x64/apps/ai.storyteller.photocraft.png b/assets/app-icon/hicolor/64x64/apps/ai.storyteller.photocraft.png index da4b09fa..e093144c 100644 Binary files a/assets/app-icon/hicolor/64x64/apps/ai.storyteller.photocraft.png and b/assets/app-icon/hicolor/64x64/apps/ai.storyteller.photocraft.png differ diff --git a/assets/app-icon/hicolor/scalable/apps/ai.storyteller.photocraft.svg b/assets/app-icon/hicolor/scalable/apps/ai.storyteller.photocraft.svg index 3588471b..eaad6954 100644 --- a/assets/app-icon/hicolor/scalable/apps/ai.storyteller.photocraft.svg +++ b/assets/app-icon/hicolor/scalable/apps/ai.storyteller.photocraft.svg @@ -1,31 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/assets/app-icon/photocraft-1024.png b/assets/app-icon/photocraft-1024.png index 40eab3a6..b2f2081e 100644 Binary files a/assets/app-icon/photocraft-1024.png and b/assets/app-icon/photocraft-1024.png differ diff --git a/assets/app-icon/photocraft-small.svg b/assets/app-icon/photocraft-small.svg new file mode 100644 index 00000000..eaad6954 --- /dev/null +++ b/assets/app-icon/photocraft-small.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/app-icon/photocraft.icns b/assets/app-icon/photocraft.icns index 7a47d67d..650c7325 100644 Binary files a/assets/app-icon/photocraft.icns and b/assets/app-icon/photocraft.icns differ diff --git a/assets/app-icon/photocraft.ico b/assets/app-icon/photocraft.ico index 48a77196..88c8a0ad 100644 Binary files a/assets/app-icon/photocraft.ico and b/assets/app-icon/photocraft.ico differ diff --git a/assets/app-icon/photocraft.svg b/assets/app-icon/photocraft.svg index 3588471b..595cce74 100644 --- a/assets/app-icon/photocraft.svg +++ b/assets/app-icon/photocraft.svg @@ -1,31 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/docs/releasing.md b/docs/releasing.md index 2bfb795e..aa3ab7ee 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -182,8 +182,9 @@ The keychain is deleted at the end of the job. ## Icons -`assets/app-icon/photocraft.svg` is our own artwork (MIT OR Apache-2.0, see `LICENSE.txt` -there). `packaging/icons.sh` regenerates the 1024 px PNG, the `.icns`, the `.ico` (packed by +`assets/app-icon/photocraft.svg` is the canonical icon: the owner's ArtCraft drawing of a +nine-tailed kitsune, vectorised (MIT OR Apache-2.0, see `LICENSE.txt` there; palette and +geometry in `README.md`). `packaging/icons.sh` regenerates the 1024 px PNG, the `.icns`, the `.ico` (packed by `cargo xtask ico`) and the hicolor PNGs from it. It needs `resvg`, plus `iconutil` on macOS. The outputs are committed, so packaging never needs those tools. diff --git a/packaging/icons.sh b/packaging/icons.sh index de84786e..dd15ae05 100755 --- a/packaging/icons.sh +++ b/packaging/icons.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Regenerate every app icon from assets/app-icon/photocraft.svg. +# Regenerate every app icon from assets/app-icon/photocraft.svg (the canonical master). # # Needs: resvg (brew install resvg / cargo install resvg). On macOS, iconutil also writes the # .icns. The outputs are committed, so packaging never needs these tools. @@ -14,14 +14,18 @@ trap 'rm -rf "$TMP"' EXIT command -v resvg >/dev/null || { echo "error: resvg not found (brew install resvg)" >&2; exit 1; } -# macOS icons keep Apple's 824/1024 body grid (transparent margin). Windows and Linux icons are -# cropped tighter so the shape reads at 16-48 px. +# The artwork is a full-bleed 512-unit tile (rx=112). macOS icons pad it to Apple's 824/1024 body +# grid (transparent margin). Windows and Linux icons crop 22 units off each side (into the +# rounded corners) so the portrait reads at 16-48 px. +grep -q 'viewBox="0 0 512 512"' "$SVG" || { echo "error: expected viewBox=\"0 0 512 512\" in $SVG" >&2; exit 1; } +MAC="$TMP/mac.svg" +sed 's/viewBox="0 0 512 512"/viewBox="-62 -62 636 636"/' "$SVG" >"$MAC" TIGHT="$TMP/tight.svg" -sed 's/viewBox="0 0 1024 1024"/viewBox="88 88 848 848"/' "$SVG" >"$TIGHT" +sed 's/viewBox="0 0 512 512"/viewBox="22 22 468 468"/' "$SVG" >"$TIGHT" render() { resvg -w "$2" -h "$2" "$1" "$3" /dev/null; then SET="$TMP/photocraft.iconset" mkdir -p "$SET" for s in 16 32 128 256 512; do - render "$SVG" "$s" "$SET/icon_${s}x${s}.png" - render "$SVG" $((s * 2)) "$SET/icon_${s}x${s}@2x.png" + render "$MAC" "$s" "$SET/icon_${s}x${s}.png" + render "$MAC" $((s * 2)) "$SET/icon_${s}x${s}@2x.png" done iconutil -c icns -o "$DIR/photocraft.icns" "$SET" else