Icon: scalable SVG (hicolor/scalable) generated by xtask icon

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas 2026-10-09 13:39:03 -04:00
parent 38a30d6aaf
commit 077ed64739
6 changed files with 15 additions and 0 deletions

1
Cargo.lock generated
View File

@ -5197,6 +5197,7 @@ dependencies = [
"figcraft-doc",
"figcraft-engine",
"figcraft-render",
"figcraft-svg",
"image",
"serde_json",
]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -11,4 +11,5 @@ figcraft-doc = { workspace = true }
figcraft-color = { workspace = true }
figcraft-render = { workspace = true }
figcraft-engine = { workspace = true }
figcraft-svg = { workspace = true }
image = { workspace = true }

View File

@ -109,6 +109,17 @@ pub fn generate(root: &std::path::Path) -> bool {
ico.extend_from_slice(png);
}
ok &= std::fs::write(dir.join("figcraft.ico"), ico).is_ok();
// Scalable SVG (same artwork, written by FigCraft's SVG exporter).
let tops: Vec<_> = doc.node(page).map(|p| p.children.clone()).unwrap_or_default();
match figcraft_svg::export_svg(&doc, &tops, &Default::default()) {
Some(svg) => {
let sd = dir.join("hicolor/scalable/apps");
let _ = std::fs::create_dir_all(&sd);
ok &= std::fs::write(dir.join("figcraft.svg"), &svg).is_ok();
ok &= std::fs::write(sd.join("ai.storyteller.figcraft.svg"), &svg).is_ok();
}
None => ok = false,
}
eprintln!("icon: wrote {}", dir.display());
ok
}