Type tool icons: one family, the same T with a frame, wave, arrow or dotted box; the vertical Area and Path tools get their own

This commit is contained in:
ham9zah
2026-11-02 14:36:09 +07:00
committed by bflatastic
parent 6fd542822d
commit a141372cd9
11 changed files with 32 additions and 7 deletions
+3
View File
@@ -228,9 +228,12 @@ Generated-in-code art is original and has no file to list. This covers the defau
| `assets/icons/dc-transform-panel.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-transparency.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-twirl.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-type.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-type-area.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-type-path.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-type-vertical.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-type-vertical-area.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-type-vertical-path.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-width-profile.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-width.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-wrinkle.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 5h9M10.5 5v11"/><rect x="14" y="12" width="7" height="8" stroke-dasharray="1.5 1.5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 5V4h10v1M8 4v10M6 14h4"/><rect x="14" y="12" width="7" height="9" stroke-dasharray="0.01 2.6"/><circle cx="21" cy="12" r="1.2" fill="currentColor"/></svg>

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 350 B

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" stroke-dasharray="2 2"/><path d="M8 8h8M12 8v9"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 5V4h10v1M8 4v10M6 14h4"/><rect x="14" y="12" width="7" height="9" rx="1"/><path d="M16.2 15h2.6M16.2 18h2.6"/></svg>

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 312 B

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 19 C8 9 16 9 21 19"/><path d="M8 5h8M12 5v8"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 5V4h10v1M10 4v9M8 13h4"/><path d="M3 19.5c2.5-3.5 5.5-4 8-2s5.5 1.5 10-2.5"/></svg>

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 279 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 5V4h10v1M8 4v10M6 14h4"/><rect x="14" y="12" width="7" height="9" rx="1"/><path d="M16.2 14.5v4M18.8 14.5v4"/></svg>

After

Width:  |  Height:  |  Size: 312 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 5V4h9v1M7.5 4v9M5.5 13h4"/><path d="M18 3v8M16 9l2 2 2-2"/><path d="M3 19.5c2.5-3.5 5.5-4 8-2s5.5 1.5 10-2.5"/></svg>

After

Width:  |  Height:  |  Size: 313 B

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 4h10M12 4v8"/><path d="M9 15h6M12 15v6"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 5V4h10v1M8 4v10M6 14h4"/><path d="M18 9v12M15.5 18.5 18 21l2.5-2.5"/></svg>

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 271 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 6V4h14v2M12 4v16M9 20h6"/></svg>

After

Width:  |  Height:  |  Size: 228 B

+2 -2
View File
@@ -37,8 +37,8 @@ pub const TOOL_GROUPS: &[&[ToolInfo]] = &[
t("areaType", "Area Type Tool", None, "tool-type-area"),
t("typeOnPath", "Type on a Path Tool", None, "tool-type-path"),
t("verticalType", "Vertical Type Tool", None, "tool-type-vertical"),
t("verticalAreaType", "Vertical Area Type Tool", None, "tool-type-vertical"),
t("verticalTypeOnPath", "Vertical Type on a Path Tool", None, "tool-type-path"),
t("verticalAreaType", "Vertical Area Type Tool", None, "tool-type-vertical-area"),
t("verticalTypeOnPath", "Vertical Type on a Path Tool", None, "tool-type-vertical-path"),
t("touchType", "Touch Type Tool", Some("Shift+T"), "tool-touch-type"),
],
&[
+3
View File
@@ -174,9 +174,12 @@ pub static ICONS: &[(&str, &[u8])] = &[
("dc-transform-panel", include_bytes!("../../../assets/icons/dc-transform-panel.svg")),
("dc-transparency", include_bytes!("../../../assets/icons/dc-transparency.svg")),
("dc-twirl", include_bytes!("../../../assets/icons/dc-twirl.svg")),
("dc-type", include_bytes!("../../../assets/icons/dc-type.svg")),
("dc-type-area", include_bytes!("../../../assets/icons/dc-type-area.svg")),
("dc-type-path", include_bytes!("../../../assets/icons/dc-type-path.svg")),
("dc-type-vertical", include_bytes!("../../../assets/icons/dc-type-vertical.svg")),
("dc-type-vertical-area", include_bytes!("../../../assets/icons/dc-type-vertical-area.svg")),
("dc-type-vertical-path", include_bytes!("../../../assets/icons/dc-type-vertical-path.svg")),
("dc-width", include_bytes!("../../../assets/icons/dc-width.svg")),
("dc-width-profile", include_bytes!("../../../assets/icons/dc-width-profile.svg")),
("dc-wrinkle", include_bytes!("../../../assets/icons/dc-wrinkle.svg")),
+17 -1
View File
@@ -29,10 +29,12 @@ pub fn tool_icon(name: &str) -> &'static str {
"tool-pen-delete" => "pen-tool-delete",
"tool-anchor" => "dc-anchor",
"tool-curvature" => "spline",
"tool-type" => "type",
"tool-type" => "dc-type",
"tool-type-area" => "dc-type-area",
"tool-type-path" => "dc-type-path",
"tool-type-vertical" => "dc-type-vertical",
"tool-type-vertical-area" => "dc-type-vertical-area",
"tool-type-vertical-path" => "dc-type-vertical-path",
"tool-touch-type" => "dc-touch-type",
"tool-line" => "dc-line",
"tool-arc" => "dc-arc",
@@ -212,6 +214,20 @@ mod tests {
assert_ne!(add, delete, "plus and minus differ");
}
/// The seven type tools each have an icon of their own, drawn for VectorCraft (the vertical
/// Area and Path tools used to borrow the horizontal ones' icons).
#[test]
fn every_type_tool_has_its_own_icon_with_the_same_t() {
let tools = ["type", "areaType", "typeOnPath", "verticalType", "verticalAreaType", "verticalTypeOnPath", "touchType"];
let names: Vec<&str> = tools.iter().map(|id| tool_icon(vectorcraft_tools::catalog::tool_info(id).unwrap().icon)).collect();
let unique: std::collections::BTreeSet<_> = names.iter().collect();
assert_eq!(unique.len(), tools.len(), "{names:?}");
for name in &names {
assert!(name.starts_with("dc-"), "{name} is drawn for VectorCraft");
assert!(exists(name), "{name}");
}
}
#[test]
fn shared_catalog_preserves_fallback_and_tool_aliases() {
let ImageSource::Bytes { uri, bytes } = source("missing-icon") else { panic!("expected SVG bytes") };