From 437320509da102f5d9aca44d411ffb254f071932 Mon Sep 17 00:00:00 2001
From: Brandon Thomas
+
+
@@ -220,6 +224,8 @@ And [**ArtCraft**](https://getartcraft.com/) itself, our AI image and video stud
MIT OR Apache-2.0. Bundled fonts are OFL, Lucide icons are ISC, and all other icons and art are
original. Per-asset attribution is in [`ASSETS.md`](ASSETS.md) (see also [`NOTICE`](NOTICE)).
+The app icon (an engraved dragon on VectorCraft red, `#e8573f`) is the owner's original artwork; its
+palette and files are in [`assets/app-icon/`](assets/app-icon/README.md).
VectorCraft is an independent project and is not affiliated with or endorsed by Adobe. "Adobe", "Illustrator", "Photoshop", "Premiere Pro", "Lightroom" and "Acrobat" are trademarks of Adobe Inc., used here only to describe compatibility and workflow familiarity.
diff --git a/apps/vectorcraft/Cargo.toml b/apps/vectorcraft/Cargo.toml
index afa9a81d..97731d61 100644
--- a/apps/vectorcraft/Cargo.toml
+++ b/apps/vectorcraft/Cargo.toml
@@ -24,3 +24,7 @@ webbrowser = { workspace = true }
[target.'cfg(target_os = "macos")'.dependencies]
muda = { version = "0.21", default-features = false }
+
+[build-dependencies]
+# Icon + VERSIONINFO for vectorcraft.exe; build.rs only uses it when targeting Windows.
+winresource = "0.1"
diff --git a/apps/vectorcraft/build.rs b/apps/vectorcraft/build.rs
new file mode 100644
index 00000000..931c49e4
--- /dev/null
+++ b/apps/vectorcraft/build.rs
@@ -0,0 +1,28 @@
+//! Windows only: embed the app icon and version info (VERSIONINFO) into `vectorcraft.exe`.
+//!
+//! On every other target this does nothing. A missing resource compiler is a warning, so a
+//! cross-compile from macOS or Linux still links, unless `VECTORCRAFT_REQUIRE_WINRES=1` turns it into
+//! an error (for release builds).
+
+fn main() {
+ println!("cargo:rerun-if-changed=build.rs");
+ println!("cargo:rerun-if-changed=../../assets/app-icon/vectorcraft.ico");
+ println!("cargo:rerun-if-env-changed=VECTORCRAFT_REQUIRE_WINRES");
+ if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
+ return;
+ }
+ let mut res = winresource::WindowsResource::new();
+ res.set_icon("../../assets/app-icon/vectorcraft.ico")
+ .set("ProductName", "VectorCraft")
+ .set("FileDescription", "VectorCraft vector illustration editor")
+ .set("CompanyName", "Learning Machines LLC")
+ .set("LegalCopyright", "Copyright (c) the VectorCraft authors. MIT OR Apache-2.0.")
+ .set("OriginalFilename", "vectorcraft.exe")
+ .set("InternalName", "vectorcraft");
+ if let Err(e) = res.compile() {
+ if std::env::var_os("VECTORCRAFT_REQUIRE_WINRES").is_some() {
+ panic!("embedding Windows resources failed: {e}");
+ }
+ println!("cargo:warning=vectorcraft.exe built without icon/version resources: {e}");
+ }
+}
diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs
index 8982bb19..7c0ab7d2 100644
--- a/apps/vectorcraft/src/main.rs
+++ b/apps/vectorcraft/src/main.rs
@@ -116,6 +116,17 @@ fn services() -> Services {
}
}
+/// The window, Dock, taskbar and app-switcher icon (`assets/app-icon/`, see its README). macOS gets
+/// the version with Apple's transparent margin; elsewhere the full-bleed tile. The app ID matches
+/// `packaging/linux/ai.storyteller.vectorcraft.desktop` so Wayland docks find the launcher icon.
+fn app_icon() -> egui::IconData {
+ #[cfg(target_os = "macos")]
+ let png: &[u8] = include_bytes!("../../../assets/app-icon/vectorcraft-macos-512.png");
+ #[cfg(not(target_os = "macos"))]
+ let png: &[u8] = include_bytes!("../../../assets/app-icon/hicolor/256x256/apps/ai.storyteller.vectorcraft.png");
+ eframe::icon_data::from_png_bytes(png).unwrap_or_default()
+}
+
fn main() -> eframe::Result {
let mut control_port: Option YJXuz+K;(Laes=YSyc
zK%zFUY*5nW=>%Dd$-^bSxFaCSYxaUZ<=Sv~U0we)PoU#DW=8A{EcX;3!Y6M->Id;I
z4h7+=MCLncjx_=^3p>4IkHD(M%j~*K6N1+!lz^mwBmghBQ(_w#Epov=Qm8qNnuhPn
zb$qN_7w@H-f8qXvPS3sP>hv88AfKku_{2N_em9^14gr}NG2L4bH++)6&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