mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
Merge main into feat/color-wheel-oklch-sliders-v2
This commit is contained in:
commit
aa94a6b6e7
54 files changed
+1007
-469
No files matched your search
@@ -24,6 +24,21 @@ jobs:
|
||||
# Same craft-fonts commit as release.yml.
|
||||
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
|
||||
timeout-minutes: 90
|
||||
# The gate's test binaries carry no debug info and no symbols (CARGO_PROFILE_TEST_DEBUG=0,
|
||||
# CARGO_PROFILE_TEST_STRIP=symbols), as photocraft's do: linking ~100 test binaries with line
|
||||
# tables ran the hosted runner out of resources, and it stopped mid-link with "received a
|
||||
# shutdown signal" (exit 143). Panics still name file and line; local builds keep Cargo.toml's
|
||||
# line tables.
|
||||
dev-strip: true
|
||||
# The workspace crates also build without line tables. A panic still names its file and line.
|
||||
dev-debug: "0"
|
||||
# Five legs instead of one: shards 1 to 4 each build and run the tests of their own crates,
|
||||
# and shard 5 runs the other `cargo xtask ci` steps (xtask/src/shards.rs). `gate (<os>)`
|
||||
# passes only when all five did. On pushes to main, a `cache warm` leg builds what every
|
||||
# shard builds and saves the dependency cache.
|
||||
test-shards: 5
|
||||
shard-command: cargo xtask ci shard
|
||||
warm-command: cargo xtask ci warm
|
||||
packages: >-
|
||||
pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxcb1-dev libxcursor-dev
|
||||
libxrandr-dev libxi-dev libfontconfig1-dev libfreetype-dev mesa-vulkan-drivers
|
||||
|
||||
Generated
+14
-2
@@ -1048,6 +1048,11 @@ dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-eps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec#cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec"
|
||||
|
||||
[[package]]
|
||||
name = "craft-eps"
|
||||
version = "0.1.0"
|
||||
@@ -1248,10 +1253,15 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec#cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec"
|
||||
dependencies = [
|
||||
"craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec)",
|
||||
"flate2",
|
||||
"kurbo 0.13.1",
|
||||
"miniz_oxide 0.8.9",
|
||||
"pdf-writer",
|
||||
"skrifa 0.47.0",
|
||||
"weezl 0.1.12",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6673,6 +6683,7 @@ dependencies = [
|
||||
"craft-image-codecs",
|
||||
"crc32fast",
|
||||
"proptest",
|
||||
"vectorcraft-affinity",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6866,7 +6877,7 @@ dependencies = [
|
||||
name = "vectorcraft-eps"
|
||||
version = "0.24.1"
|
||||
dependencies = [
|
||||
"craft-eps",
|
||||
"craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0)",
|
||||
"craft-image-codecs",
|
||||
"craft-pdf",
|
||||
"craft-ps",
|
||||
@@ -7034,6 +7045,7 @@ dependencies = [
|
||||
"vectorcraft-doc",
|
||||
"vectorcraft-effects",
|
||||
"vectorcraft-geom 0.24.1",
|
||||
"vectorcraft-pdf",
|
||||
"vectorcraft-testkit",
|
||||
"vectorcraft-text",
|
||||
]
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb
|
||||
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
|
||||
craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
|
||||
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
|
||||
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0", default-features = false, features = ["write"] }
|
||||
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec", default-features = false, features = ["read", "write"] }
|
||||
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
|
||||
craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
|
||||
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
|
||||
|
||||
@@ -21,3 +21,6 @@ proptest = { workspace = true }
|
||||
# The tests build containers and decode previews.
|
||||
crc32fast = { workspace = true }
|
||||
craft-image-codecs = { workspace = true }
|
||||
# tests/it's `import_limits`, `outline_limits` and `text` modules need `synth`, also when this crate
|
||||
# is tested without vectorcraft-engine (`cargo xtask ci shard`).
|
||||
vectorcraft-affinity = { path = ".", features = ["synth"] }
|
||||
@@ -531,7 +531,7 @@ impl Line {
|
||||
continue;
|
||||
}
|
||||
if t < 0.0 && !paints_as_one(&self) {
|
||||
return self;
|
||||
continue;
|
||||
}
|
||||
let mut tracked = self.clone();
|
||||
tracked.tracking = t;
|
||||
|
||||
@@ -1106,6 +1106,31 @@ fn tracking_near_a_whole_number_is_kept_as_measured_when_rounding_moves_glyphs()
|
||||
assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_tracking_translucent_glyphs_cannot_take_keeps_the_tracking_that_fits() {
|
||||
// The first three glyphs are tracked 50 and the last 150 further on. A tracking tighter than
|
||||
// zero is not tried for glyphs that cannot be one object, and the tracked prefix is kept.
|
||||
let mut s = session();
|
||||
let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "MMMM", "size": 30})).unwrap()["id"].as_u64().unwrap();
|
||||
s.execute("text.setRangeStyle", &json!({"id": id, "start": 0, "end": 2, "tracking": 50})).unwrap();
|
||||
s.execute("text.setRangeStyle", &json!({"id": id, "start": 2, "end": 3, "tracking": 150})).unwrap();
|
||||
s.execute("select.set", &json!({"ids": [id]})).unwrap();
|
||||
let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap();
|
||||
let kids = children_of(&s, g);
|
||||
s.edit("test", |d, _| {
|
||||
for k in &kids {
|
||||
d.node_mut(NodeId(*k)).unwrap().opacity = 0.5;
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
.unwrap();
|
||||
s.execute("select.set", &json!({"ids": [g]})).unwrap();
|
||||
let r = s.execute("type.retype", &json!({})).unwrap();
|
||||
let texts: Vec<&str> = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap()).collect();
|
||||
assert_eq!(texts.concat(), "MMMM", "{r}");
|
||||
assert!(texts.iter().any(|t| t.len() > 1), "the tracked glyphs stay one object: {r}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overlapping_translucent_glyphs_are_not_tracked_into_one_object() {
|
||||
let mut s = session();
|
||||
|
||||
@@ -170,6 +170,7 @@ pub const BUILTIN: &[BuiltinSymbolLibrary] = &[
|
||||
BuiltinSymbolLibrary { id: "inventory-icons", name: "Inventory Icons", make: inventory_icons },
|
||||
BuiltinSymbolLibrary { id: "skill-icons", name: "Skill Icons", make: skill_icons },
|
||||
BuiltinSymbolLibrary { id: "weather-icons", name: "Weather Icons", make: weather_icons },
|
||||
BuiltinSymbolLibrary { id: "nature-icons", name: "Nature Icons", make: nature_icons },
|
||||
BuiltinSymbolLibrary { id: "media-controls", name: "Media Controls", make: media_controls },
|
||||
];
|
||||
|
||||
@@ -503,6 +504,91 @@ fn weather_icons() -> SymbolLibrary {
|
||||
SymbolLibrary { name: "Weather Icons".into(), doc }
|
||||
}
|
||||
|
||||
/// Nature Icons: five original silhouettes for diagrams and reusable artwork.
|
||||
fn nature_icons() -> SymbolLibrary {
|
||||
let poly = |coords: &[(f64, f64)]| {
|
||||
let points: Vec<Point> = coords.iter().map(|&(x, y)| Point::new(x, y)).collect();
|
||||
SubPath::polyline(&points, true)
|
||||
};
|
||||
let leaf = PathData::new(vec![
|
||||
poly(&[(0.0, -20.0), (12.0, -13.0), (17.0, -2.0), (12.0, 10.0), (0.0, 19.0), (-12.0, 10.0), (-17.0, -2.0), (-12.0, -13.0)]),
|
||||
poly(&[(-1.0, -13.0), (1.0, -13.0), (1.0, 20.0), (-1.0, 20.0)]),
|
||||
]);
|
||||
let mut flower_parts = shapes::ellipse(Rect::new(-6.0, -6.0, 6.0, 6.0)).subpaths;
|
||||
for i in 0..6 {
|
||||
let angle = i as f64 * std::f64::consts::PI / 3.0;
|
||||
let (sin, cos) = angle.sin_cos();
|
||||
let x = 12.0 * cos;
|
||||
let y = 12.0 * sin;
|
||||
flower_parts.extend(shapes::ellipse(Rect::new(x - 5.5, y - 5.5, x + 5.5, y + 5.5)).subpaths);
|
||||
}
|
||||
let flower = PathData::new(flower_parts);
|
||||
let tree = PathData::new(vec![
|
||||
poly(&[(-3.0, 6.0), (3.0, 6.0), (3.0, 20.0), (-3.0, 20.0)]),
|
||||
poly(&[
|
||||
(0.0, -21.0),
|
||||
(12.0, -8.0),
|
||||
(8.0, -8.0),
|
||||
(17.0, 4.0),
|
||||
(11.0, 4.0),
|
||||
(18.0, 12.0),
|
||||
(-18.0, 12.0),
|
||||
(-11.0, 4.0),
|
||||
(-17.0, 4.0),
|
||||
(-8.0, -8.0),
|
||||
(-12.0, -8.0),
|
||||
]),
|
||||
]);
|
||||
let mountain = PathData::new(vec![
|
||||
poly(&[(-21.0, 17.0), (-6.0, -17.0), (2.0, 0.0), (8.0, -11.0), (21.0, 17.0)]),
|
||||
poly(&[(-12.0, -4.0), (-6.0, -17.0), (0.0, -4.0), (-5.0, -7.0), (-8.0, -3.0)]),
|
||||
]);
|
||||
let wave = PathData::new(
|
||||
(0..3)
|
||||
.map(|row| {
|
||||
let y = row as f64 * 9.0 - 10.0;
|
||||
poly(&[
|
||||
(-20.0, y),
|
||||
(-14.0, y - 4.0),
|
||||
(-8.0, y - 4.0),
|
||||
(-2.0, y),
|
||||
(4.0, y + 4.0),
|
||||
(10.0, y + 4.0),
|
||||
(16.0, y),
|
||||
(20.0, y),
|
||||
(20.0, y + 3.0),
|
||||
(16.0, y + 3.0),
|
||||
(10.0, y + 7.0),
|
||||
(4.0, y + 7.0),
|
||||
(-2.0, y + 3.0),
|
||||
(-8.0, y - 1.0),
|
||||
(-14.0, y - 1.0),
|
||||
(-20.0, y + 3.0),
|
||||
])
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
let icons = [
|
||||
("Leaf", leaf, "#4f9d59"),
|
||||
("Flower", flower, "#d977a7"),
|
||||
("Tree", tree, "#287c53"),
|
||||
("Mountain", mountain, "#768899"),
|
||||
("Wave", wave, "#388fb8"),
|
||||
];
|
||||
let mut doc = Document::new(100.0, 100.0);
|
||||
for (name, path, hex) in icons {
|
||||
let fill = Color::from_hex(hex).unwrap_or(Color::BLACK);
|
||||
let edge = fill.lerp(&Color::BLACK, 0.35);
|
||||
let id = doc.alloc_id();
|
||||
let art = Node::path(id, path, Appearance::basic(Paint::solid(fill), Paint::solid(edge), 1.25));
|
||||
let Ok((art, size, _)) = normalize(art) else { continue };
|
||||
doc.symbols.push(Symbol { dynamic: false, name: name.into(), art: Arc::new(art) });
|
||||
set_natural_size(&mut doc, name, Some(size));
|
||||
}
|
||||
doc.title = "Nature Icons".into();
|
||||
SymbolLibrary { name: "Nature Icons".into(), doc }
|
||||
}
|
||||
|
||||
/// Media Controls: play, pause, stop, skip next, shuffle and repeat for audio/video UI art (original, no 9-slice).
|
||||
fn media_controls() -> SymbolLibrary {
|
||||
// 1. Play: Right-pointing equilateral triangle.
|
||||
|
||||
@@ -84,7 +84,7 @@ fn the_builtin_library_is_original_art_generated_in_code() {
|
||||
let mut s = Session::new();
|
||||
let list = run(&mut s, "symbol.libraries", json!({}));
|
||||
let libs = list["libraries"].as_array().unwrap();
|
||||
assert_eq!(libs.len(), 7, "{libs:?}");
|
||||
assert_eq!(libs.len(), 8, "{libs:?}");
|
||||
assert_eq!((libs[0]["id"].as_str(), libs[0]["category"].as_str()), (Some("basic-shapes"), Some("builtIn")));
|
||||
assert_eq!(
|
||||
(libs[1]["id"].as_str(), libs[1]["name"].as_str(), libs[1]["category"].as_str()),
|
||||
@@ -108,6 +108,10 @@ fn the_builtin_library_is_original_art_generated_in_code() {
|
||||
);
|
||||
assert_eq!(
|
||||
(libs[6]["id"].as_str(), libs[6]["name"].as_str(), libs[6]["category"].as_str()),
|
||||
(Some("nature-icons"), Some("Nature Icons"), Some("builtIn"))
|
||||
);
|
||||
assert_eq!(
|
||||
(libs[7]["id"].as_str(), libs[7]["name"].as_str(), libs[7]["category"].as_str()),
|
||||
(Some("media-controls"), Some("Media Controls"), Some("builtIn"))
|
||||
);
|
||||
let lib = run(&mut s, "symbol.library", json!({"library": "basic shapes"}));
|
||||
@@ -249,6 +253,35 @@ fn weather_icons_library_lists_and_places() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nature_icons_library_places_and_survives_save() {
|
||||
let mut s = session();
|
||||
let listed = run(&mut s, "symbol.libraries", json!({}));
|
||||
let entry = listed["libraries"].as_array().unwrap().iter().find(|l| l["id"] == "nature-icons").unwrap();
|
||||
assert_eq!((entry["name"].as_str(), entry["count"].as_u64()), (Some("Nature Icons"), Some(5)));
|
||||
let library = run(&mut s, "symbol.library", json!({"library": "nature-icons"}));
|
||||
let names: Vec<&str> = library["symbols"].as_array().unwrap().iter().map(|x| x["name"].as_str().unwrap()).collect();
|
||||
assert_eq!(names, ["Leaf", "Flower", "Tree", "Mountain", "Wave"]);
|
||||
for (i, name) in names.iter().enumerate() {
|
||||
let symbol = &library["symbols"][i];
|
||||
let size = symbol["size"].as_array().unwrap();
|
||||
assert!(size.iter().all(|n| n.as_f64().is_some_and(|n| n.is_finite() && n > 0.0)), "{name}");
|
||||
let added = run(
|
||||
&mut s,
|
||||
"symbol.addFromLibrary",
|
||||
json!({"library": "nature-icons", "name": name, "place": true, "x": 100.0 + 80.0 * i as f64, "y": 100.0}),
|
||||
);
|
||||
assert_eq!(added["added"], json!([name]));
|
||||
let id = NodeId(added["placed"].as_u64().unwrap());
|
||||
assert!(matches!(doc(&s).node(id).map(|n| &n.kind), Some(NodeKind::SymbolInstance { symbol, .. }) if symbol == *name));
|
||||
assert_eq!(doc(&s).symbol_nine_slice(name), None);
|
||||
}
|
||||
let saved = run(&mut s, "symbol.saveLibrary", json!({"names": ["Leaf", "Flower", "Tree", "Mountain", "Wave"]}));
|
||||
let bytes = vectorcraft_format::base64_decode(saved["dataBase64"].as_str().unwrap()).unwrap();
|
||||
let reopened = vectorcraft_format::load(&bytes).unwrap();
|
||||
assert_eq!(reopened.symbols.iter().map(|s| s.name.as_str()).collect::<Vec<_>>(), names);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn media_controls_library_lists_and_places() {
|
||||
let mut s = session();
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
//! Format Specification, version 7.0, §5.3, §5.4 and §6), and the colors they write in place of
|
||||
//! the paint they can't hold.
|
||||
|
||||
use std::fmt::Write;
|
||||
|
||||
use vectorcraft_color::{Color, Gradient};
|
||||
use vectorcraft_doc::{LAYER_COLORS, LayerColor, LineCap, LineJoin, StrokeLayer};
|
||||
use vectorcraft_geom::{Affine, Anchor, AnchorKind, PathData, Point, Shape, SubPath};
|
||||
@@ -184,25 +182,15 @@ pub(crate) fn window_samples(samples: &[u8], w: u32, channels: usize, [x0, y0, x
|
||||
/// The stroke's width, cap, join, miter limit and dashes: `w J j M d`.
|
||||
pub(crate) fn line_style(s: &mut String, st: &StrokeLayer) {
|
||||
let cap = match st.cap {
|
||||
LineCap::Butt => 0,
|
||||
LineCap::Round => 1,
|
||||
LineCap::Square => 2,
|
||||
LineCap::Butt => ps::LineCap::Butt,
|
||||
LineCap::Round => ps::LineCap::Round,
|
||||
LineCap::Square => ps::LineCap::Square,
|
||||
};
|
||||
let join = match st.join {
|
||||
LineJoin::Miter => 0,
|
||||
LineJoin::Round => 1,
|
||||
LineJoin::Bevel => 2,
|
||||
LineJoin::Miter => ps::LineJoin::Miter,
|
||||
LineJoin::Round => ps::LineJoin::Round,
|
||||
LineJoin::Bevel => ps::LineJoin::Bevel,
|
||||
};
|
||||
ps::push_num(s, st.width);
|
||||
let _ = write!(s, " w {cap} J {join} j ");
|
||||
ps::push_num(s, if st.miter_limit.is_finite() { st.miter_limit.max(1.0) } else { 10.0 });
|
||||
s.push_str(" M [");
|
||||
let dash = st.dash.as_ref().filter(|d| d.is_dashed());
|
||||
if let Some(d) = dash {
|
||||
ps::push_nums(s, &d.pattern);
|
||||
s.pop();
|
||||
}
|
||||
s.push_str("] ");
|
||||
ps::push_num(s, dash.map_or(0.0, |d| d.offset));
|
||||
s.push_str(" d\n");
|
||||
let dash = st.dash.as_ref().filter(|d| d.is_dashed()).map(|d| (d.pattern.as_slice(), d.offset));
|
||||
ps::push_line_style(s, st.width, cap, join, st.miter_limit, dash);
|
||||
}
|
||||
+60
-298
@@ -1,253 +1,17 @@
|
||||
//! The scanner: PostScript source into objects (numbers, names, strings, procedures), with the
|
||||
//! position the program's own data (`currentfile`) is read from.
|
||||
//!
|
||||
//! Backed by `craft_ps::read::lex`.
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
use craft_ps::read::lex::{LexError, Number, Token};
|
||||
|
||||
use super::obj::{Obj, PsError, Res};
|
||||
use crate::ps;
|
||||
|
||||
/// Deepest procedure nesting the scanner reads.
|
||||
const MAX_NESTING: usize = 256;
|
||||
pub(crate) use craft_ps::read::lex::{IMMEDIATE, hex_decode};
|
||||
|
||||
pub(crate) struct Lexer<'a> {
|
||||
src: &'a [u8],
|
||||
pos: usize,
|
||||
/// The whitespace character that ended the last token is still unread (data the program
|
||||
/// reads from itself starts after it).
|
||||
fresh: bool,
|
||||
/// The last object read has immediately evaluated names (`//name`) in it, read as executable
|
||||
/// names starting with [`IMMEDIATE`] for the interpreter to replace by their values.
|
||||
pub immediate: bool,
|
||||
}
|
||||
|
||||
/// How an immediately evaluated name (`//name`) is read, until the interpreter replaces it.
|
||||
pub(crate) const IMMEDIATE: &str = "//";
|
||||
|
||||
fn is_space(b: u8) -> bool {
|
||||
matches!(b, b' ' | b'\t' | b'\r' | b'\n' | b'\x0c' | b'\0')
|
||||
}
|
||||
|
||||
fn is_delim(b: u8) -> bool {
|
||||
matches!(b, b'(' | b')' | b'<' | b'>' | b'[' | b']' | b'{' | b'}' | b'/' | b'%')
|
||||
}
|
||||
|
||||
fn syntax<T>(what: &str) -> Res<T> {
|
||||
Err(PsError::Ps("syntaxerror", what.to_string()))
|
||||
}
|
||||
|
||||
impl<'a> Lexer<'a> {
|
||||
pub fn new(src: &'a [u8]) -> Self {
|
||||
Self { src, pos: 0, fresh: false, immediate: false }
|
||||
}
|
||||
|
||||
/// What is left to read.
|
||||
pub fn rest(&self) -> &'a [u8] {
|
||||
self.src.get(self.pos..).unwrap_or_default()
|
||||
}
|
||||
|
||||
/// What is left to read as data: after the whitespace that ended the last token (a CR LF
|
||||
/// pair counts as one).
|
||||
pub fn data(&mut self) -> &'a [u8] {
|
||||
if std::mem::take(&mut self.fresh) {
|
||||
match self.peek() {
|
||||
Some(b'\r') => {
|
||||
self.pos += 1;
|
||||
if self.peek() == Some(b'\n') {
|
||||
self.pos += 1;
|
||||
}
|
||||
}
|
||||
Some(b) if is_space(b) => self.pos += 1,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
self.rest()
|
||||
}
|
||||
|
||||
/// Skip `n` bytes (the data a filter or `readstring` took).
|
||||
pub fn advance(&mut self, n: usize) {
|
||||
self.fresh = false;
|
||||
self.pos = self.pos.saturating_add(n).min(self.src.len());
|
||||
}
|
||||
|
||||
fn peek(&self) -> Option<u8> {
|
||||
self.src.get(self.pos).copied()
|
||||
}
|
||||
|
||||
fn skip_space(&mut self) {
|
||||
while let Some(b) = self.peek() {
|
||||
if is_space(b) {
|
||||
self.pos += 1;
|
||||
} else if b == b'%' {
|
||||
while let Some(c) = self.peek() {
|
||||
if c == b'\n' || c == b'\r' {
|
||||
break;
|
||||
}
|
||||
self.pos += 1;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The next object at the top level (`None` at the end of the file).
|
||||
pub fn next(&mut self) -> Res<Option<Obj>> {
|
||||
self.immediate = false;
|
||||
let t = self.token(0);
|
||||
self.fresh = true;
|
||||
t
|
||||
}
|
||||
|
||||
fn token(&mut self, depth: usize) -> Res<Option<Obj>> {
|
||||
self.skip_space();
|
||||
let Some(b) = self.peek() else { return Ok(None) };
|
||||
self.pos += 1;
|
||||
Ok(Some(match b {
|
||||
b'(' => Obj::string(self.string()?),
|
||||
b'<' => match self.peek() {
|
||||
Some(b'<') => {
|
||||
self.pos += 1;
|
||||
Obj::Exec(Rc::from("<<"))
|
||||
}
|
||||
Some(b'~') => {
|
||||
self.pos += 1;
|
||||
Obj::string(self.ascii85()?)
|
||||
}
|
||||
_ => Obj::string(self.hex()?),
|
||||
},
|
||||
b'>' => {
|
||||
if self.peek() != Some(b'>') {
|
||||
return syntax(">");
|
||||
}
|
||||
self.pos += 1;
|
||||
Obj::Exec(Rc::from(">>"))
|
||||
}
|
||||
b'[' => Obj::Exec(Rc::from("[")),
|
||||
b']' => Obj::Exec(Rc::from("]")),
|
||||
b'{' => {
|
||||
if depth >= MAX_NESTING {
|
||||
return Err(PsError::Limit("procedures nested too deeply"));
|
||||
}
|
||||
let mut items = vec![];
|
||||
loop {
|
||||
self.skip_space();
|
||||
match self.peek() {
|
||||
None => return syntax("{"),
|
||||
Some(b'}') => {
|
||||
self.pos += 1;
|
||||
break;
|
||||
}
|
||||
_ => match self.token(depth + 1)? {
|
||||
Some(o) => items.push(o),
|
||||
None => return syntax("{"),
|
||||
},
|
||||
}
|
||||
}
|
||||
Obj::proc(items)
|
||||
}
|
||||
b'}' | b')' => return syntax(&char::from(b).to_string()),
|
||||
b'/' => {
|
||||
// `//name` stands for the name's value when it is read.
|
||||
let immediate = self.peek() == Some(b'/');
|
||||
if immediate {
|
||||
self.pos += 1;
|
||||
self.immediate = true;
|
||||
}
|
||||
let name = self.word();
|
||||
if immediate { Obj::Exec(Rc::from(format!("{IMMEDIATE}{name}").as_str())) } else { Obj::Name(Rc::from(name.as_str())) }
|
||||
}
|
||||
_ => {
|
||||
self.pos -= 1;
|
||||
let w = self.word();
|
||||
number(&w).unwrap_or_else(|| Obj::Exec(Rc::from(w.as_str())))
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
/// A regular token's characters.
|
||||
fn word(&mut self) -> String {
|
||||
let start = self.pos;
|
||||
while let Some(b) = self.peek() {
|
||||
if is_space(b) || is_delim(b) {
|
||||
break;
|
||||
}
|
||||
self.pos += 1;
|
||||
}
|
||||
String::from_utf8_lossy(self.src.get(start..self.pos).unwrap_or_default()).into_owned()
|
||||
}
|
||||
|
||||
/// A literal string after its `(`.
|
||||
fn string(&mut self) -> Res<Vec<u8>> {
|
||||
let mut out = vec![];
|
||||
let mut depth = 0usize;
|
||||
loop {
|
||||
let Some(b) = self.peek() else { return syntax("(") };
|
||||
self.pos += 1;
|
||||
match b {
|
||||
b'(' => {
|
||||
depth += 1;
|
||||
out.push(b);
|
||||
}
|
||||
b')' if depth == 0 => return Ok(out),
|
||||
b')' => {
|
||||
depth -= 1;
|
||||
out.push(b);
|
||||
}
|
||||
b'\\' => {
|
||||
let Some(e) = self.peek() else { return syntax("(") };
|
||||
self.pos += 1;
|
||||
match e {
|
||||
b'n' => out.push(b'\n'),
|
||||
b'r' => out.push(b'\r'),
|
||||
b't' => out.push(b'\t'),
|
||||
b'b' => out.push(8),
|
||||
b'f' => out.push(12),
|
||||
b'\r' => {
|
||||
if self.peek() == Some(b'\n') {
|
||||
self.pos += 1;
|
||||
}
|
||||
}
|
||||
b'\n' => {}
|
||||
b'0'..=b'7' => {
|
||||
let mut v = u32::from(e - b'0');
|
||||
for _ in 0..2 {
|
||||
match self.peek() {
|
||||
Some(d @ b'0'..=b'7') => {
|
||||
v = v * 8 + u32::from(d - b'0');
|
||||
self.pos += 1;
|
||||
}
|
||||
_ => break,
|
||||
}
|
||||
}
|
||||
out.push((v & 0xff) as u8);
|
||||
}
|
||||
other => out.push(other),
|
||||
}
|
||||
}
|
||||
_ => out.push(b),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A hexadecimal string after its `<`.
|
||||
fn hex(&mut self) -> Res<Vec<u8>> {
|
||||
let end = self.rest().iter().position(|b| *b == b'>').ok_or(PsError::Ps("syntaxerror", "<".into()))?;
|
||||
let body = self.rest().get(..end).unwrap_or_default();
|
||||
let out = hex_decode(body).ok_or(PsError::Ps("syntaxerror", "<".into()))?;
|
||||
self.advance(end + 1);
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// An ASCII85 string after its `<~`.
|
||||
fn ascii85(&mut self) -> Res<Vec<u8>> {
|
||||
let end = find(self.rest(), b"~>").ok_or(PsError::Ps("syntaxerror", "<~".into()))?;
|
||||
let text = String::from_utf8_lossy(self.rest().get(..end + 2).unwrap_or_default()).into_owned();
|
||||
self.advance(end + 2);
|
||||
ps::ascii85_decode(&text).ok_or(PsError::Ps("syntaxerror", "<~".into()))
|
||||
}
|
||||
}
|
||||
|
||||
/// Where `needle` first starts in `hay`.
|
||||
/// Where `needle` first starts in `hay` (uses `memmem` so large inputs stay linear-time).
|
||||
pub(crate) fn find(hay: &[u8], needle: &[u8]) -> Option<usize> {
|
||||
if needle.is_empty() {
|
||||
return Some(0);
|
||||
@@ -255,39 +19,66 @@ pub(crate) fn find(hay: &[u8], needle: &[u8]) -> Option<usize> {
|
||||
memchr::memmem::find(hay, needle)
|
||||
}
|
||||
|
||||
/// Hexadecimal digits (whitespace ignored, an odd last digit padded with 0); `None` on others.
|
||||
pub(crate) fn hex_decode(body: &[u8]) -> Option<Vec<u8>> {
|
||||
// Callers pass an already-delimited body. Do not let the filter decoder's EOD
|
||||
// handling silently accept a stray terminator or discard bytes after it.
|
||||
if body.contains(&b'>') {
|
||||
return None;
|
||||
pub(crate) struct Lexer<'a> {
|
||||
inner: craft_ps::read::lex::Lexer<'a>,
|
||||
/// The last object read has immediately evaluated names (`//name`) in it, read as executable
|
||||
/// names starting with [`IMMEDIATE`] for the interpreter to replace by their values.
|
||||
pub immediate: bool,
|
||||
}
|
||||
|
||||
impl<'a> Lexer<'a> {
|
||||
pub fn new(src: &'a [u8]) -> Self {
|
||||
Self { inner: craft_ps::read::lex::Lexer::new(src), immediate: false }
|
||||
}
|
||||
|
||||
/// What is left to read.
|
||||
pub fn rest(&self) -> &'a [u8] {
|
||||
self.inner.rest()
|
||||
}
|
||||
|
||||
/// What is left to read as data: after the whitespace that ended the last token (a CR LF
|
||||
/// pair counts as one).
|
||||
pub fn data(&mut self) -> &'a [u8] {
|
||||
self.inner.data()
|
||||
}
|
||||
|
||||
/// Skip `n` bytes (the data a filter or `readstring` took).
|
||||
pub fn advance(&mut self, n: usize) {
|
||||
self.inner.advance(n);
|
||||
}
|
||||
|
||||
/// The next object at the top level (`None` at the end of the file).
|
||||
pub fn next(&mut self) -> Res<Option<Obj>> {
|
||||
let res = self.inner.next().map(|opt| opt.map(into_obj)).map_err(into_err);
|
||||
self.immediate = self.inner.immediate;
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
fn into_err(err: LexError) -> PsError {
|
||||
match err {
|
||||
LexError::Syntax(what) => PsError::Ps("syntaxerror", what),
|
||||
LexError::Limit(msg) => PsError::Limit(msg),
|
||||
}
|
||||
}
|
||||
|
||||
fn into_obj(tok: Token) -> Obj {
|
||||
match tok {
|
||||
Token::Int(i) => Obj::Int(i),
|
||||
Token::Real(r) => Obj::Real(r),
|
||||
Token::Name(n) => Obj::Name(Rc::from(n.as_str())),
|
||||
Token::Exec(n) => Obj::Exec(Rc::from(n.as_str())),
|
||||
Token::Str(s) => Obj::string(s),
|
||||
Token::Proc(items) => Obj::proc(items.into_iter().map(into_obj).collect()),
|
||||
}
|
||||
craft_stream_codecs::asciihex::decode(body, body.len().div_ceil(2)).ok()
|
||||
}
|
||||
|
||||
/// A number token (`12`, `-3.5`, `.5`, `1e-3`, `16#ff`), or `None`.
|
||||
pub(crate) fn number(w: &str) -> Option<Obj> {
|
||||
let first = w.bytes().next()?;
|
||||
if !(first.is_ascii_digit() || matches!(first, b'+' | b'-' | b'.')) {
|
||||
return None;
|
||||
match craft_ps::read::lex::number(w)? {
|
||||
Number::Int(i) => Some(Obj::Int(i)),
|
||||
Number::Real(r) => Some(Obj::Real(r)),
|
||||
}
|
||||
if let Ok(i) = w.parse::<i64>() {
|
||||
return Some(Obj::Int(i));
|
||||
}
|
||||
if let Some((base, digits)) = w.split_once('#') {
|
||||
let base: u32 = base.parse().ok().filter(|b| (2..=36).contains(b))?;
|
||||
// `from_str_radix` accepts a leading sign; a PostScript radix number has digits only.
|
||||
if digits.starts_with(['+', '-']) {
|
||||
return None;
|
||||
}
|
||||
return i64::from_str_radix(digits, base).ok().map(Obj::Int);
|
||||
}
|
||||
// Rust reads `inf` and `nan`; PostScript doesn't.
|
||||
if w.bytes().any(|b| b.is_ascii_alphabetic() && !matches!(b, b'e' | b'E')) {
|
||||
return None;
|
||||
}
|
||||
let v: f64 = w.parse().ok()?;
|
||||
v.is_finite().then_some(Obj::Real(v))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -300,33 +91,4 @@ mod tests {
|
||||
assert!(number("16#-ff").is_none());
|
||||
assert!(matches!(number("16#ff"), Some(Obj::Int(255))));
|
||||
}
|
||||
#[test]
|
||||
fn shared_hex_decode_keeps_body_boundaries_and_odd_nibbles() {
|
||||
assert_eq!(hex_decode(b" 4\t1\n4\r2\x0c4\0"), Some(vec![0x41, 0x42, 0x40]));
|
||||
assert_eq!(hex_decode(b""), Some(vec![]));
|
||||
for invalid in [b"41>42".as_slice(), b">", b"4g", b"4\x0b1", b"\xff"] {
|
||||
assert_eq!(hex_decode(invalid), None);
|
||||
}
|
||||
// Every byte pairs with each possible nibble, including all whitespace
|
||||
// and invalid-byte combinations; this is the former body-only contract.
|
||||
for first in 0..=255u8 {
|
||||
for second in 0..=255u8 {
|
||||
let input = [first, second];
|
||||
let mut digits = Vec::new();
|
||||
let mut valid = true;
|
||||
for b in input {
|
||||
if is_space(b) {
|
||||
continue;
|
||||
}
|
||||
match char::from(b).to_digit(16) {
|
||||
Some(d) => digits.push(d as u8),
|
||||
None => valid = false,
|
||||
}
|
||||
}
|
||||
let expected =
|
||||
if !valid { None } else { Some(digits.chunks(2).map(|pair| (pair[0] << 4) | pair.get(1).copied().unwrap_or(0)).collect()) };
|
||||
assert_eq!(hex_decode(&input), expected, "{input:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,6 @@
|
||||
use vectorcraft_doc::{Document, ImageBlob, ImageObject, Node, NodeKind};
|
||||
use vectorcraft_geom::{Affine, Rect};
|
||||
|
||||
/// Largest EPSI bitmap side read (pixels).
|
||||
const MAX_EPSI: usize = 8192;
|
||||
|
||||
/// A preview's document and how the user is told about it.
|
||||
pub(super) struct Preview {
|
||||
pub document: Document,
|
||||
@@ -89,41 +86,39 @@ fn metafile_doc(wmf: &[u8], frame: Rect) -> Option<Document> {
|
||||
|
||||
/// The EPSI preview in `ps`'s comments (`%%BeginPreview: width height depth lines`, hex rows,
|
||||
/// 0 white and the largest value black).
|
||||
/// The shared decoder intentionally tolerates blank preview lines and CR-only line endings;
|
||||
/// unlike the former local parser, neither changes the decoded samples.
|
||||
fn epsi(ps: &[u8]) -> Option<image::RgbaImage> {
|
||||
let text = String::from_utf8_lossy(ps);
|
||||
let mut lines = text.lines();
|
||||
let head = lines.find_map(|l| l.strip_prefix("%%BeginPreview:"))?;
|
||||
let n: Vec<usize> = head.split_whitespace().map_while(|w| w.parse().ok()).collect();
|
||||
let [w, h, depth, ..] = n[..] else { return None };
|
||||
if !(1..=MAX_EPSI).contains(&w) || !(1..=MAX_EPSI).contains(&h) || ![1, 2, 4, 8].contains(&depth) {
|
||||
return None;
|
||||
let bitmap = craft_eps::epsi(ps)?;
|
||||
let rgba = bitmap.gray.into_iter().flat_map(|g| [g, g, g, 255]).collect();
|
||||
image::RgbaImage::from_raw(bitmap.width, bitmap.height, rgba)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::epsi;
|
||||
|
||||
#[test]
|
||||
fn shared_epsi_depths_keep_row_padding_and_opaque_grayscale() {
|
||||
for (depth, row, gray) in [(1, "40", [255, 0, 255]), (2, "18", [255, 170, 85]), (4, "05a0", [255, 170, 85]), (8, "0055aa", [255, 170, 85])] {
|
||||
let source = format!("%%BeginPreview: 3 2 {depth} 2\n% {row}\n% {row}\n%%EndPreview\n");
|
||||
let image = epsi(source.as_bytes()).expect("ordinary EPSI preview");
|
||||
assert_eq!(image.dimensions(), (3, 2));
|
||||
let expected: Vec<u8> = gray.into_iter().cycle().take(6).flat_map(|g| [g, g, g, 255]).collect();
|
||||
assert_eq!(image.as_raw(), &expected, "depth {depth}");
|
||||
}
|
||||
}
|
||||
let row = (w * depth).div_ceil(8);
|
||||
let mut hex = Vec::with_capacity((row * h * 2).min(ps.len()));
|
||||
for l in lines {
|
||||
if l.starts_with("%%EndPreview") || hex.len() >= row * h * 2 {
|
||||
break;
|
||||
|
||||
#[test]
|
||||
fn shared_epsi_intentionally_accepts_blank_and_cr_only_lines() {
|
||||
let ordinary = "%%BeginPreview: 3 2 2 2\n% 18\n% e4\n%%EndPreview\n";
|
||||
let expected = epsi(ordinary.as_bytes()).expect("ordinary preview");
|
||||
for source in [ordinary.replace('\n', "\r"), ordinary.replace("% e4", "\n% e4")] {
|
||||
let image = epsi(source.as_bytes()).expect("documented shared decoder tolerance");
|
||||
assert_eq!(image, expected);
|
||||
}
|
||||
hex.extend(l.strip_prefix('%')?.bytes().filter(u8::is_ascii_hexdigit));
|
||||
}
|
||||
hex.truncate(row * h * 2);
|
||||
// A trailing half byte would decode padded with zero: the preview is cut short, so none.
|
||||
if hex.len() % 2 != 0 {
|
||||
return None;
|
||||
}
|
||||
let bytes = super::lex::hex_decode(&hex)?;
|
||||
// A preview with its samples missing is none, not a blank image of the size it claims.
|
||||
if bytes.len() < row * h {
|
||||
return None;
|
||||
}
|
||||
let max = (1u32 << depth) - 1;
|
||||
let mut img = image::RgbaImage::new(w as u32, h as u32);
|
||||
for (x, y, px) in img.enumerate_pixels_mut() {
|
||||
let bit = y as usize * row * 8 + x as usize * depth;
|
||||
let byte = u32::from(bytes.get(bit / 8).copied().unwrap_or(0));
|
||||
let v = (byte >> (8 - depth - bit % 8)) & max;
|
||||
let grey = (255 - v * 255 / max) as u8;
|
||||
*px = image::Rgba([grey, grey, grey, 255]);
|
||||
let gray = [255, 170, 85, 0, 85, 170];
|
||||
let rgba: Vec<u8> = gray.into_iter().flat_map(|g| [g, g, g, 255]).collect();
|
||||
assert_eq!(expected.as_raw(), &rgba);
|
||||
}
|
||||
Some(img)
|
||||
}
|
||||
+30
-1
@@ -3,7 +3,10 @@
|
||||
|
||||
use vectorcraft_geom::{BezPath, FillRule};
|
||||
|
||||
pub(crate) use craft_ps::write::{bytes, deflate, inflate, matrix, num, push_num, push_num_places, push_nums, string, written};
|
||||
pub(crate) use craft_ps::write::{
|
||||
LineCap, LineJoin, ShadingKind, bytes, deflate, inflate, matrix, num, push_image_array_ref, push_inline_image, push_line_style, push_num,
|
||||
push_num_places, push_nums, push_reusable_image_ref, push_reusable_image_resource, push_shading, string, written,
|
||||
};
|
||||
|
||||
/// The procedures the page uses, in `VCdict`.
|
||||
pub(crate) const PROLOG: &str = "/VCdict 64 dict def
|
||||
@@ -121,4 +124,30 @@ mod tests {
|
||||
assert_eq!(places(2.5, 7), "2.5");
|
||||
assert_eq!(places(f64::NAN, 7), "0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shared_scene_syntax_preserves_vc_names_and_shading() {
|
||||
let mut line = String::new();
|
||||
super::push_line_style(&mut line, 3.0, super::LineCap::Square, super::LineJoin::Round, 4.0, Some((&[5.0, 1.5], 0.5)));
|
||||
assert_eq!(line, "3 w 2 J 1 j 4 M [5 1.5] 0.5 d\n");
|
||||
|
||||
let mut shading = String::new();
|
||||
super::push_shading(
|
||||
&mut shading,
|
||||
super::ShadingKind::Axial,
|
||||
"/DeviceCMYK",
|
||||
&[0.0, 0.0, 100.0, 0.0],
|
||||
4,
|
||||
&[(0.0, vec![0.0, 1.0, 1.0, 0.0]), (1.0, vec![1.0, 0.0, 1.0, 0.0])],
|
||||
);
|
||||
assert!(shading.contains("/ShadingType 2 /ColorSpace /DeviceCMYK"));
|
||||
assert!(shading.ends_with(">> shfill\n"));
|
||||
|
||||
let mut inline = String::new();
|
||||
super::push_inline_image(&mut inline, "VCsrc", "", "<< /ImageType 1", "/FlateDecode", "image", "~>\n");
|
||||
assert_eq!(
|
||||
inline,
|
||||
"{ /VCsrc currentfile /ASCII85Decode filter def\n<< /ImageType 1\n/DataSource VCsrc /FlateDecode filter >> image\nVCsrc flushfile } exec\n~>\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
+12
-63
@@ -50,8 +50,6 @@ const SPREAD_CAPPED: &str =
|
||||
"gradients that repeat or reflect are written with at most 256 runs of their stops (at most 16384 stops); they pad past those";
|
||||
/// Wedges a conic gradient is written as: one a degree.
|
||||
const CONIC_WEDGE_COUNT: usize = 360;
|
||||
/// Decimals of a smooth shading's stitching function bounds (stop offsets, 0 to 1).
|
||||
const BOUNDS_PLACES: u32 = 7;
|
||||
/// The most colorants a DeviceN color space may have (PostScript's limit).
|
||||
const MAX_DEVICE_N: usize = 32;
|
||||
const MISSING_PATTERN: &str = "missing patterns are written as mid-grey";
|
||||
@@ -63,8 +61,6 @@ const MAX_BODY: usize = 256 << 20;
|
||||
/// Most compressed bytes in one string of an image's samples at Level 2 (under PostScript's
|
||||
/// 65,535-byte string limit).
|
||||
const IMAGE_CHUNK: usize = 48 << 10;
|
||||
/// The start of the procedure that reads an image's data from the lines after it.
|
||||
const INLINE_SOURCE: &str = "{ /VCsrc currentfile /ASCII85Decode filter def\n";
|
||||
|
||||
/// An image as written: what sets up its color, its image dictionary and its compressed samples.
|
||||
/// Placed once, it is written where it is drawn, its data following the operators that read it.
|
||||
@@ -108,33 +104,20 @@ impl ImageCode {
|
||||
|
||||
/// The operators and data that draw the image where it is placed.
|
||||
fn push_inline(&self, s: &mut String) {
|
||||
s.push_str(&self.prelude);
|
||||
s.push_str(INLINE_SOURCE);
|
||||
s.push_str(&self.dict);
|
||||
s.push_str(&self.inline_read());
|
||||
s.push_str(&self.ascii);
|
||||
}
|
||||
|
||||
/// The end of the procedure [`ImageCode::push_inline`] writes. The procedure is read whole
|
||||
/// before it runs: the image data follows it, and flushing the ASCII85 filter afterwards reads
|
||||
/// past its end marker.
|
||||
fn inline_read(&self) -> String {
|
||||
format!("\n/DataSource VCsrc {} filter >> {}\nVCsrc flushfile }} exec\n", self.filter, self.op)
|
||||
ps::push_inline_image(s, "VCsrc", &self.prelude, &self.dict, self.filter, self.op, &self.ascii);
|
||||
}
|
||||
|
||||
/// The operators that draw the image `VCim<i>` holds, for an image placed more than once.
|
||||
fn reference(&self, i: usize, level: Level) -> String {
|
||||
let mut s = String::new();
|
||||
let name = format!("VCim{i}");
|
||||
match level {
|
||||
// The stream is read again from its start.
|
||||
Level::Three => {
|
||||
format!("{}VCim{i} resetfile\n{}\n/DataSource VCim{i} {} filter >> {}\n", self.prelude, self.dict, self.filter, self.op)
|
||||
}
|
||||
Level::Three => ps::push_reusable_image_ref(&mut s, &name, &self.prelude, &self.dict, self.filter, self.op),
|
||||
// A procedure gives the strings in turn, then an empty string: the end of the data.
|
||||
Level::Two => format!(
|
||||
"{}/VCi 0 def\n{}\n/DataSource {{VCi VCim{i} length lt {{VCim{i} VCi get /VCi VCi 1 add def}} {{()}} ifelse}} {} filter >> {}\n",
|
||||
self.prelude, self.dict, self.filter, self.op
|
||||
),
|
||||
Level::Two => ps::push_image_array_ref(&mut s, "VCi", &name, &self.prelude, &self.dict, self.filter, self.op),
|
||||
}
|
||||
s
|
||||
}
|
||||
|
||||
/// The setup's definition of `VCim<i>`: the image's compressed samples, once.
|
||||
@@ -145,11 +128,7 @@ impl ImageCode {
|
||||
// The stream reads all of its data when it is made, so the data follows the
|
||||
// procedure that makes it.
|
||||
let intent = if self.op == "imagemask" { 1 } else { 0 };
|
||||
let _ = writeln!(
|
||||
s,
|
||||
"{{ /VCsrc currentfile /ASCII85Decode filter def\n/VCim{i} VCsrc << /Intent {intent} /AsyncRead false /CloseSource false >> /ReusableStreamDecode filter def\nVCsrc flushfile }} exec"
|
||||
);
|
||||
s.push_str(&self.ascii);
|
||||
ps::push_reusable_image_resource(&mut s, "VCsrc", &format!("VCim{i}"), intent, &self.ascii);
|
||||
}
|
||||
Level::Two => {
|
||||
let _ = writeln!(s, "/VCim{i} [");
|
||||
@@ -1489,44 +1468,12 @@ impl<'a> Scene<'a> {
|
||||
|
||||
/// A Level 3 smooth shading of `kind` (2 axial, 3 radial) at `coords`, extended both ways.
|
||||
fn shading(&mut self, kind: u8, space: &GradientSpace, coords: &[f64], stops: &[(f64, Vec<f32>)]) {
|
||||
let n = space.n();
|
||||
let comps = |c: &[f32]| -> String {
|
||||
let mut s = String::from("[");
|
||||
push_nums(&mut s, &c.iter().take(n).map(|v| f64::from(*v)).collect::<Vec<_>>());
|
||||
s.pop();
|
||||
s.push(']');
|
||||
s
|
||||
};
|
||||
let segments: Vec<_> = stops.windows(2).filter(|w| w[1].0 > w[0].0).collect();
|
||||
let interp = |w: &&[(f64, Vec<f32>)]| format!("<< /FunctionType 2 /Domain [0 1] /C0 {} /C1 {} /N 1 >>", comps(&w[0].1), comps(&w[1].1));
|
||||
let function = match segments.as_slice() {
|
||||
[one] => interp(one),
|
||||
many => {
|
||||
let mut f = String::from("<< /FunctionType 3 /Domain [0 1] /Functions [\n");
|
||||
for w in many {
|
||||
f.push_str(&interp(w));
|
||||
f.push('\n');
|
||||
}
|
||||
f.push_str("] /Bounds [");
|
||||
// Seven decimals: a gradient's stops repeated hundreds or thousands of times
|
||||
// (`Gradient::padded_over`) keep their places in each run.
|
||||
for w in many.iter().skip(1) {
|
||||
ps::push_num_places(&mut f, w[0].0, BOUNDS_PLACES);
|
||||
f.push(' ');
|
||||
}
|
||||
f.push_str("] /Encode [");
|
||||
f.push_str(&"0 1 ".repeat(many.len()));
|
||||
f.push_str("] >>");
|
||||
f
|
||||
}
|
||||
};
|
||||
let kind = if kind == 3 { ps::ShadingKind::Radial } else { ps::ShadingKind::Axial };
|
||||
let name = match space {
|
||||
GradientSpace::Process(s) => s.name(),
|
||||
GradientSpace::Inks(name, _) => name,
|
||||
};
|
||||
let _ = write!(self.body, "<< /ShadingType {kind} /ColorSpace {name} /Coords [");
|
||||
push_nums(&mut self.body, coords);
|
||||
let _ = writeln!(self.body, "] /Extend [true true]\n/Function {function} >> shfill");
|
||||
ps::push_shading(&mut self.body, kind, name, coords, space.n(), stops);
|
||||
}
|
||||
|
||||
/// The bands of each stretch between stops: how many, for colours `a` to `b` over `length`
|
||||
@@ -2090,7 +2037,9 @@ impl<'a> Scene<'a> {
|
||||
/// `data`, not yet placed.
|
||||
fn image_code(prelude: String, dict: String, filter: &'static str, op: &'static str, data: Vec<u8>) -> ImageCode {
|
||||
let mut code = ImageCode { prelude, dict, filter, op, ascii: ps::ascii85(&data), data, uses: 0, inline_len: 0, ref_len: 0 };
|
||||
code.inline_len = code.prelude.len() + INLINE_SOURCE.len() + code.dict.len() + code.inline_read().len() + code.ascii.len();
|
||||
let mut inline = String::new();
|
||||
ps::push_inline_image(&mut inline, "VCsrc", &code.prelude, &code.dict, code.filter, code.op, "");
|
||||
code.inline_len = inline.len() + code.ascii.len();
|
||||
code
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,9 @@ serde_json = { workspace = true }
|
||||
krilla = { workspace = true, features = ["simple-text"] }
|
||||
# How many times the symbol list is read to find symbols by name.
|
||||
vectorcraft-doc = { workspace = true, features = ["symbol-read-count"] }
|
||||
# The counters vectorcraft-engine's tests turn on, also when this crate is tested without
|
||||
# vectorcraft-engine (`cargo xtask ci shard`).
|
||||
vectorcraft-pdf = { path = ".", features = ["read-count"] }
|
||||
|
||||
# An independent raster oracle for gradient placement in PDF forms. These are test-only macOS
|
||||
# bindings; the exporter stays portable Rust and does not depend on an OS PDF renderer.
|
||||
|
||||
@@ -7933,6 +7933,10 @@ breakText Glyphs Глифи
|
||||
@msg A joint does not close by {gap} pt. Една връзка не се затваря с {gap} pt.
|
||||
@msg Two panels pass through each other. Два панела минават един през друг.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
|
||||
Nature Icons Природни икони
|
||||
Flower Цвете
|
||||
Tree Дърво
|
||||
Mountain Планина
|
||||
Ornamental Орнаментални
|
||||
Scrollwork Завитък
|
||||
Filigree Arrow Филигранна стрела
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7988,6 +7988,10 @@ shape Open Otvoren
|
||||
@msg A joint does not close by {gap} pt. Spoj se ne zatvara za {gap} pt.
|
||||
@msg Two panels pass through each other. Dva panela prolaze jedan kroz drugi.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine"
|
||||
Nature Icons Ikone prirode
|
||||
Flower Cvijet
|
||||
Tree Drvo
|
||||
Mountain Planina
|
||||
Ornamental Ornamentalno
|
||||
Scrollwork Ukrasni zavoj
|
||||
Filigree Arrow Filigranska strelica
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -8978,6 +8978,10 @@ breakText Glyphs Glifs
|
||||
@msg A joint does not close by {gap} pt. Una unió no es tanca per {gap} pt.
|
||||
@msg Two panels pass through each other. Dos panells es travessen l’un a l’altre.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
|
||||
Nature Icons Icones de natura
|
||||
Flower Flor
|
||||
Tree Arbre
|
||||
Mountain Muntanya
|
||||
Ornamental Ornamental
|
||||
Scrollwork Voluta
|
||||
Filigree Arrow Fletxa de filigrana
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10802,6 +10802,10 @@ breakText Glyphs Glyfy
|
||||
@msg A panel is not joined to the rest by a crease. Panel není se zbytkem spojen žádnou linií bigu.
|
||||
@msg A fold line is on a non-printing layer. Linie skladu je na netisknutelné vrstvě.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panely: {panels}, panty: {hinges}, chyby: {errors}, upozornění: {warnings}
|
||||
Nature Icons Ikony přírody
|
||||
Flower Květina
|
||||
Tree Strom
|
||||
Mountain Hora
|
||||
Ornamental Ornamentální
|
||||
Scrollwork Rozvilina
|
||||
Filigree Arrow Filigránový šíp
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10864,6 +10864,10 @@ breakText Glyphs Glyffer
|
||||
@msg A joint does not close by {gap} pt. En samling lukker ikke med {gap} pt.
|
||||
@msg Two panels pass through each other. To paneler går gennem hinanden.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine"
|
||||
Nature Icons Naturikoner
|
||||
Flower Blomst
|
||||
Tree Træ
|
||||
Mountain Bjerg
|
||||
Ornamental Ornamentik
|
||||
Scrollwork Slyngværk
|
||||
Filigree Arrow Filigranpil
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10444,6 +10444,10 @@ breakText Glyphs Glyphen
|
||||
@msg A panel is not joined to the rest by a crease. Ein Feld ist durch keine Rilllinie mit den übrigen verbunden.
|
||||
@msg A fold line is on a non-printing layer. Eine Faltlinie liegt auf einer nicht druckbaren Ebene.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Felder: {panels}, Scharniere: {hinges}, Fehler: {errors}, Warnungen: {warnings}
|
||||
Nature Icons Natursymbole
|
||||
Flower Blume
|
||||
Tree Baum
|
||||
Mountain Berg
|
||||
Ornamental Ornamental
|
||||
Scrollwork Schnörkel
|
||||
Filigree Arrow Filigranpfeil
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8951,6 +8951,10 @@ breakText Glyphs Γλύφοι
|
||||
@msg A joint does not close by {gap} pt. Μια ένωση δεν κλείνει κατά {gap} pt.
|
||||
@msg Two panels pass through each other. Δύο πάνελ διαπερνούν το ένα το άλλο.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine"
|
||||
Nature Icons Εικονίδια φύσης
|
||||
Flower Λουλούδι
|
||||
Tree Δέντρο
|
||||
Mountain Βουνό
|
||||
Ornamental Διακοσμητικά μοτίβα
|
||||
Scrollwork Σπείρα
|
||||
Filigree Arrow Φιλιγκράν βέλος
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10695,6 +10695,10 @@ breakText Glyphs Glifos
|
||||
@msg A joint does not close by {gap} pt. Una unión no cierra por {gap} pt.
|
||||
@msg Two panels pass through each other. Dos paneles se atraviesan entre sí.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
|
||||
Nature Icons Iconos de naturaleza
|
||||
Flower Flor
|
||||
Tree Árbol
|
||||
Mountain Montaña
|
||||
Ornamental Ornamental
|
||||
Scrollwork Voluta
|
||||
Filigree Arrow Flecha de filigrana
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9034,6 +9034,10 @@ breakText Glyphs Merkit
|
||||
@msg A joint does not close by {gap} pt. Liitos ei sulkeudu, rako {gap} pt.
|
||||
@msg Two panels pass through each other. Kaksi paneelia kulkee toistensa läpi.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine"
|
||||
Nature Icons Luontokuvakkeet
|
||||
Flower Kukka
|
||||
Tree Puu
|
||||
Mountain Vuori
|
||||
Ornamental Koristekuviot
|
||||
Scrollwork Kiemura
|
||||
Filigree Arrow Filigraanin nuoli
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10765,6 +10765,10 @@ breakText Glyphs Glyphes
|
||||
@msg A joint does not close by {gap} pt. Un joint ne se ferme pas, avec un écart de {gap} pt.
|
||||
@msg Two panels pass through each other. Deux panneaux se traversent.
|
||||
@msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} pixels, c’est trop grand pour le GIF (65535 pixels par côté au plus) : réduisez la résolution
|
||||
Nature Icons Icônes de nature
|
||||
Flower Fleur
|
||||
Tree Arbre
|
||||
Mountain Montagne
|
||||
Ornamental Ornemental
|
||||
Scrollwork Volute
|
||||
Filigree Arrow Flèche filigrane
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -5673,6 +5673,10 @@ swatch [Registration] [રજિસ્ટ્રેશન]
|
||||
Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર
|
||||
Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine"
|
||||
Nature Icons પ્રકૃતિ ચિહ્નો
|
||||
Flower ફૂલ
|
||||
Tree વૃક્ષ
|
||||
Mountain પર્વત
|
||||
Ornamental અલંકારિક
|
||||
Scrollwork વળાંકવાળી સજાવટ
|
||||
Filigree Arrow નાજુક કોતરણીવાળું તીર
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -10408,6 +10408,10 @@ theme Appearance अपीयरेंस
|
||||
@msg A panel is not joined to the rest by a crease. कोई पैनल किसी क्रीज़ लाइन से बाकी से जुड़ा नहीं है।
|
||||
@msg A fold line is on a non-printing layer. एक फ़ोल्ड लाइन नॉन-प्रिंटिंग लेयर पर है।
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} पैनल: {panels}, हिंज: {hinges}, एरर: {errors}, वॉर्निंग: {warnings}
|
||||
Nature Icons प्रकृति चिह्न
|
||||
Flower फूल
|
||||
Tree पेड़
|
||||
Mountain पर्वत
|
||||
Ornamental अलंकरण
|
||||
Scrollwork अलंकारी घुमाव
|
||||
Filigree Arrow जालीदार तीर
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10791,6 +10791,10 @@ breakText Glyphs Glifák
|
||||
@msg A panel is not joined to the rest by a crease. Egy panelt egyetlen bigvonal sem köt a többihez.
|
||||
@msg A fold line is on a non-printing layer. Egy hajtásvonal nem nyomtatható rétegen van.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelek: {panels}, zsanérok: {hinges}, hibák: {errors}, figyelmeztetések: {warnings}
|
||||
Nature Icons Természetikonok
|
||||
Flower Virág
|
||||
Tree Fa
|
||||
Mountain Hegy
|
||||
Ornamental Díszítőmotívumok
|
||||
Scrollwork Kacskaringó
|
||||
Filigree Arrow Filigrán nyíl
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8636,6 +8636,10 @@ breakText Glyphs Glif
|
||||
@msg A joint does not close by {gap} pt. Sebuah sambungan tidak menutup sejauh {gap} pt.
|
||||
@msg Two panels pass through each other. Dua panel saling menembus.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine"
|
||||
Nature Icons Ikon Alam
|
||||
Flower Bunga
|
||||
Tree Pohon
|
||||
Mountain Gunung
|
||||
Ornamental Ornamental
|
||||
Scrollwork Sulur Hias
|
||||
Filigree Arrow Panah Filigran
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10478,6 +10478,10 @@ breakText Glyphs Glifi
|
||||
@msg A panel is not joined to the rest by a crease. Un pannello non è unito al resto da alcuna linea di cordonatura.
|
||||
@msg A fold line is on a non-printing layer. Una linea di piega si trova su un livello non stampabile.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Pannelli: {panels}, cerniere: {hinges}, errori: {errors}, avvisi: {warnings}
|
||||
Nature Icons Icone della natura
|
||||
Flower Fiore
|
||||
Tree Albero
|
||||
Mountain Montagna
|
||||
Ornamental Ornamentale
|
||||
Scrollwork Voluta
|
||||
Filigree Arrow Freccia filigranata
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10541,6 +10541,10 @@ breakText Glyphs 字形
|
||||
@msg A panel is not joined to the rest by a crease. パネルがどの筋入れ線でも他とつながっていません。
|
||||
@msg A fold line is on a non-printing layer. 折り線が印刷しないレイヤーにあります。
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} パネル: {panels}、ヒンジ: {hinges}、エラー: {errors}、警告: {warnings}
|
||||
Nature Icons 自然アイコン
|
||||
Flower 花
|
||||
Tree 木
|
||||
Mountain 山
|
||||
Ornamental 装飾模様
|
||||
Scrollwork スクロール装飾
|
||||
Filigree Arrow フィリグリーの矢
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -11088,6 +11088,10 @@ font-script Japanese იაპონური
|
||||
@msg A joint does not close by {gap} pt. შეერთება არ იხურება {gap} pt-ით.
|
||||
@msg Two panels pass through each other. ორი პანელი ერთმანეთში გადის.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine"
|
||||
Nature Icons ბუნების ხატულები
|
||||
Flower ყვავილი
|
||||
Tree ხე
|
||||
Mountain მთა
|
||||
Ornamental ორნამენტული
|
||||
Scrollwork ხვეული
|
||||
Filigree Arrow ფილიგრანული ისარი
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10441,6 +10441,10 @@ breakText Glyphs 글리프
|
||||
@msg A panel is not joined to the rest by a crease. 패널이 어떤 오시선으로도 나머지와 연결되어 있지 않습니다.
|
||||
@msg A fold line is on a non-printing layer. 접는 선이 인쇄되지 않는 레이어에 있습니다.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 패널: {panels}, 힌지: {hinges}, 오류: {errors}, 경고: {warnings}
|
||||
Nature Icons 자연 아이콘
|
||||
Flower 꽃
|
||||
Tree 나무
|
||||
Mountain 산
|
||||
Ornamental 장식 문양
|
||||
Scrollwork 소용돌이 장식
|
||||
Filigree Arrow 세공 화살표
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10841,6 +10841,10 @@ breakText Glyphs Glyphs
|
||||
@msg A panel is not joined to the rest by a crease. Een paneel is door geen rillijn met de rest verbonden.
|
||||
@msg A fold line is on a non-printing layer. Een vouwlijn staat op een laag die niet wordt afgedrukt.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelen: {panels}, scharnieren: {hinges}, fouten: {errors}, waarschuwingen: {warnings}
|
||||
Nature Icons Natuurpictogrammen
|
||||
Flower Bloem
|
||||
Tree Boom
|
||||
Mountain Berg
|
||||
Ornamental Ornamentaal
|
||||
Scrollwork Krulwerk
|
||||
Filigree Arrow Filigraanpijl
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10667,6 +10667,10 @@ breakText Glyphs Glify
|
||||
@msg A panel is not joined to the rest by a crease. Panel nie jest połączony z resztą żadną linią bigowania.
|
||||
@msg A fold line is on a non-printing layer. Linia zgięcia znajduje się na warstwie niedrukowanej.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panele: {panels}, zawiasy: {hinges}, błędy: {errors}, ostrzeżenia: {warnings}
|
||||
Nature Icons Ikony natury
|
||||
Flower Kwiat
|
||||
Tree Drzewo
|
||||
Mountain Góra
|
||||
Ornamental Ornamentalne
|
||||
Scrollwork Zawijas
|
||||
Filigree Arrow Filigranowa strzałka
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10874,6 +10874,10 @@ swatch Yellow Green Verde-amarelado
|
||||
@msg A panel is not joined to the rest by a crease. Um painel não está unido ao restante por nenhuma linha de vinco.
|
||||
@msg A fold line is on a non-printing layer. Uma linha de dobra está em uma camada não imprimível.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Painéis: {panels}, dobradiças: {hinges}, erros: {errors}, avisos: {warnings}
|
||||
Nature Icons Ícones da natureza
|
||||
Flower Flor
|
||||
Tree Árvore
|
||||
Mountain Montanha
|
||||
Ornamental Ornamental
|
||||
Scrollwork Voluta
|
||||
Filigree Arrow Seta filigranada
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10858,6 +10858,10 @@ shape Open Открытый
|
||||
@msg Two panels pass through each other. Две панели проходят друг сквозь друга.
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
|
||||
Nature Icons Значки природы
|
||||
Flower Цветок
|
||||
Tree Дерево
|
||||
Mountain Гора
|
||||
Ornamental Орнаментальные
|
||||
Scrollwork Завиток
|
||||
Filigree Arrow Филигранная стрела
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10895,6 +10895,10 @@ digits Hindi Hindi
|
||||
@msg A joint does not close by {gap} pt. En fog sluter inte med {gap} pt.
|
||||
@msg Two panels pass through each other. Två paneler går igenom varandra.
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen
|
||||
Nature Icons Naturikoner
|
||||
Flower Blomma
|
||||
Tree Träd
|
||||
Mountain Berg
|
||||
Ornamental Ornament
|
||||
Scrollwork Snirkel
|
||||
Filigree Arrow Filigranpil
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -573,6 +573,16 @@ fn objects_on_path_detach_strings_are_in_complete_catalogs() {
|
||||
}
|
||||
}
|
||||
|
||||
/// The Nature Icons library and its symbols display in each complete UI language.
|
||||
#[test]
|
||||
fn nature_symbol_library_names_are_in_complete_catalogs() {
|
||||
for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) {
|
||||
for name in ["Nature Icons", "Leaf", "Flower", "Tree", "Mountain", "Wave"] {
|
||||
assert!(lang.catalog().plain(name).is_some(), "{} is missing {name}", lang.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The errors of Perspective Distort and Free Distort on an image, and of the image commands that
|
||||
/// refuse a distorted image, are in every complete-message catalog.
|
||||
#[test]
|
||||
@@ -842,7 +852,7 @@ fn built_in_library_symbol_names_are_in_complete_catalogs() {
|
||||
.flat_map(|(_, lib)| lib.doc.symbols.iter().map(|s| s.name.clone()).collect::<Vec<_>>())
|
||||
.collect(),
|
||||
);
|
||||
assert_eq!(names.len(), 38, "{names:?}");
|
||||
assert_eq!(names.len(), 43, "{names:?}");
|
||||
let bad = lacking(&names, |c, n| c.plain(n).is_some());
|
||||
assert!(bad.is_empty(), "{}", bad.join("\n"));
|
||||
}
|
||||
|
||||
@@ -10760,6 +10760,10 @@ breakText Glyphs Glifler
|
||||
@msg A panel is not joined to the rest by a crease. Bir panel geri kalanlara hiçbir pilyaj çizgisiyle bağlı değil.
|
||||
@msg A fold line is on a non-printing layer. Bir katlama çizgisi yazdırılmayan bir katmanda.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneller: {panels}, menteşeler: {hinges}, hatalar: {errors}, uyarılar: {warnings}
|
||||
Nature Icons Doğa simgeleri
|
||||
Flower Çiçek
|
||||
Tree Ağaç
|
||||
Mountain Dağ
|
||||
Ornamental Süslemeli
|
||||
Scrollwork Kıvrım süsü
|
||||
Filigree Arrow Telkari ok
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10454,6 +10454,10 @@ breakText Glyphs Гліфи
|
||||
@msg A panel is not joined to the rest by a crease. Панель не з’єднана з рештою жодною лінією біговки.
|
||||
@msg A fold line is on a non-printing layer. Лінія згину лежить на шарі, що не друкується.
|
||||
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панелі: {panels}, шарніри: {hinges}, помилки: {errors}, попередження: {warnings}
|
||||
Nature Icons Значки природи
|
||||
Flower Квітка
|
||||
Tree Дерево
|
||||
Mountain Гора
|
||||
Ornamental Орнаментальні
|
||||
Scrollwork Завиток
|
||||
Filigree Arrow Філігранна стріла
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8651,6 +8651,10 @@ breakText Glyphs Glyph
|
||||
@msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine"
|
||||
Nature Icons Biểu tượng thiên nhiên
|
||||
Flower Hoa
|
||||
Tree Cây
|
||||
Mountain Núi
|
||||
Ornamental Hoa văn
|
||||
Scrollwork Nét cuộn
|
||||
Filigree Arrow Mũi tên hoa văn
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10645,6 +10645,10 @@ breakText Glyphs 字形
|
||||
@msg A joint does not close by {gap} pt. 有一处接缝相差 {gap} pt 未闭合。
|
||||
@msg Two panels pass through each other. 两个面板相互穿插。
|
||||
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率
|
||||
Nature Icons 自然图标
|
||||
Flower 花朵
|
||||
Tree 树木
|
||||
Mountain 山脉
|
||||
Ornamental 装饰纹样
|
||||
Scrollwork 卷饰
|
||||
Filigree Arrow 花丝箭头
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10461,6 +10461,10 @@ breakText Glyphs 字符
|
||||
@msg A joint does not close by {gap} pt. 有一處接縫相差 {gap} pt 未閉合。
|
||||
@msg Two panels pass through each other. 兩個面板相互穿插。
|
||||
@msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小
|
||||
Nature Icons 自然圖示
|
||||
Flower 花朵
|
||||
Tree 樹木
|
||||
Mountain 山脈
|
||||
Ornamental 裝飾紋樣
|
||||
Scrollwork 卷飾
|
||||
Filigree Arrow 花絲箭頭
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -926,8 +926,28 @@ fn shows_targeted(view: &View, n: &Node, is_sel: bool) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
/// The target circle of `n`'s row at `c`: a ring, doubled while `n` is targeted, filled when `n`
|
||||
/// has an appearance or transparency of its own. Its response is clicked to target `n`; dragging
|
||||
/// The radius of the inner ring of a targeted item's target circle (the double ring); the outer
|
||||
/// ring's radius is 5.
|
||||
pub(super) const TARGET_RING: f32 = 2.8;
|
||||
/// The width of the inner ring.
|
||||
pub(super) const TARGET_STROKE: f32 = 1.0;
|
||||
/// The radius of the dot filling the circle of an item that has an appearance of its own and is
|
||||
/// not targeted.
|
||||
pub(super) const TARGET_DOT: f32 = 3.2;
|
||||
/// The radius of that dot inside a targeted item's inner ring: clear of the ring, so a targeted
|
||||
/// item with an appearance of its own shows both (#8711).
|
||||
pub(super) const TARGET_DOT_IN_RING: f32 = 1.5;
|
||||
|
||||
/// The marks inside a target circle's outer ring: the inner ring's radius when the item is
|
||||
/// `targeted`, and the appearance dot's radius when it is `styled` (has an appearance of its own).
|
||||
/// Each of the four combinations looks different, as the Layers panel's target icons do.
|
||||
pub(super) fn target_marks(targeted: bool, styled: bool) -> (Option<f32>, Option<f32>) {
|
||||
let dot = if targeted { TARGET_DOT_IN_RING } else { TARGET_DOT };
|
||||
(targeted.then_some(TARGET_RING), styled.then_some(dot))
|
||||
}
|
||||
|
||||
/// The target circle of `n`'s row at `c`: a ring, doubled while `n` is targeted, with a dot when
|
||||
/// `n` has an appearance or transparency of its own ([`target_marks`]). Its response is clicked to target `n`; dragging
|
||||
/// it carries `n`'s appearance ([`PanelDrag::Appearance`]) onto another row's circle (Alt
|
||||
/// copies it) or the trash.
|
||||
fn target_circle(ui: &mut Ui, n: &Node, c: egui::Pos2, h: f32, targeted: bool, actions: &mut Vec<(String, Value)>, t: &Tokens) -> egui::Response {
|
||||
@@ -946,11 +966,12 @@ fn target_circle(ui: &mut Ui, n: &Node, c: egui::Pos2, h: f32, targeted: bool, a
|
||||
}
|
||||
let ring = if held { t.accent } else { t.icon };
|
||||
ui.painter().circle_stroke(c, 5.0, Stroke::new(if held { 1.5 } else { 1.0 }, ring));
|
||||
if targeted {
|
||||
ui.painter().circle_stroke(c, 2.8, Stroke::new(1.0, t.icon));
|
||||
let (inner, dot) = target_marks(targeted, has_styled_target(n));
|
||||
if let Some(r) = inner {
|
||||
ui.painter().circle_stroke(c, r, Stroke::new(TARGET_STROKE, t.icon));
|
||||
}
|
||||
if has_styled_target(n) {
|
||||
ui.painter().circle_filled(c, 3.2, t.icon);
|
||||
if let Some(r) = dot {
|
||||
ui.painter().circle_filled(c, r, t.icon);
|
||||
}
|
||||
if resp.dragged_by(egui::PointerButton::Primary) {
|
||||
ui.ctx().set_cursor_icon(egui::CursorIcon::Grabbing);
|
||||
|
||||
@@ -7,7 +7,8 @@ use super::*;
|
||||
fn filled_targets(app: &mut VectorcraftApp, ctx: &egui::Context) -> usize {
|
||||
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui));
|
||||
out.textures_delta.clear();
|
||||
out.shapes.iter().filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if cs.radius == 3.2 && cs.fill != Color32::TRANSPARENT)).count()
|
||||
let dot = |r: f32| r == rows::TARGET_DOT || r == rows::TARGET_DOT_IN_RING;
|
||||
out.shapes.iter().filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if dot(cs.radius) && cs.fill != Color32::TRANSPARENT)).count()
|
||||
}
|
||||
|
||||
/// A generated `<Kind>` name is translated where painted; an unnamed text object's text never
|
||||
@@ -417,12 +418,67 @@ fn targeted_rows(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec<usize> {
|
||||
let rings: Vec<egui::Pos2> = out
|
||||
.shapes
|
||||
.iter()
|
||||
.filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if cs.radius == 2.8))
|
||||
.filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if cs.radius == rows::TARGET_RING))
|
||||
.map(|c| c.shape.visual_bounding_rect().center())
|
||||
.collect();
|
||||
circles.iter().enumerate().filter(|(_, c)| rings.iter().any(|r| r.distance(**c) < 0.5)).map(|(i, _)| i).collect()
|
||||
}
|
||||
|
||||
/// The marks one headless frame paints inside the outer ring of each target circle, top row
|
||||
/// first: per circle, its (radius, fill, stroke width) circles, sorted by radius.
|
||||
fn target_marks_painted(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec<Vec<(f32, bool, f32)>> {
|
||||
let (circles, _) = frame(app, ctx, vec![], false);
|
||||
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui));
|
||||
out.textures_delta.clear();
|
||||
circles
|
||||
.iter()
|
||||
.map(|c| {
|
||||
let mut marks: Vec<(f32, bool, f32)> = out
|
||||
.shapes
|
||||
.iter()
|
||||
.filter_map(|s| match &s.shape {
|
||||
egui::Shape::Circle(cs) if cs.radius < 5.0 && cs.center.distance(*c) < 0.01 => {
|
||||
Some((cs.radius, cs.fill != Color32::TRANSPARENT, cs.stroke.width))
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
.collect();
|
||||
marks.sort_by(|a, b| a.0.total_cmp(&b.0));
|
||||
marks
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// A targeted item with an appearance of its own keeps its inner ring in view: the appearance
|
||||
/// dot sits inside the ring with a gap, so the four looks (neither, targeted, with an appearance,
|
||||
/// both) differ, as the target icons the Appearance attributes help describes do (#8711).
|
||||
#[test]
|
||||
fn a_targeted_circle_with_an_appearance_shows_both_ring_and_dot() {
|
||||
let (mut app, _layer, [a, b]) = two_rects();
|
||||
app.session.execute("transparency.set", &json!({"ids": [a.0], "opacity": 30})).unwrap();
|
||||
let ctx = egui::Context::default();
|
||||
// Rows top down: the layer, b, a.
|
||||
let marks = target_marks_painted(&mut app, &ctx);
|
||||
assert_eq!(marks.len(), 3);
|
||||
let (neither, styled) = (marks[1].clone(), marks[2].clone());
|
||||
app.session.execute("layer.target", &json!({"id": b.0})).unwrap();
|
||||
let targeted = target_marks_painted(&mut app, &ctx)[1].clone();
|
||||
app.session.execute("layer.target", &json!({"id": a.0})).unwrap();
|
||||
let both = target_marks_painted(&mut app, &ctx)[2].clone();
|
||||
// The inner ring is painted, and nothing filled reaches its inner edge.
|
||||
let ring = both.iter().find(|m| m.0 == rows::TARGET_RING && !m.1).expect("the inner ring");
|
||||
let inner_edge = ring.0 - ring.2 / 2.0;
|
||||
let dot = both.iter().find(|m| m.1).expect("the appearance dot");
|
||||
assert!(dot.0 + dot.2 / 2.0 < inner_edge - 0.5, "the dot {dot:?} covers the ring {ring:?}");
|
||||
let looks = [&neither, &targeted, &styled, &both];
|
||||
for (i, x) in looks.iter().enumerate() {
|
||||
for y in &looks[i + 1..] {
|
||||
assert_ne!(x, y, "two states look the same: {looks:?}");
|
||||
}
|
||||
}
|
||||
assert_eq!(neither, vec![]);
|
||||
}
|
||||
|
||||
/// A layer added to the selection from its target circle shows as targeted, as an object added
|
||||
/// the same way does (#8646): with nothing targeted, a layer's circle shows its inner ring while
|
||||
/// all of its visible, unlocked art is selected, and not while only part of it is.
|
||||
|
||||
@@ -153,6 +153,7 @@ fn the_window_menu_and_the_symbols_panel_open_symbol_libraries() {
|
||||
json!("inventory-icons"),
|
||||
json!("skill-icons"),
|
||||
json!("weather-icons"),
|
||||
json!("nature-icons"),
|
||||
json!("media-controls"),
|
||||
]
|
||||
);
|
||||
|
||||
@@ -764,6 +764,15 @@ fn menu_access_stationary_pointer_repeat_and_rerun_do_not_retarget_or_double_inv
|
||||
assert_eq!(s.app.ui.view.rulers, !before, "one Text/Key pair invokes exactly once across passes");
|
||||
|
||||
s.end_access();
|
||||
// Wait for any background font scan and ensure > 20 families even on minimal runners.
|
||||
let db = vectorcraft_text::FontDb::global();
|
||||
let _ = db.families();
|
||||
for i in 0..24 {
|
||||
if db.menu_family_list_now().len() > 20 {
|
||||
break;
|
||||
}
|
||||
db.add_font(vectorcraft_testkit::fonts::renamed(&format!("Menu Test Font {i:02}")));
|
||||
}
|
||||
let text = s.app.run("text.create", json!({"x": 250, "y": 200, "text": "Menu", "font": "Inter", "size": 12})).unwrap()["id"].clone();
|
||||
s.app.run("select.set", json!({"ids": [text]})).unwrap();
|
||||
let size = vec2(640.0, 420.0);
|
||||
|
||||
+2
-1
@@ -713,7 +713,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
|
||||
Libraries Menu open each library in a library panel of its own (seven original libraries generated in code,
|
||||
Basic Shapes, UI Frames with default 9-slice guides on Panel, Button and Bar, Map Markers with Pin,
|
||||
Flag, Crosshair and Checkpoint, Inventory Icons with Sword, Shield, Potion, Key and Gem, Skill Icons with
|
||||
Attack, Defend, Heal, Buff and Ult, Weather Icons with Sun, Moon, Cloud, Rain, Thunder and Snow, and Media Controls with
|
||||
Attack, Defend, Heal, Buff and Ult, Weather Icons with Sun, Moon, Cloud, Rain, Thunder and Snow, Nature Icons with Leaf, Flower, Tree,
|
||||
Mountain and Wave, and Media Controls with
|
||||
Play, Pause, Stop, Skip Next, Shuffle and Repeat; User Defined; Other
|
||||
Library… reads the symbols of any document VectorCraft opens); a click
|
||||
adds a symbol to the document's Symbols with its Symbol Options and the resources it uses, as one undo
|
||||
|
||||
+1
-1
@@ -5876,7 +5876,7 @@ left out.
|
||||
## Symbol libraries
|
||||
|
||||
Symbol libraries are read-only sets of symbols: seven generated in code (Basic Shapes, UI Frames, Map Markers,
|
||||
Inventory Icons, Skill Icons, Weather Icons, Media Controls), the `.vectorcraft` files in
|
||||
Inventory Icons, Skill Icons, Weather Icons, Nature Icons with Leaf, Flower, Tree, Mountain and Wave, Media Controls), the `.vectorcraft` files in
|
||||
the user library folder of the desktop app (User Defined) and the symbols of any document loaded with
|
||||
`symbol.loadLibrary`. `symbol.libraries` lists them (`id`, `name`, `category`: `builtIn`, `user` or `loaded`, `count`)
|
||||
and `symbol.library {library}` returns one's symbols (`name`, `size`, `registration`, `exportType`; `library` is an
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
# Roadmap: milestones and what's next
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (M11: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); M11: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: M4: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regresLine truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (M1: Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: M11: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); M11: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: M4: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a Line truncated
|
||||
>
|
||||
> Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865).
|
||||
>
|
||||
@@ -178,7 +178,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule
|
||||
| # | Milestone | Status | Est. remaining, one agent (h) |
|
||||
|---|---|---|---|
|
||||
| M0 | Skeleton + vertical slice | ✅ done | — |
|
||||
| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 |
|
||||
| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (a targeted Layers item with an appearance of its own shows its inner ring around a smaller appearance dot (#8711); path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 |
|
||||
| M2 | Drawing tools + smart guides | ✅ mostly done (Eraser preserves fill outside fixed and varied tip sweeps and Alt-drag marquees on fill-only open paths and keeps their compound holes; clipping masks retain surviving contours or empty geometry in the same node; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; hidden Rasterize and Along/Across stroke rows do not block visible gradients; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior (#6582); #3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123); Scissors hover and cuts use the Pen's path/align/intersect/anchor snaps, with Alt Add Anchor and cut endpoint selection retained (#6470); Scissors previews the current anchor or curve cut point (#8655) | 12–18 |
|
||||
| M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 |
|
||||
| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths (#8128; estimates unchanged); Production Preflight checks fonts, overflow, links and image resolution with clickable findings and automatic rechecking (VectorCraft addition; estimates unchanged); PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543; estimates unchanged); PDF import: type filled and stroked after a page of type filled only (more than 64 lines) comes in as one filled and stroked type object again, with or without a path between, and a `TJ` over more lines than are kept with a glyph kept as an outline still stays a filled object and a stroked one for each part (#8549 follow-up; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding Line truncated
|
||||
@@ -235,6 +235,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-19 | minor | M1: Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | M11: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged |
|
||||
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688). Scores and estimates unchanged. |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Parity with Adobe Illustrator
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic recLine truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that cLine truncated
|
||||
>
|
||||
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
|
||||
>
|
||||
@@ -75,6 +75,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | G12: Brushes panel item right-click context menu offering Brush Options…, Duplicate Brush, and Delete Brush (disabled if the last remaining brush); right-clicking an unselected brush selects it first, and right-clicking within a multi-selection preserves it offering Duplicate Brushes / Delete Brushes; headless tests in `crates/ui-egui/src/panels/brushes/tests.rs`; scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…); right-clicking an unselected link row selects it first, and right-clicking within a multi-selection preserves it; headless tests in `crates/ui-egui/src/panels/tests_links.rs`; scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | PDF import (#8549 follow-up): type filled and stroked after a page of type filled only came in as a filled object and a stroked one: since #8549 lines filled only are kept for a stroke pass too, and the glyphs of the lines finished past the 64 kept were remembered until the next stroke, so `2 Tr (Title) Tj` after more than 64 lines of type filled only took its first stroke for the start of a stroke pass over them, always once more than 4,096 glyphs had been finished so. Those glyphs are now forgotten when anything else is drawn (a path, an image, a Type 3 glyph's art, a change of blend mode or soft mask: nothing is drawn between an operator's fill pass and its stroke pass), and past the first 4,096 glyphs none are remembered instead of every stroke matching. A `TJ` over more lines than are kept still comes in as a filled object and a stroked one for each part, also when it ends where it began, and when a glyph kept as an outline comes before that (the line it starts keeps the glyphs of the lines finished). Remaining: with nothing drawn between them, type filled and stroked at exactly the place, font, size and text of a glyph filled only on a line finished so still comes in as a filled object and a stroked one, as the device can't tell its stroke pass from the start of one over that glyph. Tests: `type_filled_and_stroked_after_a_dense_page_of_filled_type_is_filled_and_stroked`, `type_filled_and_stroked_over_a_finished_glyph_after_a_path_is_filled_and_stroked`, `an_outline_glyph_in_a_tj_over_more_lines_than_are_kept_leaves_fill_and_stroke_apart`; scores and estimates unchanged. |
|
||||
@@ -756,6 +757,7 @@ since 2026-10-01.
|
||||
- **Large Shift-marquee selections and Select › Inverse:** `select.toggle` and `select.add` with many ids (a Shift-drag marquee sends them together) go through the selection once instead of once per id, and Select › Inverse looks each object up in a set of the selected ones. The resulting selection, its order and the reply are the same as before. With 50,000 objects the selection step of toggling every object off took 528 to 655 ms before and 2.5 to 4.6 ms after in 7 runs, wall clock on a machine that was running other builds (`cargo run --release -p vectorcraft-engine --example selection_bench`). Regression tests: `add_all_does_what_adding_each_does` and `toggle_all_does_what_toggling_each_does` in `crates/doc/src/selection/tests.rs`, and `toggle_and_add_handle_each_listed_id_in_order` in `crates/engine/tests/it/selection_commands.rs`.
|
||||
- **Shift-click in the Layers panel's selection column on a large layer:** `layer.selectAll {id, add: true}` checks whether the row's art is all selected with a set of the selected objects, and removes or adds that art in one pass instead of once per object. The resulting selection, its order, the reply and the highlighted rows are the same as before. On a layer of 50,000 objects the whole command took a median of 733 ms before and 6.9 ms after when all of the layer's art was selected, and 369 ms before and 24 ms after when every other object was, in 7 runs each, wall clock on Linux while other builds were running (`cargo run --release -p vectorcraft-engine --example layer_select_bench`). Regression test: `a_shift_click_in_the_selection_column_matches_adding_or_removing_each_id` in `crates/engine/src/tests/layers.rs`.
|
||||
- **Layers added to the selection from their target circles show as targeted (#8646):** with several items picked from their circles (nothing targeted), a layer or sublayer's circle shows its inner ring while all of its visible, unlocked art is selected, as an object's circle does while the object is selected. A layer is never selected itself, only its art, so its circle used to keep a single ring. Regression test: `a_layer_added_from_its_target_circle_shows_as_targeted` in `crates/ui-egui/src/panels/layers/tests.rs`.
|
||||
- **A targeted item with an appearance of its own shows both marks (#8711):** its target circle keeps the inner ring of a targeted item, with the appearance dot drawn smaller inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) do. The dot used to cover the ring. Regression test: `a_targeted_circle_with_an_appearance_shows_both_ring_and_dot` in `crates/ui-egui/src/panels/layers/tests.rs`.
|
||||
- **Selection passes through raster effects:** clicks with the Selection, Direct Selection and Group Selection tools (Group Selection's repeated click included), the Selection tool's pointer and marquee, Direct Selection's marquee, pointer and anchor highlight, and Group Selection's marquee (E for enclosed objects included) leave out the area that a drop shadow, a glow, a blur or another raster effect paints beyond an object. A click on a shadow selects the object under it, or nothing over an empty canvas, a repeated Group Selection click there adds the groups of the object under it, and a press on the shadow of a selected object does not move it ([the help page](https://helpx.adobe.com/illustrator/using/selecting-objects.html)). Over a shadow, Direct Selection highlights only the anchors of the object under it, and Group Selection keeps its own pointer and highlights no anchor, as it does everywhere (VectorCraft's own rule). No setting changes this. This covers paths, groups, type, symbol instances and images. Regression tests: `crates/engine/src/tests/select_effects.rs`.
|
||||
- **Symbol instances are selected where their art draws past their box:** a click or a marquee selects a symbol instance where a clipping path in its art, moved or reshaped by its live geometry effects, shows the art past the instance's box, as it selects a group of the same art; a click also selects it where a stroke in its art paints past the box ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)). The rest is VectorCraft's own rule: inside the box the instance is selected as before; in Outline view and below a layer whose Preview is off only the box counts; hidden art and the area a raster effect paints are left out. This covers instances in groups, nested in other symbols' art, moved and scaled. Regression tests: `a_symbol_instance_is_hit_where_a_moved_clipping_path_in_its_art_shows_the_art` and `a_symbol_instance_is_hit_on_the_stroke_of_its_art_past_its_box` in `crates/doc/src/hit/tests.rs`.
|
||||
- **Selection follows geometry effects:** a click or a marquee with the selection tools selects a path or compound path where its live geometry effects (Transform, Offset Path, Roughen, Zig Zag and the other effects that reshape a path, on the object or on its fills and strokes) draw it, the copies a Transform effect makes included, and not where its own geometry no longer paints. The members of a group or layer whose own geometry effects move or reshape them are selected where they are drawn, at the depth each tool selects, and a locked member there lets the click through to what is below and is listed there in the Unlock submenu. A group's own fills and strokes are clicked where they paint its members, and a clipping path inside such a group is taken on its drawn outline before the art it clips. A compound path keeps its holes, Object Selection by Path Only takes the drawn outline and not its fill, and stacking order is kept. The selection tools select objects by clicking or by a marquee ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)), and the effects leave the art they reshape editable ([the help page](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/apply-and-modify-effects.html)); where clicks land on the reshaped art is VectorCraft's own rule. In Outline view clicks and marquees use the plain paths, and in a layer with Preview off they take outlines only. The area a raster effect paints is still left out. Regression tests: `a_*_shifted_art_*`, `a_click_hits_a_paths_copy_and_evaluates_its_art_once_until_it_changes`, `a_groups_own_effect_moves_where_its_members_are_hit`, `a_layers_own_effect_moves_where_its_art_is_hit`, `a_preview_off_sublayer_of_an_effected_layer_is_clicked_in_outline`, `a_painted_group_around_an_effected_symbols_instance_is_hit_where_its_art_is_drawn`, `an_intertwine_group_in_a_layers_drawn_art_is_hit_in_its_woven_order`, `a_click_in_a_plain_group_evaluates_only_its_member_with_effects`, `a_clip_groups_own_effect_moves_where_its_mask_outline_is_hit`, `an_isolated_clip_group_with_its_own_effect_is_marqueed_by_its_members_own_geometry` and `a_clip_groups_art_is_hit_when_its_drawn_art_holds_only_the_clipping_path` in `crates/doc/src/hit/tests.rs`, and `a_click_and_a_marquee_select_art_where_its_transform_effect_draws_it`, `a_click_selects_a_group_where_its_own_fill_paints_a_moved_member`, `a_marquee_takes_an_inner_groups_own_fill_inside_a_painted_group` and `a_marquee_takes_a_groups_own_fill_inside_a_painted_layer` in `crates/engine/src/tests/select_effects.rs`.
|
||||
@@ -1219,7 +1221,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- macOS: Finder opens every format File › Open reads with VectorCraft (double-click, Open With, a drop on the Dock icon, `open -a`), at launch or while it runs; the release and `cargo xtask bundle` apps share one `Info.plist` that declares those document types, owning only VectorCraft's own formats. The DMG opens on a designed Finder window, VectorCraft.app beside the `Applications` link over a background with the app icon (#493).
|
||||
- Swatch and graphic style libraries, Libraries panel files, presets and plug-ins open wherever they are dropped on the window, as File › Open opens them.
|
||||
- File › Open has a filter for each kind of file it opens other than a document, Graphic Style Libraries (`.vcstyles`, after Swatch libraries) and Perspective grid presets (`.vcperspective`, after Print presets) among them, and Other Library… lists its library filter once. Graph designs are stored in the document, with no file type or filter of their own. Tests: `open_exts_cover_every_readable_format`, `library_open_filters_list_library_formats_first`.
|
||||
- **Symbol libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-or-import-symbol-libraries.html)): Window › Symbol Libraries and the Symbols panel's Symbol Libraries Menu open each library in a library panel of its own, as swatch and graphic style libraries do. The built-in libraries, Basic Shapes, UI Frames (Panel, Button and Bar with default 9-slice guides), Map Markers (Pin, Flag, Crosshair and Checkpoint, no default 9-slice), Inventory Icons (Sword, Shield, Potion, Key and Gem, no default 9-slice), Skill Icons (Attack, Defend, Heal, Buff and Ult, no default 9-slice), Weather Icons (Sun, Moon, Cloud, Rain, Thunder and Snow, no default 9-slice) and Media Controls (Play, Pause, Stop, Skip Next, Shuffle and Repeat, no default 9-slice), are original art generated in code (`crates/engine/src/cmd/symbollib.rs`). A click on a symbol adds it to the document's Symbols as one undo step, with its Symbol Options (size, registration, export type, 9-slice guides) and every resource it uses (the symbols it nests, patterns, swatches, brushes, graphic styles, images), and makes it the current symbol; a symbol the document already has is not added again and another symbol of the same name keeps its name, the library's comes in numbered. Thumbnails, in the library panels and the Symbols panel, draw a symbol with the symbols it nests and the patterns and images it uses. Dragging a library symbol onto the canvas also places an instance there, in the same step ([placing from a library](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html)). Save Symbols (the library menu) and Save Symbol Library… (the Symbols panel menu) write the document's symbols as a `.vectorcraft` document holding only them, into the user library folder (listed under User Defined) or a file; Other Library… reads the symbols of any document VectorCraft opens; a file it can't read is an error and opens no panel. Tests: `crates/engine/src/tests/symbollib.rs`, `crates/ui-egui/src/panels/tests_symbol_libraries.rs`, `panels::symbols::tests::thumbnails_show_the_symbols_a_symbol_nests`, `canvas::tests::a_library_symbol_dropped_on_the_canvas_is_added_and_placed_there_in_one_step`.
|
||||
- **Symbol libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-or-import-symbol-libraries.html)): Window › Symbol Libraries and the Symbols panel's Symbol Libraries Menu open each library in a library panel of its own, as swatch and graphic style libraries do. The built-in libraries, Basic Shapes, UI Frames (Panel, Button and Bar with default 9-slice guides), Map Markers (Pin, Flag, Crosshair and Checkpoint, no default 9-slice), Inventory Icons (Sword, Shield, Potion, Key and Gem, no default 9-slice), Skill Icons (Attack, Defend, Heal, Buff and Ult, no default 9-slice), Weather Icons (Sun, Moon, Cloud, Rain, Thunder and Snow, no default 9-slice), Nature Icons (Leaf, Flower, Tree, Mountain and Wave, no default 9-slice) and Media Controls (Play, Pause, Stop, Skip Next, Shuffle and Repeat, no default 9-slice), are original art generated in code (`crates/engine/src/cmd/symbollib.rs`). A click on a symbol adds it to the document's Symbols as one undo step, with its Symbol Options (size, registration, export type, 9-slice guides) and every resource it uses (the symbols it nests, patterns, swatches, brushes, graphic styles, images), and makes it the current symbol; a symbol the document already has is not added again and another symbol of the same name keeps its name, the library's comes in numbered. Thumbnails, in the library panels and the Symbols panel, draw a symbol with the symbols it nests and the patterns and images it uses. Dragging a library symbol onto the canvas also places an instance there, in the same step ([placing from a library](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html)). Save Symbols (the library menu) and Save Symbol Library… (the Symbols panel menu) write the document's symbols as a `.vectorcraft` document holding only them, into the user library folder (listed under User Defined) or a file; Other Library… reads the symbols of any document VectorCraft opens; a file it can't read is an error and opens no panel. Tests: `crates/engine/src/tests/symbollib.rs`, `crates/ui-egui/src/panels/tests_symbol_libraries.rs`, `panels::symbols::tests::thumbnails_show_the_symbols_a_symbol_nests`, `canvas::tests::a_library_symbol_dropped_on_the_canvas_is_added_and_placed_there_in_one_step`.
|
||||
- **Nature Icons library:** Leaf, Flower, Tree, Mountain and Wave are five original procedural vector symbols. Each has a finite natural size, can be added and placed through the symbol library controls, and survives saving to a library file; no 9-slice guides are assigned by default.
|
||||
- **9-slice scaling** ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/maintain-proportions-while-scaling-symbols.html)): a scaled instance of a symbol with Enable Guides for 9-Slice Scaling on stays an instance and keeps the parts of its art outside the guides at their size. New guides sit a quarter of the symbol's width and height in from each edge ([reference](https://help.adobe.com/archive/en/illustrator/cs6/illustrator_reference.pdf), Use 9-slice scaling section); saved guides keep their values. The rest is VectorCraft's own rule: the corners keep both sizes, the top and bottom edges stretch in width, the left and right edges in height and the center in both; an instance smaller than its two outer cells on an axis shrinks them in proportion and leaves the center empty; the cells are sized along the symbol's axes before the instance's rotation, shear or reflection. A path with solid paint that crosses a guide is cut there and stays one path, its stroke at its weight with Scale Strokes & Effects on or off; type, images, live objects and gradient or pattern paint that cross a guide are drawn in each cell they reach, clipped to it, except those that draw symbol art (a nested instance, type with an inline graphic, a placed document, a brushed stroke, or a pattern whose tile draws one of these), which are placed by the cell their center is in; an object in one cell is placed by that cell and stays as it is. The canvas, bounds, the Eyedropper, Break Link to Symbol and the PDF, EPS, DXF, EMF/WMF and SVG exports place the art the same way; SVG writes such an instance as its placed art instead of a `<use>`, and DXF and WMF, which do not clip, cut every path that crosses a guide and place other such objects by the cell their center is in. Tests: `symbol_nine_slice::tests` in `crates/doc`, `crates/engine/src/tests/symbol_nine_slice.rs`, `a_scaled_nine_slice_instance_keeps_its_corners` (PDF), `a_scaled_nine_slice_instance_is_written_as_the_canvas_draws_it` (SVG), `a_scaled_nine_slice_instance_is_sampled_as_it_is_drawn` (Eyedropper).
|
||||
- **Symbol editing mode** ([Edit symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/edit-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): a double-click on a symbol instance, the Control bar's Edit Symbol button, a double-click on a symbol in the Symbols panel and the panel menu's Edit Symbol (`symbol.edit`) open the symbol's art on a temporary isolated layer, where the instance shows it (from the panel: centered on the active artboard, or in the view in a document without artboards), with the rest of the document dimmed. Each edit there changes every instance at once; the instances keep their own transforms and stay linked (Break Link to Symbol still expands one), and a dynamic symbol's instances keep their appearance changes to the objects the art still has. Escape, the isolation bar's back button, the Control bar's Exit Symbol Editing Mode and a double-click outside the art leave the mode (`symbol.exitEditing`); leaving without an edit adds no undo step. Saving leaves the editing layer out. Tests: `crates/engine/src/tests/symboledit.rs`, `select::tests::a_double_click_on_a_symbol_instance_edits_its_symbol`, `panels::symbols::tests::edit_symbol_from_the_panel_centers_the_art_on_the_active_artboard_or_the_view`.
|
||||
- **Dynamic symbol appearance follows what an object draws** (VectorCraft's own rule): `symbol.instance.setAppearance` refuses a fill or stroke for an object of the art that does not draw it (a guide, blend, envelope, Repeat, Intertwine group, gradient mesh or placed document; a nested symbol instance's stroke, and its fill unless a solid color or none, which stains its art; an image's fill or stroke without a Convert to Shape or Outline Object effect) with an error that names the key and the object, and the call changes nothing. Opacity, blend and `null`, which takes a stored change back, are taken for every object. Tests: `crates/engine/src/tests/dynamic_symbols.rs`.
|
||||
@@ -3141,6 +3144,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | Guides, grids, smart guides, snapping, rulers: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out their Show/Hide items; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | Performance: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688). Evidence added; scores and estimates unchanged. |
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
# UI and interaction parity
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); Canvas context menu: a right-click on a path offers Simplify… next to Smooth…, opening the Simplify slider, or the Simplify dialog kept for next time, as Object › Path › Simplify… does, #8344; scores and estimates unchanged; previously: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: GLine truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); Canvas context menu: a right-click on a path offers Simplify… next to Smooth…, opening the Simplify slider, or the Simplify dialog kept for next time, as Object › Path › Simplify… does, #8344; scores and estimates unchanged; previously: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchangeLine truncated
|
||||
>
|
||||
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
|
||||
>
|
||||
@@ -626,6 +626,7 @@ before release (#6373). [Paint faces and edges](https://helpx.adobe.com/illustra
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible, with a smaller appearance dot inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) (Targeting items for appearance attributes) do. Before, the dot covered the ring and a targeted item with an appearance looked untargeted, #8711. Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid until it is off; the choices come back as they were and the rulers stay, though dragging or double-clicking them makes no guide meanwhile (#8363). Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | Artboard tool: Shift held once a move or an Alt-drag copy of an artboard is under way keeps it to the level, upright or 45° line from General › Constrain Angle, and snaps slide it along that line; a Shift-press still draws an artboard inside another or marquee-selects (#2497), #8580. Scores and estimates unchanged. |
|
||||
|
||||
+158
-30
@@ -13,6 +13,7 @@ mod layers;
|
||||
mod pdf_deps;
|
||||
mod pngsuite;
|
||||
mod sha256;
|
||||
mod shards;
|
||||
mod stats;
|
||||
mod test262;
|
||||
mod ui_commands;
|
||||
@@ -37,6 +38,11 @@ commands:
|
||||
wasm cargo check --target wasm32-unknown-unknown for the wasm-safe crates and the web app
|
||||
test the workspace tests (cargo nextest when installed, else cargo test), then the doctests
|
||||
ci fmt --check, clippy -D warnings, test, doctests, no-bundled-fonts, pdf-deps, assets, brands, cursors (warnings only), ui-commands --check, layers, wasm (stops at first failure)
|
||||
ci shard shard $GATE_SHARD of $GATE_SHARDS of ci (xtask/src/shards.rs): a test shard runs
|
||||
the tests and doctests of its crates, the last shard the other steps
|
||||
ci warm build what every shard builds, without running it (fills the gate's cache)
|
||||
shards list the crates each shard tests; fails when a member is in no shard or in two,
|
||||
or builds with other features in its shard than in the whole workspace
|
||||
corpus [--download] [--affinity]
|
||||
show where test corpora live; --download fetches PngSuite into corpus/pngsuite,
|
||||
--affinity the pinned public Affinity documents into corpus/affinity
|
||||
@@ -66,7 +72,10 @@ fn main() -> ExitCode {
|
||||
Some("pdf-deps") => pdf_deps::run(&root()),
|
||||
Some("wasm") => cmd_wasm(),
|
||||
Some("test") => cmd_test().and_then(|()| cmd_doctests()),
|
||||
Some("ci") if rest.first() == Some(&"shard") => cmd_ci_shard(),
|
||||
Some("ci") if rest.first() == Some(&"warm") => cmd_ci_warm(),
|
||||
Some("ci") => cmd_ci(),
|
||||
Some("shards") => shards::run().map(drop),
|
||||
Some("corpus") if rest.contains(&"--affinity") => affinity_corpus::fetch(),
|
||||
Some("corpus") => cmd_corpus(rest.contains(&"--download")),
|
||||
Some("bundle") => bundle::run(&root()),
|
||||
@@ -246,30 +255,162 @@ fn has_nextest() -> bool {
|
||||
/// The workspace's unit and integration tests, without examples (clippy still checks those).
|
||||
/// nextest runs each test in its own process, in parallel across all test binaries.
|
||||
fn cmd_test() -> Result<(), String> {
|
||||
test_packages(&["--workspace".to_owned()], "--workspace")
|
||||
}
|
||||
|
||||
/// [`cmd_test`] for the packages `select` picks (`--workspace` or `-p` ids), shown as `shown`.
|
||||
fn test_packages(select: &[String], shown: &str) -> Result<(), String> {
|
||||
const TARGETS: [&str; 3] = ["--lib", "--bins", "--tests"];
|
||||
let mut c = cargo();
|
||||
if has_nextest() {
|
||||
c.args(["nextest", "run", "--workspace"]).args(TARGETS);
|
||||
run(c, "cargo nextest run --workspace --lib --bins --tests")
|
||||
c.args(["nextest", "run"]).args(select).args(TARGETS);
|
||||
run(c, &format!("cargo nextest run {shown} --lib --bins --tests"))
|
||||
} else {
|
||||
eprintln!("note: cargo-nextest is not installed; running cargo test (cargo install cargo-nextest for faster runs)");
|
||||
c.args(["test", "--workspace"]).args(TARGETS);
|
||||
run(c, "cargo test --workspace --lib --bins --tests")
|
||||
c.arg("test").args(select).args(TARGETS);
|
||||
run(c, &format!("cargo test {shown} --lib --bins --tests"))
|
||||
}
|
||||
}
|
||||
|
||||
/// The doctests, which nextest doesn't run.
|
||||
fn cmd_doctests() -> Result<(), String> {
|
||||
let mut c = cargo();
|
||||
c.args(["test", "--workspace", "--doc"]);
|
||||
run(c, "cargo test --workspace --doc")
|
||||
doctest_packages(&["--workspace".to_owned()], "--workspace")
|
||||
}
|
||||
|
||||
/// [`cmd_doctests`] for the packages `select` picks, shown as `shown`.
|
||||
fn doctest_packages(select: &[String], shown: &str) -> Result<(), String> {
|
||||
let mut c = cargo();
|
||||
c.arg("test").args(select).arg("--doc");
|
||||
run(c, &format!("cargo test {shown} --doc"))
|
||||
}
|
||||
|
||||
/// One `cargo xtask ci` step: its name and what it runs.
|
||||
type Step = (&'static str, Box<dyn Fn() -> Result<(), String>>);
|
||||
|
||||
/// The `ci` steps that build and run tests of the whole workspace; `ci shard` runs them per shard.
|
||||
const TEST_STEPS: [&str; 3] = ["test", "doctests", "i18n-report"];
|
||||
|
||||
/// `cargo xtask ci`: each step in turn, stopping at the first that fails; the summary names the
|
||||
/// steps that passed and, after a failure, the one that failed and those skipped.
|
||||
fn cmd_ci() -> Result<(), String> {
|
||||
type Step = (&'static str, Box<dyn Fn() -> Result<(), String>>);
|
||||
let steps: Vec<Step> = vec![
|
||||
run_steps(&ci_steps())
|
||||
}
|
||||
|
||||
/// `cargo xtask ci shard`: shard `GATE_SHARD` of `GATE_SHARDS` (1-based, as the shared gate
|
||||
/// workflow sets them). A test shard runs the shard checks, then the tests and doctests of its
|
||||
/// crates, and the i18n report where it tests vectorcraft-ui-egui. The checks shard runs every
|
||||
/// other `ci` step and the shard checks.
|
||||
fn cmd_ci_shard() -> Result<(), String> {
|
||||
let number = |key: &str| -> Result<usize, String> {
|
||||
let value = std::env::var(key).map_err(|_| format!("ci shard: {key} is not set (the gate workflow sets it)"))?;
|
||||
value.trim().parse().map_err(|_| format!("ci shard: {key} is `{value}`, not a number"))
|
||||
};
|
||||
let (shard, count) = (number("GATE_SHARD")?, number("GATE_SHARDS")?);
|
||||
if count != shards::GROUPS.len() {
|
||||
return Err(format!(
|
||||
"ci shard: GATE_SHARDS is {count}, and xtask/src/shards.rs has {} shards (test-shards in .github/workflows/ci.yml)",
|
||||
shards::GROUPS.len()
|
||||
));
|
||||
}
|
||||
if !(1..=count).contains(&shard) {
|
||||
return Err(format!("ci shard: GATE_SHARD is {shard}, not 1 to {count}"));
|
||||
}
|
||||
let checked = shards::run()?;
|
||||
let mut steps: Vec<Step> = Vec::new();
|
||||
match &checked[shard - 1] {
|
||||
shards::Shard::Tests(crates) => {
|
||||
let names = shards::names(crates);
|
||||
eprintln!("ci shard {shard}/{count}: the tests of {names}");
|
||||
let select = shards::select(crates);
|
||||
let shown = crates.iter().map(|m| format!("-p {}", m.name)).collect::<Vec<_>>().join(" ");
|
||||
let (s, w) = (select.clone(), shown.clone());
|
||||
steps.push(("test", Box::new(move || test_packages(&s, &w))));
|
||||
let (s, w) = (select.clone(), shown.clone());
|
||||
steps.push(("doctests", Box::new(move || doctest_packages(&s, &w))));
|
||||
if crates.iter().any(|m| m.name == "vectorcraft-ui-egui") {
|
||||
steps.push(("i18n-report", Box::new(move || i18n_report_packages(&select, &shown))));
|
||||
}
|
||||
}
|
||||
shards::Shard::Checks => {
|
||||
eprintln!("ci shard {shard}/{count}: the ci steps other than the tests");
|
||||
steps.extend(ci_steps().into_iter().filter(|(name, _)| !TEST_STEPS.contains(name)));
|
||||
}
|
||||
}
|
||||
run_steps(&steps)
|
||||
}
|
||||
|
||||
/// `cargo xtask ci warm`: for each test shard, builds its crates' library and binary tests without
|
||||
/// running them, then builds what the checks shard builds, so one dependency-cache entry holds the
|
||||
/// dependencies of every shard with the features that shard builds them with (cargo resolves
|
||||
/// features over the packages each command selects). The integration tests are left out: they
|
||||
/// build no dependency that the library tests do not, since both take the crate's dev-dependencies.
|
||||
fn cmd_ci_warm() -> Result<(), String> {
|
||||
let checked = shards::run()?;
|
||||
let mut steps: Vec<Step> = Vec::new();
|
||||
for shard in checked {
|
||||
if let shards::Shard::Tests(crates) = shard {
|
||||
steps.push((
|
||||
"build tests",
|
||||
Box::new(move || {
|
||||
let mut c = cargo();
|
||||
c.arg("test").args(shards::select(&crates)).args(["--lib", "--bins", "--no-run"]);
|
||||
run(c, &format!("cargo test --lib --bins --no-run ({})", shards::names(&crates)))
|
||||
}),
|
||||
));
|
||||
}
|
||||
}
|
||||
steps.push((
|
||||
"clippy",
|
||||
Box::new(|| {
|
||||
let mut c = cargo();
|
||||
c.args(["clippy", "--workspace", "--all-targets", "--keep-going"]);
|
||||
run(c, "cargo clippy --workspace --all-targets --keep-going")
|
||||
}),
|
||||
));
|
||||
steps.push((
|
||||
"no-bundled-fonts",
|
||||
Box::new(|| {
|
||||
let mut c = cargo();
|
||||
c.args(["test", "-p", "vectorcraft-text", "--no-default-features", "--test", "without_bundled_fonts", "--no-run"]);
|
||||
run(c, "cargo test -p vectorcraft-text --no-default-features --test without_bundled_fonts --no-run")?;
|
||||
let mut c = cargo();
|
||||
c.args(["clippy", "-p", "vectorcraft-ui-egui", "--no-default-features", "--all-targets"]);
|
||||
run(c, "cargo clippy -p vectorcraft-ui-egui --no-default-features --all-targets")?;
|
||||
let mut c = cargo();
|
||||
c.args(["test", "-p", "vectorcraft-ui-egui", "--no-default-features", "--test", "install_fonts", "--no-run"]);
|
||||
run(c, "cargo test -p vectorcraft-ui-egui --no-default-features --test install_fonts --no-run")
|
||||
}),
|
||||
));
|
||||
steps.push(("wasm", Box::new(cmd_wasm)));
|
||||
run_steps(&steps)
|
||||
}
|
||||
|
||||
/// Runs `steps` in turn, stopping at the first that fails; the summary names the steps that passed
|
||||
/// and, after a failure, the one that failed and those skipped.
|
||||
fn run_steps(steps: &[Step]) -> Result<(), String> {
|
||||
let mut done = Vec::new();
|
||||
for (name, f) in steps {
|
||||
eprintln!("\n=== ci: {name} ===");
|
||||
if let Err(e) = f() {
|
||||
println!("\nCI summary:");
|
||||
for d in &done {
|
||||
println!(" ok {d}");
|
||||
}
|
||||
println!(" FAIL {name}: {e}");
|
||||
for (n, _) in steps.iter().skip(done.len() + 1) {
|
||||
println!(" skip {n}");
|
||||
}
|
||||
return Err(format!("ci failed at `{name}`"));
|
||||
}
|
||||
done.push(*name);
|
||||
}
|
||||
println!("\nCI summary: all {} steps passed ({})", done.len(), done.join(", "));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Every `cargo xtask ci` step, in order.
|
||||
fn ci_steps() -> Vec<Step> {
|
||||
vec![
|
||||
(
|
||||
"fmt",
|
||||
Box::new(|| {
|
||||
@@ -316,25 +457,7 @@ fn cmd_ci() -> Result<(), String> {
|
||||
("ui-commands", Box::new(|| ui_commands::run(&root(), true))),
|
||||
("layers", Box::new(cmd_layers)),
|
||||
("wasm", Box::new(cmd_wasm)),
|
||||
];
|
||||
let mut done = Vec::new();
|
||||
for (name, f) in &steps {
|
||||
eprintln!("\n=== ci: {name} ===");
|
||||
if let Err(e) = f() {
|
||||
println!("\nCI summary:");
|
||||
for d in &done {
|
||||
println!(" ok {d}");
|
||||
}
|
||||
println!(" FAIL {name}: {e}");
|
||||
for (n, _) in steps.iter().skip(done.len() + 1) {
|
||||
println!(" skip {n}");
|
||||
}
|
||||
return Err(format!("ci failed at `{name}`"));
|
||||
}
|
||||
done.push(*name);
|
||||
}
|
||||
println!("\nCI summary: all {} steps passed ({})", done.len(), done.join(", "));
|
||||
Ok(())
|
||||
]
|
||||
}
|
||||
|
||||
fn cmd_corpus(download: bool) -> Result<(), String> {
|
||||
@@ -379,7 +502,12 @@ fn cmd_i18n_report() -> Result<(), String> {
|
||||
/// differently and recompiled for about 3.5 minutes. Every other test binary runs with no test
|
||||
/// matching the filter.
|
||||
fn cmd_ci_i18n_report() -> Result<(), String> {
|
||||
i18n_report_packages(&["--workspace".to_owned()], "--workspace")
|
||||
}
|
||||
|
||||
/// [`cmd_ci_i18n_report`] for the packages `select` picks (a `ci shard`'s), shown as `shown`.
|
||||
fn i18n_report_packages(select: &[String], shown: &str) -> Result<(), String> {
|
||||
let mut c = cargo();
|
||||
c.args(["test", "--workspace", "--lib", "--bins", "--tests", "--", "i18n::tests::untranslated_report", "--exact", "--nocapture"]);
|
||||
run(c, "cargo test --workspace --lib --bins --tests -- i18n::tests::untranslated_report --exact --nocapture")
|
||||
c.arg("test").args(select).args(["--lib", "--bins", "--tests", "--", "i18n::tests::untranslated_report", "--exact", "--nocapture"]);
|
||||
run(c, &format!("cargo test {shown} --lib --bins --tests -- i18n::tests::untranslated_report --exact --nocapture"))
|
||||
}
|
||||
@@ -0,0 +1,294 @@
|
||||
//! The gate's shards (`cargo xtask ci shard`, with `GATE_SHARD` of `GATE_SHARDS` set by the shared
|
||||
//! gate workflow): which workspace crates each shard tests, and the checks that keep the split
|
||||
//! complete.
|
||||
//!
|
||||
//! Each test shard builds and runs the tests of its own crates and what they depend on. The last
|
||||
//! shard runs the `cargo xtask ci` steps that are not tests. [`GROUPS`] names the crates of the
|
||||
//! first shards; every other workspace member goes to the [`Group::Rest`] shard, so a new crate is
|
||||
//! tested without a change here. [`check`] fails when a named crate is not a workspace member or
|
||||
//! is named twice, when a group is empty, and when a crate's features in its shard differ from
|
||||
//! its features in `cargo test --workspace`. Cargo resolves features over the packages a command
|
||||
//! selects, so a feature that only another crate's dev-dependencies turn on is off in a shard
|
||||
//! without that crate, and the tests behind it do not build.
|
||||
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
||||
use serde_json::Value;
|
||||
|
||||
/// What one shard runs.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Group {
|
||||
/// The tests of these workspace crates (package names).
|
||||
Crates(&'static [&'static str]),
|
||||
/// The tests of every workspace member no other group names.
|
||||
Rest,
|
||||
/// The `cargo xtask ci` steps that are not tests.
|
||||
Checks,
|
||||
}
|
||||
|
||||
/// The shards in order; `test-shards` in `.github/workflows/ci.yml` is its length.
|
||||
pub const GROUPS: &[Group] = &[
|
||||
Group::Crates(&["vectorcraft-ui-egui"]),
|
||||
Group::Crates(&["vectorcraft-engine"]),
|
||||
Group::Crates(&["vectorcraft", "vectorcraft-web", "vectorcraft-cli", "vectorcraft-mcp", "xtask"]),
|
||||
Group::Rest,
|
||||
Group::Checks,
|
||||
];
|
||||
|
||||
/// A workspace member, as `cargo metadata` gives it.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Member {
|
||||
pub name: String,
|
||||
/// The package id, which `-p` takes where the name would be ambiguous: craft-libs builds
|
||||
/// against this repo's geom and pathops by git, so the graph holds a second copy of each.
|
||||
pub id: String,
|
||||
pub version: String,
|
||||
}
|
||||
|
||||
/// What one shard runs, with its crates resolved.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Shard {
|
||||
Tests(Vec<Member>),
|
||||
Checks,
|
||||
}
|
||||
|
||||
/// The workspace members of `cargo metadata --no-deps` output, in its order.
|
||||
pub fn members(meta: &Value) -> Result<Vec<Member>, String> {
|
||||
let ids: BTreeSet<&str> = meta["workspace_members"].as_array().into_iter().flatten().filter_map(Value::as_str).collect();
|
||||
let members: Vec<Member> = meta["packages"]
|
||||
.as_array()
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.filter(|p| p["id"].as_str().is_some_and(|id| ids.contains(id)))
|
||||
.map(|p| {
|
||||
let field = |key: &str| p[key].as_str().map(str::to_owned).ok_or_else(|| format!("cargo metadata: a workspace package has no `{key}`"));
|
||||
Ok(Member { name: field("name")?, id: field("id")?, version: field("version")? })
|
||||
})
|
||||
.collect::<Result<_, String>>()?;
|
||||
if members.is_empty() {
|
||||
return Err("cargo metadata lists no workspace members".into());
|
||||
}
|
||||
Ok(members)
|
||||
}
|
||||
|
||||
/// Each group of `groups` with its crates: a named crate must be a workspace member and named
|
||||
/// once, there must be exactly one [`Group::Rest`], and no test shard may be empty.
|
||||
pub fn assign(groups: &[Group], members: &[Member]) -> Result<Vec<Shard>, String> {
|
||||
const WHERE: &str = "xtask/src/shards.rs › GROUPS";
|
||||
let mut named: BTreeMap<&str, usize> = BTreeMap::new();
|
||||
for (i, g) in groups.iter().enumerate() {
|
||||
if let Group::Crates(names) = g {
|
||||
if names.is_empty() {
|
||||
return Err(format!("shard {} names no crates ({WHERE})", i + 1));
|
||||
}
|
||||
for name in *names {
|
||||
if !members.iter().any(|m| m.name == *name) {
|
||||
return Err(format!("shard {} names `{name}`, which is not a workspace member ({WHERE})", i + 1));
|
||||
}
|
||||
if let Some(first) = named.insert(name, i) {
|
||||
return Err(format!("`{name}` is in shard {} and shard {} ({WHERE})", first + 1, i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let rests = groups.iter().filter(|g| **g == Group::Rest).count();
|
||||
if rests != 1 {
|
||||
return Err(format!("{rests} shards take the remaining crates, not 1 ({WHERE})"));
|
||||
}
|
||||
let pick = |f: &dyn Fn(&Member) -> bool| members.iter().filter(|m| f(m)).cloned().collect::<Vec<_>>();
|
||||
groups
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, g)| match g {
|
||||
Group::Crates(names) => Ok(Shard::Tests(pick(&|m| names.contains(&m.name.as_str())))),
|
||||
Group::Rest => {
|
||||
let rest = pick(&|m| !named.contains_key(m.name.as_str()));
|
||||
if rest.is_empty() {
|
||||
return Err(format!("shard {} takes the remaining crates, and there are none ({WHERE})", i + 1));
|
||||
}
|
||||
Ok(Shard::Tests(rest))
|
||||
}
|
||||
Group::Checks => Ok(Shard::Checks),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// The features `cargo tree -e normal,dev,build --prefix none -f '{p}|{f}'` shows for each of
|
||||
/// `members`, by name; a crate the tree holds twice (once for the host, say) has two entries.
|
||||
/// Other copies of a member's name (craft-libs' git copies of geom and pathops) are not members.
|
||||
pub fn tree_features(tree: &str, members: &[Member]) -> BTreeMap<String, BTreeSet<String>> {
|
||||
let mut found: BTreeMap<String, BTreeSet<String>> = BTreeMap::new();
|
||||
for line in tree.lines() {
|
||||
let line = line.trim_end();
|
||||
let line = line.strip_suffix(" (*)").unwrap_or(line);
|
||||
let Some((package, features)) = line.split_once('|') else { continue };
|
||||
let Some(m) =
|
||||
members.iter().find(|m| package.strip_prefix(&format!("{} v{} (", m.name, m.version)).is_some_and(|source| !source.contains("://")))
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
let mut features: Vec<&str> = features.split(',').map(str::trim).filter(|f| !f.is_empty()).collect();
|
||||
features.sort_unstable();
|
||||
found.entry(m.name.clone()).or_default().insert(features.join(","));
|
||||
}
|
||||
found
|
||||
}
|
||||
|
||||
/// One line for each crate of `shard` whose features in `alone` (the shard's tree) differ from
|
||||
/// `workspace` (the whole workspace's tree).
|
||||
pub fn feature_differences(
|
||||
shard: usize,
|
||||
crates: &[Member],
|
||||
workspace: &BTreeMap<String, BTreeSet<String>>,
|
||||
alone: &BTreeMap<String, BTreeSet<String>>,
|
||||
) -> Vec<String> {
|
||||
let show = |set: Option<&BTreeSet<String>>| match set {
|
||||
None => "absent".to_owned(),
|
||||
Some(set) => set.iter().map(|f| format!("[{f}]")).collect::<Vec<_>>().join(" "),
|
||||
};
|
||||
crates
|
||||
.iter()
|
||||
.filter(|m| workspace.get(&m.name) != alone.get(&m.name))
|
||||
.map(|m| {
|
||||
format!("{}: features {} in shard {shard}, {} with the whole workspace", m.name, show(alone.get(&m.name)), show(workspace.get(&m.name)))
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// `cargo tree` with the features of each package, for `select` (`--workspace` or `-p` ids).
|
||||
fn tree(select: &[String]) -> Result<String, String> {
|
||||
let mut c = crate::cargo();
|
||||
// Without `--color never`, CARGO_TERM_COLOR=always (as the gate sets it) colors the ` (*)` marks.
|
||||
c.args(["tree", "--color", "never", "-e", "normal,dev,build", "--prefix", "none", "-f", "{p}|{f}"]).args(select);
|
||||
let out = c.output().map_err(|e| format!("cargo tree: failed to spawn: {e}"))?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("cargo tree {}: exited with {}:\n{}", select.join(" "), out.status, String::from_utf8_lossy(&out.stderr)));
|
||||
}
|
||||
Ok(String::from_utf8_lossy(&out.stdout).into_owned())
|
||||
}
|
||||
|
||||
/// `-p <id>` for each crate.
|
||||
pub fn select(crates: &[Member]) -> Vec<String> {
|
||||
crates.iter().flat_map(|m| ["-p".to_owned(), m.id.clone()]).collect()
|
||||
}
|
||||
|
||||
/// The package names of `crates`, for messages.
|
||||
pub fn names(crates: &[Member]) -> String {
|
||||
crates.iter().map(|m| m.name.as_str()).collect::<Vec<_>>().join(", ")
|
||||
}
|
||||
|
||||
/// The shards of this workspace, after the checks in [`assign`] and [`feature_differences`].
|
||||
pub fn check() -> Result<Vec<Shard>, String> {
|
||||
let members = members(&crate::metadata()?)?;
|
||||
let shards = assign(GROUPS, &members)?;
|
||||
let workspace = tree_features(&tree(&["--workspace".to_owned()])?, &members);
|
||||
let mut differences = Vec::new();
|
||||
for (i, shard) in shards.iter().enumerate() {
|
||||
if let Shard::Tests(crates) = shard {
|
||||
let alone = tree_features(&tree(&select(crates))?, &members);
|
||||
differences.extend(feature_differences(i + 1, crates, &workspace, &alone));
|
||||
}
|
||||
}
|
||||
if !differences.is_empty() {
|
||||
return Err(format!(
|
||||
"{} crate(s) build with other features in their shard than in `cargo test --workspace`, so some of their tests \
|
||||
would build differently or not at all (turn the feature on in the crate's own dev-dependencies, or move the crate \
|
||||
to the shard of the crate that turns it on):\n {}",
|
||||
differences.len(),
|
||||
differences.join("\n ")
|
||||
));
|
||||
}
|
||||
Ok(shards)
|
||||
}
|
||||
|
||||
/// `cargo xtask shards`: prints each shard's crates after [`check`], and returns the shards.
|
||||
pub fn run() -> Result<Vec<Shard>, String> {
|
||||
let shards = check()?;
|
||||
for (i, shard) in shards.iter().enumerate() {
|
||||
match shard {
|
||||
Shard::Tests(crates) => println!("shard {}/{}: tests of {} crate(s): {}", i + 1, shards.len(), crates.len(), names(crates)),
|
||||
Shard::Checks => println!("shard {}/{}: the other ci steps", i + 1, shards.len()),
|
||||
}
|
||||
}
|
||||
println!("OK: every workspace member is tested on one shard, with the features `cargo test --workspace` gives it.");
|
||||
Ok(shards)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
fn m(name: &str) -> Member {
|
||||
Member { name: name.into(), id: format!("path+file:///w/{name}#0.1.0"), version: "0.1.0".into() }
|
||||
}
|
||||
|
||||
fn crates(shard: &Shard) -> Vec<&str> {
|
||||
match shard {
|
||||
Shard::Tests(c) => c.iter().map(|m| m.name.as_str()).collect(),
|
||||
Shard::Checks => Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_rest_shard_takes_every_crate_no_group_names() {
|
||||
let ws = [m("a"), m("b"), m("c"), m("d")];
|
||||
let shards = assign(&[Group::Crates(&["c"]), Group::Rest, Group::Checks], &ws).unwrap();
|
||||
assert_eq!(shards.iter().map(crates).collect::<Vec<_>>(), [vec!["c"], vec!["a", "b", "d"], vec![]]);
|
||||
assert_eq!(shards[2], Shard::Checks);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_crate_named_twice_or_unknown_fails() {
|
||||
let ws = [m("a"), m("b")];
|
||||
let twice = assign(&[Group::Crates(&["a"]), Group::Crates(&["a"]), Group::Rest], &ws).unwrap_err();
|
||||
assert!(twice.contains("`a` is in shard 1 and shard 2"), "{twice}");
|
||||
let unknown = assign(&[Group::Crates(&["z"]), Group::Rest], &ws).unwrap_err();
|
||||
assert!(unknown.contains("`z`, which is not a workspace member"), "{unknown}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn empty_groups_and_a_missing_or_second_rest_fail() {
|
||||
let ws = [m("a"), m("b")];
|
||||
assert!(assign(&[Group::Crates(&[]), Group::Rest], &ws).unwrap_err().contains("names no crates"));
|
||||
assert!(assign(&[Group::Crates(&["a", "b"]), Group::Rest], &ws).unwrap_err().contains("there are none"));
|
||||
assert!(assign(&[Group::Crates(&["a"])], &ws).unwrap_err().contains("0 shards take the remaining crates"));
|
||||
assert!(assign(&[Group::Rest, Group::Rest], &ws).unwrap_err().contains("2 shards take the remaining crates"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_workspace_member_is_tested_on_exactly_one_shard() {
|
||||
let ws = members(&crate::metadata().unwrap()).unwrap();
|
||||
let shards = assign(GROUPS, &ws).unwrap();
|
||||
let mut tested: Vec<&str> = shards.iter().flat_map(crates).collect();
|
||||
tested.sort_unstable();
|
||||
let mut all: Vec<&str> = ws.iter().map(|m| m.name.as_str()).collect();
|
||||
all.sort_unstable();
|
||||
assert_eq!(tested, all);
|
||||
assert_eq!(shards.iter().filter(|s| **s == Shard::Checks).count(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_feature_only_another_shard_turns_on_is_a_difference() {
|
||||
let ws = [m("lib"), m("geom")];
|
||||
let workspace = "\
|
||||
lib v0.1.0 (/w/lib)|default,synth
|
||||
geom v0.1.0 (/w/geom)|
|
||||
geom v0.18.0 (https://github.com/x/y?rev=1#1)|old
|
||||
lib v0.1.0 (/w/lib)|default,synth (*)
|
||||
";
|
||||
let alone = "\
|
||||
lib v0.1.0 (/w/lib)|default
|
||||
geom v0.1.0 (/w/geom)|
|
||||
";
|
||||
let workspace = tree_features(workspace, &ws);
|
||||
assert_eq!(workspace["lib"], BTreeSet::from(["default,synth".to_owned()]));
|
||||
assert_eq!(workspace["geom"], BTreeSet::from([String::new()]));
|
||||
let alone = tree_features(alone, &ws);
|
||||
assert_eq!(feature_differences(4, &ws, &workspace, &alone), ["lib: features [default] in shard 4, [default,synth] with the whole workspace"]);
|
||||
assert!(feature_differences(4, &ws, &workspace, &workspace).is_empty());
|
||||
assert_eq!(
|
||||
feature_differences(4, &[m("lib")], &workspace, &BTreeMap::new()),
|
||||
["lib: features absent in shard 4, [default,synth] with the whole workspace"]
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user