diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 4c641aa9..2ff0f631 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -8,13 +8,14 @@ licensed and keep their license file next to them. | Path | Title | Author | Source | License | |---|---|---|---|---| -| `assets/app-icon/icon.py` | App icon generator (octopus) | TextureCraft contributors | original | MIT OR Apache-2.0 | -| `assets/app-icon/icon.svg` | App icon, master vector (generated by `icon.py`) | TextureCraft contributors | original | MIT OR Apache-2.0 | -| `assets/app-icon/icon-1024.png` | App icon, 1024 px | TextureCraft contributors | original | MIT OR Apache-2.0 | -| `assets/app-icon/texturecraft.ico` | Windows app icon (16-256 px) | TextureCraft contributors | original | MIT OR Apache-2.0 | -| `assets/app-icon/texturecraft.icns` | macOS app icon (16-1024 px) | TextureCraft contributors | original | MIT OR Apache-2.0 | -| `assets/app-icon/hicolor/{16x16,24x24,32x32,48x48,64x64,128x128,256x256,512x512}/apps/ai.storyteller.texturecraft.png` | App icon, hicolor theme PNGs | TextureCraft contributors | original | MIT OR Apache-2.0 | -| `assets/app-icon/hicolor/scalable/apps/ai.storyteller.texturecraft.svg` | App icon, hicolor scalable (copy of `icon.svg`) | TextureCraft contributors | original | MIT OR Apache-2.0 | +| `assets/app-icon/texturecraft.svg` | App icon (engraved zebra), master vector traced at 2048 px | Project owner (ArtCraft team) | Original artwork drawn in ArtCraft for TextureCraft, vectorised with craftrules `vectorize_tile.py` | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/texturecraft-small.svg` | App icon (engraved zebra), lighter vector traced at 1024 px | Project owner (ArtCraft team) | Original artwork drawn in ArtCraft for TextureCraft, vectorised with craftrules `vectorize_tile.py` | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/texturecraft-1024.png` | App icon (engraved zebra), 1024 px | Project owner (ArtCraft team) | Original artwork drawn in ArtCraft for TextureCraft, rendered by `packaging/icons.sh` | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/texturecraft.ico` | App icon (engraved zebra), Windows (16-256 px) | Project owner (ArtCraft team) | Original artwork drawn in ArtCraft for TextureCraft, rendered by `packaging/icons.sh` | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/texturecraft.icns` | App icon (engraved zebra), macOS (16-1024 px) | Project owner (ArtCraft team) | Original artwork drawn in ArtCraft for TextureCraft, rendered by `packaging/icons.sh` | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/hicolor/{16x16,24x24,32x32,48x48,64x64,128x128,256x256,512x512}/apps/ai.storyteller.texturecraft.png` | App icon (engraved zebra), hicolor theme PNGs | Project owner (ArtCraft team) | Original artwork drawn in ArtCraft for TextureCraft, rendered by `packaging/icons.sh` | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/hicolor/scalable/apps/ai.storyteller.texturecraft.svg` | App icon (engraved zebra), hicolor scalable (copy of `texturecraft-small.svg`) | Project owner (ArtCraft team) | Original artwork drawn in ArtCraft for TextureCraft, vectorised with craftrules `vectorize_tile.py` | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/LICENSE.txt`, `assets/app-icon/README.md` | App icon licence and notes | TextureCraft contributors | original | MIT OR Apache-2.0 | | `docs/images/texturecraft-workspace.png` | README screenshot: the TextureCraft workspace (material ball in chipped paint, grime and a gold stripe) | TextureCraft contributors | original screenshot of TextureCraft | MIT OR Apache-2.0 | | `docs/images/texturecraft-bake.png` | README screenshot: bake mode | TextureCraft contributors | original screenshot of TextureCraft | MIT OR Apache-2.0 | | `docs/images/texturecraft-export.png` | README screenshot: the Export textures dialog | TextureCraft contributors | original screenshot of TextureCraft | MIT OR Apache-2.0 | diff --git a/README.md b/README.md index 08e729c4..c6fddb5d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@

- - ArtCraft + + ArtCraft

- TextureCraft icon: an octopus on a rust-orange tile + TextureCraft icon: an engraved zebra on a copper tile

TextureCraft

@@ -329,6 +329,6 @@ Forks and modified versions must remove them. Adobe, Substance 3D Painter, Photoshop, Illustrator, Premiere Pro, Lightroom, Acrobat, After Effects and InDesign are trademarks or registered trademarks of Adobe Inc. in the United States and/or other countries. TextureCraft is an independent, open-source project and is not affiliated with, sponsored by or endorsed by Adobe Inc.; these names are used only to describe the workflows it is compatible with.

- ArtCraft
+ ArtCraft
Made by the ArtCraft team and community.

diff --git a/assets/app-icon/LICENSE.txt b/assets/app-icon/LICENSE.txt new file mode 100644 index 00000000..82a1ec40 --- /dev/null +++ b/assets/app-icon/LICENSE.txt @@ -0,0 +1,12 @@ +TextureCraft app icon (texturecraft.svg, texturecraft-small.svg and every file derived from them in this +directory: texturecraft-1024.png, texturecraft.icns, texturecraft.ico, hicolor/). + +Original artwork made for this project by the project owner, drawn in ArtCraft and vectorised for +TextureCraft (no third-party material). Licensed like the rest of TextureCraft, under either of + + * Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0) + * MIT license (https://opensource.org/licenses/MIT) + +at your option. + +Regenerate the derived files with packaging/icons.sh. diff --git a/assets/app-icon/README.md b/assets/app-icon/README.md new file mode 100644 index 00000000..2130c6d0 --- /dev/null +++ b/assets/app-icon/README.md @@ -0,0 +1,59 @@ +# TextureCraft app icon + +**Creature:** an engraved zebra, TextureCraft's mascot. + +**Style:** an engraving-style portrait in the Crafting Apps owl template (the FilmCraft owl): a tight +head-and-shoulders portrait on a full-bleed field, no frame or roundel, with the body running off the tile. + +**Palette** (exactly three colours): + +| Colour | Hex | Used for | +|---|---|---| +| Ink | `#0b0b0c` | line work and contour | +| Paper | `#efe9dc` | the figure | +| TextureCraft copper | `#c2672b` | the full-bleed field; also the default UI accent "Copper" (`crates/ui-egui/src/theme.rs`) | + +**Tile:** `viewBox="0 0 512 512"`, a rounded square with `rx=112`, clipped. The macOS `.icns` adds +Apple's transparent margin (tile = 824/1024 of the canvas); Windows and Linux use the tile edge to edge. + +**Provenance:** the owner's original ArtCraft drawing (2048 px), vectorised with +craftrules `assets/logo-options/_tools/vectorize_tile.py`. The drawing is kept in craftrules at +`craftrules/assets/app-icons/texturecraft/source.png`, not here. `texturecraft.svg` is the canonical +artwork. Licence: see `LICENSE.txt`. + +## Files + +| File | What | Used by | +|---|---|---| +| `texturecraft.svg` | master vector (traced at 2048 px, about 840 KB) | source for everything below | +| `texturecraft-small.svg` | lighter vector (traced at 1024 px, about 240 KB) | `hicolor/scalable` | +| `texturecraft-1024.png` | full tile, 1024 px | docs, store listings | +| `texturecraft.icns` | macOS icon set, 16 to 1024 px | `packaging/macos/package.sh` (`CFBundleIconFile`) | +| `texturecraft.ico` | Windows icon, 16 to 256 px | `apps/texturecraft/build.rs` (embedded in the `.exe`), the MSI (`packaging/windows/package.ps1`) | +| `hicolor//apps/ai.storyteller.texturecraft.png` | Linux theme icons, 16 to 512 px; the 256 one is also the runtime window icon (`apps/texturecraft/src/main.rs`) and the README icon | `packaging/linux/ai.storyteller.texturecraft.desktop` | +| `hicolor/scalable/apps/ai.storyteller.texturecraft.svg` | Linux scalable icon | as above | + +## How it reaches each OS + +- **macOS:** the app sets the Dock / app-switcher icon at runtime (`ViewportBuilder::with_icon`); the + `.app` from `packaging/macos/package.sh` carries `texturecraft.icns`. +- **Windows:** `build.rs` embeds `texturecraft.ico` and VERSIONINFO with `winresource` (taskbar, Start + menu, Explorer, Alt-Tab); the runtime icon covers the title bar, and the MSI uses the same `.ico` + for its shortcuts. +- **Linux and FreeBSD:** the packages install `packaging/linux/ai.storyteller.texturecraft.desktop` to + `share/applications/` and `hicolor/` to `share/icons/`; the AppImage and Flatpak carry the same + files. + +## Regenerate + +Edit or replace `texturecraft.svg` (and `texturecraft-small.svg`), then run `packaging/icons.sh` +(needs `resvg`). It writes every PNG, the `.ico` (via `cargo xtask ico`) and the `.icns` (via +`cargo xtask icns`). + +To trace a new drawing, use craftrules' vectoriser as the other Crafting Apps did (needs numpy, +pillow and potracer): + +```sh +OPT=0.4 DP=1 python3 vectorize_tile.py source.png '#c2672b' 2048 2 texturecraft.svg +OPT=1.0 DP=0 python3 vectorize_tile.py source.png '#c2672b' 1024 4 texturecraft-small.svg +``` diff --git a/assets/app-icon/hicolor/128x128/apps/ai.storyteller.texturecraft.png b/assets/app-icon/hicolor/128x128/apps/ai.storyteller.texturecraft.png index 03736467..8aed40a5 100644 Binary files a/assets/app-icon/hicolor/128x128/apps/ai.storyteller.texturecraft.png and b/assets/app-icon/hicolor/128x128/apps/ai.storyteller.texturecraft.png differ diff --git a/assets/app-icon/hicolor/16x16/apps/ai.storyteller.texturecraft.png b/assets/app-icon/hicolor/16x16/apps/ai.storyteller.texturecraft.png index e1fef320..435b7170 100644 Binary files a/assets/app-icon/hicolor/16x16/apps/ai.storyteller.texturecraft.png and b/assets/app-icon/hicolor/16x16/apps/ai.storyteller.texturecraft.png differ diff --git a/assets/app-icon/hicolor/24x24/apps/ai.storyteller.texturecraft.png b/assets/app-icon/hicolor/24x24/apps/ai.storyteller.texturecraft.png index cb6b3d3d..4b0ac1c5 100644 Binary files a/assets/app-icon/hicolor/24x24/apps/ai.storyteller.texturecraft.png and b/assets/app-icon/hicolor/24x24/apps/ai.storyteller.texturecraft.png differ diff --git a/assets/app-icon/hicolor/256x256/apps/ai.storyteller.texturecraft.png b/assets/app-icon/hicolor/256x256/apps/ai.storyteller.texturecraft.png index c15bfa91..d4bdf9eb 100644 Binary files a/assets/app-icon/hicolor/256x256/apps/ai.storyteller.texturecraft.png and b/assets/app-icon/hicolor/256x256/apps/ai.storyteller.texturecraft.png differ diff --git a/assets/app-icon/hicolor/32x32/apps/ai.storyteller.texturecraft.png b/assets/app-icon/hicolor/32x32/apps/ai.storyteller.texturecraft.png index a633d495..65716a87 100644 Binary files a/assets/app-icon/hicolor/32x32/apps/ai.storyteller.texturecraft.png and b/assets/app-icon/hicolor/32x32/apps/ai.storyteller.texturecraft.png differ diff --git a/assets/app-icon/hicolor/48x48/apps/ai.storyteller.texturecraft.png b/assets/app-icon/hicolor/48x48/apps/ai.storyteller.texturecraft.png index f6dec508..15c2b83e 100644 Binary files a/assets/app-icon/hicolor/48x48/apps/ai.storyteller.texturecraft.png and b/assets/app-icon/hicolor/48x48/apps/ai.storyteller.texturecraft.png differ diff --git a/assets/app-icon/hicolor/512x512/apps/ai.storyteller.texturecraft.png b/assets/app-icon/hicolor/512x512/apps/ai.storyteller.texturecraft.png index 9ab1231a..c8574812 100644 Binary files a/assets/app-icon/hicolor/512x512/apps/ai.storyteller.texturecraft.png and b/assets/app-icon/hicolor/512x512/apps/ai.storyteller.texturecraft.png differ diff --git a/assets/app-icon/hicolor/64x64/apps/ai.storyteller.texturecraft.png b/assets/app-icon/hicolor/64x64/apps/ai.storyteller.texturecraft.png index 21b04424..a0a1aba5 100644 Binary files a/assets/app-icon/hicolor/64x64/apps/ai.storyteller.texturecraft.png and b/assets/app-icon/hicolor/64x64/apps/ai.storyteller.texturecraft.png differ diff --git a/assets/app-icon/hicolor/scalable/apps/ai.storyteller.texturecraft.svg b/assets/app-icon/hicolor/scalable/apps/ai.storyteller.texturecraft.svg index 1bb8fbd2..ecab9e1e 100644 --- a/assets/app-icon/hicolor/scalable/apps/ai.storyteller.texturecraft.svg +++ b/assets/app-icon/hicolor/scalable/apps/ai.storyteller.texturecraft.svg @@ -1,169 +1 @@ - - TextureCraft - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/assets/app-icon/icon-1024.png b/assets/app-icon/icon-1024.png deleted file mode 100644 index 58eceab1..00000000 Binary files a/assets/app-icon/icon-1024.png and /dev/null differ diff --git a/assets/app-icon/icon.py b/assets/app-icon/icon.py deleted file mode 100644 index a85a64a3..00000000 --- a/assets/app-icon/icon.py +++ /dev/null @@ -1,164 +0,0 @@ -"""TextureCraft app icon: an octopus drawn in code, written to icon.svg beside this file. - -Original artwork (no traced or third-party source), MIT OR Apache-2.0 like the rest of the repo. -Follows craftrules standards/icon-design.md: 512 tile with rx=112, three colours only (ink, paper, -TextureCraft copper), a tight head-and-shoulders portrait with big eyes, carved lines that swell -and taper. Edit the shapes here, run `python3 assets/app-icon/icon.py`, then `packaging/icons.sh` -to render every PNG, the .ico and the .icns. Plain Python 3, no dependencies. -""" -import math -from pathlib import Path - -INK, PAPER, APP = "#0b0b0c", "#efe9dc", "#c2672b" - - -def catmull(pts, n=24, closed=False): - out = [] - m = len(pts) - segs = m if closed else m - 1 - for i in range(segs): - g = (lambda k: pts[k % m]) if closed else (lambda k: pts[min(max(k, 0), m - 1)]) - p0, p1, p2, p3 = g(i - 1), g(i), g(i + 1), g(i + 2) - for s in range(n): - t = s / n - t2, t3 = t * t, t * t * t - out.append(tuple(0.5 * ((2 * p1[j]) + (-p0[j] + p2[j]) * t + (2 * p0[j] - 5 * p1[j] + 4 * p2[j] - p3[j]) * t2 - + (-p0[j] + 3 * p1[j] - 3 * p2[j] + p3[j]) * t3) for j in range(2))) - if not closed: - out.append(pts[-1]) - return out - - -def arclen(pts): - acc = [0.0] - for a, b in zip(pts, pts[1:]): - acc.append(acc[-1] + math.dist(a, b)) - total = acc[-1] or 1.0 - return [a / total for a in acc] - - -def normals(pts): - out = [] - for i in range(len(pts)): - a = pts[max(i - 1, 0)] - b = pts[min(i + 1, len(pts) - 1)] - dx, dy = b[0] - a[0], b[1] - a[1] - d = math.hypot(dx, dy) or 1.0 - out.append((-dy / d, dx / d)) - return out - - -def path(pts, close=True): - s = "M" + " L".join(f"{x:.1f} {y:.1f}" for x, y in pts) - return s + (" Z" if close else "") - - -def ribbon(center, width, offset=lambda u: 0.0, u0=0.0, u1=1.0): - """Closed outline of a stroke along `center` whose width (and sideways offset) vary with u.""" - us = arclen(center) - ns = normals(center) - left, right = [], [] - for p, n, u in zip(center, ns, us): - if u < u0 or u > u1: - continue - v = (u - u0) / ((u1 - u0) or 1) - w, o = width(v) / 2, offset(u) - left.append((p[0] + n[0] * (o + w), p[1] + n[1] * (o + w))) - right.append((p[0] + n[0] * (o - w), p[1] + n[1] * (o - w))) - return left + right[::-1] - - -def swell(peak, lo=0.0): - """Carved line: thin at both ends, `peak` wide in the middle.""" - return lambda v: lo + (peak - lo) * math.sin(math.pi * min(max(v, 0), 1)) ** 0.8 - - -def at(center, u): - us = arclen(center) - ns = normals(center) - for i in range(1, len(us)): - if us[i] >= u: - return center[i], ns[i] - return center[-1], ns[-1] - - -out = [] -el = out.append - - -def arm(points, base, tip, side, suckers=(0.45, 0.97), shade=(0.05, 0.75)): - """An arm: paper body with ink contour, a carved shading line, suckers along `side`.""" - c = catmull(points) - w = lambda v: tip + (base - tip) * (1 - v) ** 1.15 - el(f'') - # Shading line on the side away from the suckers. - el(f'') - # Suckers: paper discs with an ink ring and a dark centre, shrinking toward the tip. - u = suckers[0] - while u < suckers[1]: - p, n = at(c, u) - r = max(w(u) * 0.2, 3.2) - cx, cy = p[0] + n[0] * side * w(u) * 0.36, p[1] + n[1] * side * w(u) * 0.36 - el(f'') - if r > 5: - el(f'') - u += max(r * 2.9, 8) / 420 - - -# Arms, back to front. -arm([(206, 262), (140, 292), (78, 300), (38, 278), (32, 242), (58, 226), (80, 242), (70, 262)], 96, 7, 1, suckers=(0.42, 0.97)) # left curl -arm([(306, 262), (372, 292), (434, 300), (474, 278), (480, 242), (454, 226), (432, 242), (442, 262)], 96, 7, -1, suckers=(0.42, 0.97)) # right curl -arm([(222, 262), (196, 300), (150, 352), (104, 424), (76, 540)], 98, 34, -1, suckers=(0.3, 1.0)) # left, off the bottom -arm([(290, 262), (316, 300), (360, 352), (420, 402), (462, 452), (452, 494), (416, 492), (410, 464), (428, 452)], 98, 7, 1, suckers=(0.4, 0.97)) # right, curl -arm([(240, 250), (236, 302), (222, 382), (196, 446), (184, 540)], 104, 40, 1, suckers=(0.34, 1.0)) # front left -arm([(274, 250), (280, 302), (302, 372), (302, 432), (278, 476), (244, 472), (236, 446), (254, 436)], 104, 7, 1, suckers=(0.4, 0.97)) # front right curl - -# Head: mantle + eye region, one silhouette. -head = catmull([(262, 62), (338, 74), (390, 116), (406, 176), (378, 226), (364, 254), (332, 286), (256, 302), (180, 286), - (148, 254), (134, 226), (108, 176), (128, 112), (186, 72)], closed=True) -el(f'') -el(f'') -# Engraved shading: contour-following lines that thicken toward the shadow side (right and below). -cx0, cy0 = 236, 156 -for k, f in enumerate([0.95, 0.88, 0.81, 0.74, 0.67]): - ring = [(cx0 + (x - cx0) * f, cy0 + (y - cy0) * f) for x, y in head] - n = len(ring) - # Right flank of the mantle, in shadow. - arc = ring[int(n * (0.03 + k * 0.012)):int(n * (0.30 - k * 0.012))] - el(f'') -for k, f in enumerate([0.95, 0.9]): - ring = [(cx0 + (x - cx0) * f, cy0 + (y - cy0) * f) for x, y in head] - n = len(ring) - # Under the head, where the arms join. - arc = ring[int(n * (0.40 + k * 0.02)):int(n * (0.60 - k * 0.02))] - el(f'') -# A few carved strokes over the dome (texture), left side lighter. -for pts, wd in [([(196, 104), (176, 124), (166, 150)], 6), ([(222, 96), (212, 108)], 4.5), ([(288, 98), (312, 112), (330, 134)], 6)]: - el(f'') - -# Eyes. -for ex, ey, look in [(172, 214, 4), (340, 214, -4)]: - el(f'') - el(f'') - el(f'') - el(f'') - el(f'') - s = 1 if ex < 256 else -1 - # Upper lid: a heavy carved arc. - lid = catmull([(ex - 50 * s, ey - 18), (ex - 20 * s, ey - 50), (ex + 22 * s, ey - 52), (ex + 48 * s, ey - 28)]) - el(f'') - # Lower lid crease. - low = catmull([(ex - 34 * s, ey + 44), (ex, ey + 58), (ex + 36 * s, ey + 46)]) - el(f'') - -body = "\n ".join(out) -svg = f''' - TextureCraft - - - - {body} - - -''' -Path(__file__).with_name("icon.svg").write_text(svg, encoding="utf-8", newline="\n") diff --git a/assets/app-icon/icon.svg b/assets/app-icon/icon.svg deleted file mode 100644 index 1bb8fbd2..00000000 --- a/assets/app-icon/icon.svg +++ /dev/null @@ -1,169 +0,0 @@ - - TextureCraft - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/app-icon/texturecraft-1024.png b/assets/app-icon/texturecraft-1024.png new file mode 100644 index 00000000..7e6a7ba7 Binary files /dev/null and b/assets/app-icon/texturecraft-1024.png differ diff --git a/assets/app-icon/texturecraft-small.svg b/assets/app-icon/texturecraft-small.svg new file mode 100644 index 00000000..ecab9e1e --- /dev/null +++ b/assets/app-icon/texturecraft-small.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/app-icon/texturecraft.icns b/assets/app-icon/texturecraft.icns index b7c64eca..1a9aefd1 100644 Binary files a/assets/app-icon/texturecraft.icns and b/assets/app-icon/texturecraft.icns differ diff --git a/assets/app-icon/texturecraft.ico b/assets/app-icon/texturecraft.ico index 7592b795..4b2e9cca 100644 Binary files a/assets/app-icon/texturecraft.ico and b/assets/app-icon/texturecraft.ico differ diff --git a/assets/app-icon/texturecraft.svg b/assets/app-icon/texturecraft.svg new file mode 100644 index 00000000..62fc6754 --- /dev/null +++ b/assets/app-icon/texturecraft.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index dc1bd1c9..565ce737 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -73,7 +73,7 @@ impl Accent { /// with white lettering. The values other than Copper's are VectorCraft's. pub(crate) fn colors(self, dark: bool) -> (Color32, Color32) { let (a, strong) = match (self, dark) { - // The app icon's copper (#c2672b, assets/app-icon/icon.py). + // The app icon's copper (#c2672b, assets/app-icon/texturecraft.svg). (Accent::Copper, true) => (0xe58a4e, 0xc2672b), (Accent::Copper, false) => (0xae5419, 0xb85c22), (Accent::Coral, true) => (0xf06a52, 0xe8573f), diff --git a/docs/releasing.md b/docs/releasing.md index d6c680db..c5d05305 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -158,11 +158,12 @@ unsigned artifact and a `::warning::`, never a failed build. ## Icons -`assets/app-icon/icon.py` draws the octopus (original artwork, three colours, craftrules -`standards/icon-design.md`) into `icon.svg`. `packaging/icons.sh` renders everything else with -resvg and `cargo xtask ico|icns`: the hicolor PNGs (16-512 px) and scalable SVG, `icon-1024.png`, -`texturecraft.ico` and `texturecraft.icns`. The outputs are committed; rerun both after changing -the drawing and keep `ATTRIBUTION.md` in step. +`assets/app-icon/texturecraft.svg` is the engraved zebra (the owner's original drawing, vectorised +to three colours, craftrules `standards/icon-design.md`); `texturecraft-small.svg` is a lighter +trace for the hicolor scalable icon. `packaging/icons.sh` renders everything else with resvg and +`cargo xtask ico|icns`: the hicolor PNGs (16-512 px) and scalable SVG, `texturecraft-1024.png`, +`texturecraft.ico` and `texturecraft.icns`. The outputs are committed; rerun it after changing the +artwork and keep `ATTRIBUTION.md` in step. See `assets/app-icon/README.md`. ## Local checks diff --git a/packaging/icons.sh b/packaging/icons.sh index 06996126..15deb7c9 100644 --- a/packaging/icons.sh +++ b/packaging/icons.sh @@ -1,48 +1,45 @@ #!/usr/bin/env bash -# Regenerate every app icon from assets/app-icon/icon.svg (written by assets/app-icon/icon.py). +# Regenerate every app icon from assets/app-icon/texturecraft.svg (the canonical artwork). # # Needs: resvg (cargo install resvg / brew install resvg) and cargo (for `cargo xtask ico|icns`). # The outputs are committed, so packaging never needs these tools. # -# python3 assets/app-icon/icon.py && packaging/icons.sh +# packaging/icons.sh set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" DIR="$ROOT/assets/app-icon" -SVG="$DIR/icon.svg" +SVG="$DIR/texturecraft.svg" ID=ai.storyteller.texturecraft TMP="$(mktemp -d)" trap 'rm -rf "$TMP"' EXIT command -v resvg >/dev/null || { echo "error: resvg not found (cargo install resvg)" >&2; exit 1; } -# 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; } +# The SVG is a full-bleed 512 tile, used as-is on Windows and Linux. macOS icons follow Apple's grid: +# the tile is 824/1024 of the canvas with a transparent margin, so widen the viewBox around it. 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 512 512"/viewBox="22 22 468 468"/' "$SVG" >"$TIGHT" +sed 's/viewBox="0 0 512 512"/viewBox="-62.136 -62.136 636.272 636.272"/' "$SVG" >"$MAC" +grep -q 'viewBox="-62.136' "$MAC" || { echo "error: $SVG has no 512 viewBox" >&2; exit 1; } render() { resvg -w "$2" -h "$2" "$1" "$3"