From 5f0d31061440558bafeeca845941701fbf2790e8 Mon Sep 17 00:00:00 2001 From: jmverges Date: Thu, 12 Nov 2026 07:27:56 +0000 Subject: [PATCH 01/15] .ai import: type in an envelope is also tried mapped from the box of what it paints (#6824) With Envelope Options > Distort Appearance on, the import tries type in an envelope mapped from its glyphs, and from its glyphs grown by half its strokes' weight (#6535), on its own warp and on its saved grid. In users' files the drawn art of some stroked type maps from the box of what the type paints instead, which differs from those where: - the type has sharp corners at its edges (slanted stems, pointed feet) and miter joins: the miter tip pokes out past half the weight, as far as the miter limit lets it, though not as far as the bounds with strokes allow (a miter at every corner); - a stroke carries a Transform effect that moves it (a drop shadow): the moved stroke paints past the glyphs on that side; - a glyph holds a contour of zero length at its edge, which paints nothing: the glyphs' box counts it. Such an envelope failed the drawn-art check and kept its drawn art. After every way it was tried before, and before a grid moved onto its drawn art, the envelope is now also tried mapped from what its type paints, where that box is another: its glyph outlines with their fills and strokes baked as the envelope bakes them under Distort Appearance (geometry effects applied), each piece measured by its visual bounds. Those are exact for miter joins (a tip counts where the limit keeps it) and round joins, and an upper bound for bevel joins, miters the limit cuts, width profiles and square-capped dashes. Effects on the type object itself are left out, as VectorCraft applies them after the envelope bends the type. Groups round type and other objects in the contents are measured as before. A side within 1e-4 pt of another box's counts as that side, so a box measured two ways isn't tried twice. The box is measured only when its try comes and a check is left for it, and once for an envelope: on a synthetic file of 256 envelopes of 2,000 characters each the import takes 13.3 s, as before, where measuring it up front took 14.7 s. On 224 of our own files (used locally, never committed), envelopes of type that open live go from 154 in 45 files to 161 in 50, none fewer in any file; no file changes whether it opens from its layers or its PDF part. Tests: ai::envelope::tests:: mitred_type_is_also_tried_mapped_from_what_its_stroke_paints_miter_tips_included, type_with_a_mitred_character_stroke_is_also_tried_mapped_from_what_it_paints, a_stroke_moved_by_a_transform_effect_counts_where_it_paints, round_joined_type_is_not_tried_twice_for_the_same_box, a_contour_of_zero_length_paints_nothing, a_side_within_the_slack_of_the_geometric_box_is_that_side, and tests_native::a_warp_of_mitred_type_maps_from_what_its_stroke_paints_where_its_drawn_art_does. Co-Authored-By: Claude Opus 5.5 --- crates/eps/src/import/ai/envelope.rs | 326 +++++++++++++++++++++++++- crates/eps/src/import/tests_native.rs | 78 ++++++ docs/file-format-parity.md | 3 +- docs/target-app-parity.md | 5 +- 4 files changed, 396 insertions(+), 16 deletions(-) diff --git a/crates/eps/src/import/ai/envelope.rs b/crates/eps/src/import/ai/envelope.rs index 8b3fceecf3..d117dc83c6 100644 --- a/crates/eps/src/import/ai/envelope.rs +++ b/crates/eps/src/import/ai/envelope.rs @@ -189,6 +189,111 @@ fn with_strokes(kind: &NodeKind) -> Option { Some(kind) } +/// How far, in points, the sides of two boxes may lie apart and still count as the same side: the +/// glyphs' box (from type's ink) and the box of what type paints (from its outlines) measure one +/// outline two ways, and where they meet they differ by rounding only ([`painted_margin`], +/// [`same_box`]). +const PAINTED_SLACK: f64 = 1e-4; + +/// The box of what the pieces of type's outlines `outlines` ([`vectorcraft_effects::outline_text`]) +/// paint as an envelope with Distort Appearance bends them: each piece baked as the envelope bakes +/// it ([`vectorcraft_effects::bake_type_appearance`]: geometry effects on its fills and strokes +/// applied, so a stroke a Transform effect moves counts where it is moved to), measured by its +/// visual bounds. Those are exact for miter joins (a tip counts where the miter limit keeps it) and +/// round joins, and an upper bound for bevel joins, miters the limit cuts, width profiles and +/// square-capped dashes; a contour of zero length, which paints nothing, doesn't count. Effects on +/// the type object itself are left out: VectorCraft applies them after the envelope bends the type. +/// `None` when nothing in it has bounds. +fn painted_outlines(outlines: &Node) -> Option { + outlines.children().into_iter().flatten().fold(None, |acc, piece| { + let baked = vectorcraft_effects::bake_type_appearance(None, piece); + vectorcraft_geom::union_opt(acc, baked.as_ref().unwrap_or(piece).visual_bounds()) + }) +} + +/// The box of `content` an envelope of type with Distort Appearance may map from in a file besides +/// [`half_stroked_box`]: what it paints, type by its outlines ([`painted_outlines`]), groups by +/// their members grown by as far as their own strokes paint along a side, other objects by their +/// bounds with strokes. `None` when nothing in it has bounds. +fn painted_box(content: &[Arc]) -> Option { + fn walk(n: &Arc, acc: Option) -> Option { + match &n.kind { + NodeKind::Text(_) => vectorcraft_geom::union_opt(acc, vectorcraft_effects::outline_text(n).as_ref().and_then(painted_outlines)), + NodeKind::Group { children, clip: false } => { + let along = n.appearance.painted_strokes().map(|s| s.side_reach(true)).fold(0.0, f64::max); + let members = children.iter().fold(None, |acc, c| walk(c, acc)); + let grown = |r: Rect| if along.is_finite() && along > 0.0 { r.inflate(along, along) } else { r }; + vectorcraft_geom::union_opt(acc, members.map(grown)) + } + _ => vectorcraft_geom::union_opt(acc, envelope_content_boxes(std::slice::from_ref(n), Affine::IDENTITY).map(|(stroked, _)| stroked)), + } + } + content.iter().fold(None, |acc, c| walk(c, acc)) +} + +/// The bounds margin of `painted`, the box of what contents with geometric box `plain` paint, a side +/// within [`PAINTED_SLACK`] of the geometric box's counting as that side. `None` where it lies +/// inside the geometric box on a side, where it is that box, and for margins that don't fit. +fn painted_margin(painted: Rect, plain: Rect) -> Option<[f32; 4]> { + let side = |p: f64, g: f64| if (p - g).abs() <= PAINTED_SLACK { g } else { p }; + let painted = Rect::new(side(painted.x0, plain.x0), side(painted.y0, plain.y0), side(painted.x1, plain.x1), side(painted.y1, plain.y1)); + let margin = envelope_stroke_margin(painted, plain)?; + (margin.iter().all(|m| *m >= 0.0) && margin.iter().any(|m| *m > 0.0)).then_some(margin) +} + +/// Do bounds margins `a` and `b` give contents with geometric box `plain` the same box, each side +/// within [`PAINTED_SLACK`]? +fn same_box(a: [f32; 4], b: [f32; 4], plain: Rect) -> bool { + let sizes = [plain.height(), plain.height(), plain.width(), plain.width()]; + a.iter().zip(b).zip(sizes).all(|((a, b), size)| (f64::from(*a) - f64::from(b)).abs() * size <= PAINTED_SLACK) +} + +/// What the contents of an envelope of type paint ([`painted_box`]): their geometric box and the +/// bounds margin of what they paint from it. +#[derive(Clone, Copy)] +struct Painted { + plain: Rect, + margin: [f32; 4], +} + +/// [`Painted`] for envelope `kind` with Distort Appearance; `None` without it, and where +/// [`painted_margin`] gives none. +fn painted_of(kind: &NodeKind) -> Option { + let NodeKind::Envelope { content, options, .. } = kind else { return None }; + if !options.distort_appearance { + return None; + } + let (_, plain) = envelope_content_boxes(content, Affine::IDENTITY)?; + Some(Painted { plain, margin: painted_margin(painted_box(content)?, plain)? }) +} + +/// Envelope `kind` mapping from what its contents paint (`painted`, [`painted_of`]), for an +/// envelope with Distort Appearance where that box is neither the one it maps from already nor its +/// contents' glyphs grown by half their strokes' weight ([`with_strokes`]); `None` otherwise. +fn as_painted(kind: &NodeKind, painted: &Painted) -> Option { + let NodeKind::Envelope { options, .. } = kind else { return None }; + let half = match with_strokes(kind) { + Some(NodeKind::Envelope { options, .. }) => Some(options.bounds_margin), + _ => None, + }; + let Painted { plain, margin } = *painted; + if !options.distort_appearance || same_box(margin, options.bounds_margin, plain) || half.is_some_and(|h| same_box(margin, h, plain)) { + return None; + } + let mut kind = kind.clone(); + if let NodeKind::Envelope { options, .. } = &mut kind { + options.bounds_margin = margin; + } + Some(kind) +} + +/// A way an envelope of type is tried: a kind, or a kind mapping from what its type paints +/// ([`as_painted`]), worked out when its turn comes. +enum Way { + As(NodeKind), + Painted(NodeKind), +} + /// The kind of `envelope`, a mesh or a top object in Edit Contents, with its grid moved onto /// `drawn`, the drawn art the file saves for it, where what it draws is as large as that art (within /// [`MOVED_SLACK`]) but lies elsewhere (further than that): moved by as far as the drawn art's box @@ -592,7 +697,8 @@ impl WarpedType { /// for it ([`live_on_saved_grid`]), which opens in its place where it does: its type stays /// editable in that shape, and the warp's style and bend are lost. With Distort Appearance, each /// is also checked mapping from its type's glyphs grown by half their strokes' weight - /// ([`with_strokes`]). In Edit Contents, a mesh or top object whose grid draws the type + /// ([`with_strokes`]) and, after all of those, from what its type paints where that is another + /// box ([`as_painted`]). In Edit Contents, a mesh or top object whose grid draws the type /// elsewhere than its drawn art is checked last moved onto that art ([`moved_onto`]). Each /// check uses one of the import's checks and, for an envelope that shows, adds to what the page /// check allows ([`drawn_alike`]). Elsewhere, and where the type is set in a font that isn't @@ -659,17 +765,16 @@ impl WarpedType { // With Distort Appearance, a file's envelope may map its type from its glyphs grown by half // their strokes' weight or from the glyphs alone, and for type the size the file saves for // that box is often out of date (not the size of the type there now): each is checked. - let kinds: Vec = live(&obj, before, inner) - .into_iter() - .chain(on_grid) - .flat_map(|k| { - let stroked = with_strokes(&k); - std::iter::once(k).chain(stroked) - }) - .collect(); + // After all of those, each is checked mapping from what its type paints, where that box is + // another: it is measured only when such a check comes and one is left. + let kinds: Vec = live(&obj, before, inner).into_iter().chain(on_grid).collect(); if kinds.is_empty() { return Err(TypeKept::Read); } + let mut ways: Vec = kinds.iter().flat_map(|k| std::iter::once(Way::As(k.clone())).chain(with_strokes(k).map(Way::As))).collect(); + ways.extend(kinds.into_iter().map(Way::Painted)); + // What the type paints, measured once: the kinds share their contents. + let mut painted: Option> = None; let (id, layer) = (doc.alloc_id(), doc.alloc_id()); let mut plain = art.clone(); (plain.visible, plain.opacity) = (true, 1.0); @@ -677,9 +782,9 @@ impl WarpedType { let mut alike = None; // In Edit Contents, a grid that draws the type elsewhere than its drawn art is tried again // moved onto that art ([`moved_onto`]), after every other way. - let (mut tries, mut moved, mut again, mut i) = (kinds.into_iter(), vec![], false, 0); + let (mut tries, mut moved, mut again, mut i) = (ways.into_iter(), vec![], false, 0); loop { - let Some(kind) = tries.next() else { + let Some(way) = tries.next() else { if again || moved.is_empty() { break; } @@ -692,6 +797,13 @@ impl WarpedType { if self.checks == 0 || (i > 0 && self.checks <= waiting + self.looks.len()) { return Err(TypeKept::Budget); } + let kind = match way { + Way::As(kind) => kind, + Way::Painted(base) => match painted.get_or_insert_with(|| painted_of(&base)).as_ref().and_then(|p| as_painted(&base, p)) { + Some(kind) => kind, + None => continue, + }, + }; self.checks -= 1; i += 1; let mut envelope = art.clone(); @@ -704,7 +816,7 @@ impl WarpedType { break; } if !again && let Some(kind) = moved_onto(&live_one, &plain) { - moved.push(kind); + moved.push(Way::As(kind)); } } let envelope = alike.ok_or(TypeKept::Differs)?; @@ -866,7 +978,7 @@ fn alike_within(live: &Node, drawn: &Node, reach: Option, layer: NodeId, s mod tests { use super::*; use vectorcraft_color::{Color, Paint}; - use vectorcraft_doc::{AppearanceItem, CharStyle, LineJoin, StrokeLayer, TextObject}; + use vectorcraft_doc::{AppearanceItem, CharStyle, LineCap, LineJoin, StrokeLayer, TextObject}; /// An envelope of `content` with Distort Appearance, on a flat one-patch mesh. fn envelope_of(content: Vec>) -> NodeKind { @@ -948,4 +1060,192 @@ mod tests { let (_, glyphs) = envelope_content_boxes(&content, Affine::IDENTITY).unwrap(); assert_eq!(stroked_margin(content), envelope_stroke_margin(glyphs.inflate(2.0, 2.0), glyphs)); } + + /// Is the font type takes by default installed? Type that must draw as itself is tested only + /// where it is: the tests below measure its glyphs. + fn default_font() -> bool { + vectorcraft_text::FontDb::global().has_family(&CharStyle::default().font_family) + } + + /// The bounds margin of the candidate mapping from what `content` paints, for an envelope of it, + /// type measured by its glyphs as the import measures it; `None` where there is none. + fn painted_candidate(content: Vec>) -> Option<[f32; 4]> { + vectorcraft_text::register_envelope_ink(); + let kind = envelope_of(content); + match as_painted(&kind, &painted_of(&kind)?) { + Some(NodeKind::Envelope { options, .. }) => Some(options.bounds_margin), + _ => None, + } + } + + /// The box contents with geometric box `plain` map from with bounds margin `m`. + fn box_of(m: [f32; 4], plain: Rect) -> Rect { + let [top, bottom, left, right] = m.map(f64::from); + Rect::new( + plain.x0 - left * plain.width(), + plain.y0 - top * plain.height(), + plain.x1 + right * plain.width(), + plain.y1 + bottom * plain.height(), + ) + } + + /// Are the sides of `a` and `b` within `tol` of each other? + fn close(a: Rect, b: Rect, tol: f64) -> bool { + [a.x0 - b.x0, a.y0 - b.y0, a.x1 - b.x1, a.y1 - b.y1].iter().all(|d| d.abs() <= tol) + } + + /// The geometric box of `content`, type measured by its glyphs as the import measures it. + fn glyphs_of(content: &[Arc]) -> (Rect, Rect) { + vectorcraft_text::register_envelope_ink(); + envelope_content_boxes(content, Affine::IDENTITY).unwrap() + } + + /// What the type in `content` paints, measured apart from the import's own measure: each piece + /// of its outlines filled, and outlined by kurbo's stroker with each of its strokes' weight, + /// join and miter limit. + fn stroked_by_kurbo(content: &[Arc]) -> Rect { + use kurbo::Shape; + let mut out: Option = None; + for n in content { + let outlines = vectorcraft_effects::outline_text(n).unwrap(); + for piece in outlines.children().unwrap() { + let bp = piece.stroke_path().unwrap(); + out = vectorcraft_geom::union_opt(out, Some(bp.bounding_box())); + for s in piece.appearance.painted_strokes() { + let join = match s.join { + LineJoin::Miter => kurbo::Join::Miter, + LineJoin::Round => kurbo::Join::Round, + LineJoin::Bevel => kurbo::Join::Bevel, + }; + let stroke = kurbo::Stroke::new(s.width).with_join(join).with_miter_limit(s.miter_limit); + let outline = kurbo::stroke(bp.iter(), &stroke, &kurbo::StrokeOpts::default(), 1e-4); + out = vectorcraft_geom::union_opt(out, Some(outline.bounding_box())); + } + } + } + out.unwrap() + } + + /// Type with Distort Appearance and a stroke with miter joins on its appearance is also tried + /// mapped from what that stroke paints: past half its weight where a miter tip pokes out at a + /// sharp corner (the feet of the A's), though not as far as its bounds with strokes, which allow + /// for a miter as long as the limit lets one be at every corner. + #[test] + fn mitred_type_is_also_tried_mapped_from_what_its_stroke_paints_miter_tips_included() { + if !default_font() { + return; + } + let mut text = type_node(1, CharStyle::default()); + let mut appearance = (*text.appearance).clone(); + appearance.items.push(AppearanceItem::Stroke(mitred())); + text.appearance = appearance.into(); + let content = vec![Arc::new(text)]; + let (with, glyphs) = glyphs_of(&content); + let (half, painted) = (glyphs.inflate(2.0, 2.0), stroked_by_kurbo(&content)); + assert!(painted.x0 < half.x0 - 0.5 && painted.x1 > half.x1 + 0.5, "{painted:?} {half:?}"); + assert!(painted.width() < with.width() - 0.5, "{painted:?} {with:?}"); + let from = box_of(painted_candidate(content).unwrap(), glyphs); + assert!(close(from, painted, 0.01), "{from:?} {painted:?}"); + } + + /// Type stroked by its characters with miter joins is also tried mapped from what those strokes + /// paint, turned and stretched as well as upright. + #[test] + fn type_with_a_mitred_character_stroke_is_also_tried_mapped_from_what_it_paints() { + if !default_font() { + return; + } + let style = CharStyle { stroke: Paint::solid(Color::BLACK), stroke_width: 4.0, stroke_join: LineJoin::Miter, ..CharStyle::default() }; + for xf in [ + Affine::IDENTITY, + Affine::rotate(std::f64::consts::FRAC_PI_4), + Affine::scale_non_uniform(std::f64::consts::SQRT_2, std::f64::consts::FRAC_1_SQRT_2), + ] { + let mut text = type_node(1, style.clone()); + if let NodeKind::Text(t) = &mut text.kind { + t.xf = xf * t.xf; + } + let content = vec![Arc::new(text)]; + let (_, glyphs) = glyphs_of(&content); + let painted = stroked_by_kurbo(&content); + let from = box_of(painted_candidate(content).unwrap(), glyphs); + assert!(close(from, painted, 0.01), "{xf:?}: {from:?} {painted:?}"); + } + } + + /// A stroke that a Transform effect moves paints where it is moved to: type filled over its + /// glyphs with a round 4 point stroke moved 10 points down is also tried mapped from its glyphs + /// grown by 2 points on the left and right and 12 at the bottom, and not at the top. + #[test] + fn a_stroke_moved_by_a_transform_effect_counts_where_it_paints() { + if !default_font() { + return; + } + let mut text = type_node(1, CharStyle::default()); + let mut stroke = StrokeLayer::new(Paint::solid(Color::BLACK), 4.0); + (stroke.join, stroke.cap) = (LineJoin::Round, LineCap::Round); + stroke.effects.push(Effect { id: "distort.transform".into(), params: serde_json::json!({ "moveV": 10.0 }), visible: true }); + let mut appearance = (*text.appearance).clone(); + appearance.items.push(AppearanceItem::Stroke(stroke)); + text.appearance = appearance.into(); + let content = vec![Arc::new(text)]; + let (_, glyphs) = glyphs_of(&content); + let painted = Rect::new(glyphs.x0 - 2.0, glyphs.y0, glyphs.x1 + 2.0, glyphs.y1 + 12.0); + let from = box_of(painted_candidate(content).unwrap(), glyphs); + assert!(close(from, painted, 0.01), "{from:?} {painted:?}"); + } + + /// Type whose round-joined stroke paints half its weight past its glyphs everywhere is not tried + /// a second time mapped from what it paints: that is the box of its glyphs grown by half the + /// weight, already tried. + #[test] + fn round_joined_type_is_not_tried_twice_for_the_same_box() { + if !default_font() { + return; + } + let style = CharStyle { stroke: Paint::solid(Color::BLACK), stroke_width: 4.0, stroke_join: LineJoin::Round, ..CharStyle::default() }; + let content = vec![Arc::new(type_node(1, style))]; + vectorcraft_text::register_envelope_ink(); + assert!(with_strokes(&envelope_of(content.clone())).is_some()); + assert_eq!(painted_candidate(content), None); + } + + /// A contour of zero length paints nothing, so it isn't part of what type's outlines paint: a + /// filled square with a round 2 point stroke and such a contour 5 points above it paints the + /// square grown by 1 point. + #[test] + fn a_contour_of_zero_length_paints_nothing() { + let mut bp = BezPath::new(); + bp.move_to((10.0, 10.0)); + bp.line_to((20.0, 10.0)); + bp.line_to((20.0, 20.0)); + bp.line_to((10.0, 20.0)); + bp.close_path(); + bp.move_to((15.0, 5.0)); + bp.line_to((15.0, 5.0)); + bp.close_path(); + let mut stroke = StrokeLayer::new(Paint::solid(Color::BLACK), 2.0); + (stroke.join, stroke.cap) = (LineJoin::Round, LineCap::Round); + let mut appearance = Appearance::default(); + appearance.items.push(AppearanceItem::Fill(vectorcraft_doc::FillLayer::new(Paint::solid(Color::BLACK)))); + appearance.items.push(AppearanceItem::Stroke(stroke)); + let piece = Node::path(NodeId(1), PathData::from_bezpath(&bp), appearance); + let outlines = Node::group(NodeId(2), vec![Arc::new(piece)]); + assert_eq!(painted_outlines(&outlines), Some(Rect::new(9.0, 9.0, 21.0, 21.0))); + } + + /// A side of what contents paint within a ten-thousandth of a point of their geometric box's is + /// that side, inside it or out: the two boxes measure the same outline two ways. Further inside, + /// there is no box; further out, it counts. + #[test] + fn a_side_within_the_slack_of_the_geometric_box_is_that_side() { + let plain = Rect::new(10.0, 20.0, 110.0, 70.0); + let painted = Rect::new(8.0, 20.0 + 1e-9, 112.0, 72.0); + assert_eq!(painted_margin(painted, plain), Some([0.0, 0.04, 0.02, 0.02])); + assert_eq!(painted_margin(Rect::new(8.0, 20.001, 112.0, 72.0), plain), None); + assert_eq!(painted_margin(plain, plain), None); + let half = [0.04_f32, 0.04, 0.02, 0.02]; + assert!(same_box(half, [0.04 + 1e-7, 0.04, 0.02, 0.02], plain)); + assert!(!same_box(half, [0.041, 0.04, 0.02, 0.02], plain)); + } } diff --git a/crates/eps/src/import/tests_native.rs b/crates/eps/src/import/tests_native.rs index 8f64280367..dcce2d1f91 100644 --- a/crates/eps/src/import/tests_native.rs +++ b/crates/eps/src/import/tests_native.rs @@ -5834,6 +5834,84 @@ fn a_warp_of_stroked_type_maps_from_its_bounds_with_strokes_where_its_drawn_art_ assert_eq!(margin, Some(options.bounds_margin)); } +/// What the type in `content` paints, measured apart from the import: each piece of its outlines +/// filled, and outlined by kurbo's stroker with each of its strokes' weight, join and miter limit. +fn painted_by_kurbo(content: &[std::sync::Arc]) -> kurbo::Rect { + use kurbo::Shape; + let mut out: Option = None; + for n in content { + let outlines = vectorcraft_effects::outline_text(n).unwrap(); + for piece in outlines.children().unwrap() { + let bp = piece.stroke_path().unwrap(); + out = vectorcraft_geom::union_opt(out, Some(bp.bounding_box())); + for s in piece.appearance.painted_strokes() { + let join = match s.join { + vectorcraft_doc::LineJoin::Miter => kurbo::Join::Miter, + vectorcraft_doc::LineJoin::Round => kurbo::Join::Round, + vectorcraft_doc::LineJoin::Bevel => kurbo::Join::Bevel, + }; + let stroke = kurbo::Stroke::new(s.width).with_join(join).with_miter_limit(s.miter_limit); + let outline = kurbo::stroke(bp.iter(), &stroke, &kurbo::StrokeOpts::default(), 1e-4); + out = vectorcraft_geom::union_opt(out, Some(outline.bounding_box())); + } + } + } + out.unwrap() +} + +/// A warp of type stroked with miter joins, Distort Appearance on, whose drawn art maps the type from +/// what it paints, the miter tips at the sharp corners of its X past half the stroke's weight +/// included, as users' files map some such type, opens live as a mesh envelope on its saved grid +/// mapping from that box, where its glyphs grown by half the weight don't draw as that art (#6824). +#[test] +fn a_warp_of_mitred_type_maps_from_what_its_stroke_paints_where_its_drawn_art_does() { + use vectorcraft_doc::live::{envelope_content_boxes, envelope_stroke_margin}; + let Some(family) = installed_family() else { return }; + // "FLUX" stroked 4 points wide in black, with miter joins at a limit of 10. + let stroked = "/53 << /99 /CAITextPaint /0 << /0 2 /1 [ 1.0 0.0 1.0 0.0 0.0 ] >> >> /54 << /99 /CAITextPaint /0 << /0 2 /1 [ 1.0 0.0 0.0 0.0 1.0 ] >> >> /57 true /62 0 /63 4.0 /64 10.0"; + let doc = type_envelope_text(&family, None).replace("/53 << /99 /CAITextPaint /0 << /0 2 /1 [ 1.0 0.0 1.0 0.0 0.0 ] >> >>", stroked); + let mut text = made_envelope_type(&doc); + text.visible = true; + assert!( + matches!(&text.kind, NodeKind::Text(t) if t.runs[0].style.stroke_join == vectorcraft_doc::LineJoin::Miter && t.runs[0].style.stroke_miter_limit == 10.0), + "{text:?}" + ); + let content = vec![std::sync::Arc::new(text)]; + let (half, glyphs) = envelope_content_boxes(&content, kurbo::Affine::IDENTITY).unwrap(); + let painted = painted_by_kurbo(&content); + assert!(painted.x0 < half.x0 - 0.5 || painted.x1 > half.x1 + 0.5, "{painted:?} {half:?}"); + let mut options = vectorcraft_doc::live::EnvelopeOptions::NEW; + options.bounds_margin = envelope_stroke_margin(painted, glyphs).unwrap(); + let shaped = Node::new( + vectorcraft_doc::NodeId(1_000_000), + NodeKind::Envelope { content, kind: Box::new(rising_kind()), fidelity: 50.0, editing: false, options, frame: Box::default() }, + ); + let (drawn, page) = drawn_stroked_envelope(&shaped); + let art = + native_with_text(&layer("Art", true, &format!("{}\n{}", square(10, 10), type_envelope_on(&arc_keys(0.3), &rising_grid(), &drawn, ""))), &doc); + let r = import(&eps(&format!("{}\n{page}", page_square(10, 10)), &art)).unwrap(); + assert_eq!(names(&r.document), ["Art"], "{:?}", r.warnings); + let (envelopes, loose) = envelopes_and_type(&r.document); + assert_eq!(envelopes, [vec!["FLUX".to_string()]], "{:?}", r.warnings); + assert!(loose.is_empty(), "{loose:?}"); + // It maps from what the type paints, within a hundredth of a point on each side. + let mut margin = None; + r.document.walk(|n| { + if let NodeKind::Envelope { options, .. } = &n.kind { + margin = Some(options.bounds_margin); + } + }); + let [top, bottom, left, right] = margin.unwrap().map(f64::from); + let from = kurbo::Rect::new( + glyphs.x0 - left * glyphs.width(), + glyphs.y0 - top * glyphs.height(), + glyphs.x1 + right * glyphs.width(), + glyphs.y1 + bottom * glyphs.height(), + ); + let off = [from.x0 - painted.x0, from.y0 - painted.y0, from.x1 - painted.x1, from.y1 - painted.y1]; + assert!(off.iter().all(|d| d.abs() < 0.01), "{from:?} {painted:?}"); +} + /// The drawn art of `envelope` (on the page axes), an envelope of type stroked by its characters, /// as the drawn art of `.ai` files strokes type in an envelope: the bent glyph outlines the envelope /// draws of its type unstroked, each filled in its type's color, then each stroked with the type's diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 23a36a7e9a..75c95bb33a 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-11 · **Change:** minor (`.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-12 · **Change:** minor (`.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) Every format Illustrator opens, places, saves or exports, against VectorCraft's format table (`FORMATS`, `OPEN_EXTS`, `PLACE_EXTS` in `crates/engine/src/cmd/fileio/formats.rs`). Illustrator's list comes from its public @@ -340,6 +340,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| +| 2026-11-12 | minor | `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, after the ways it was tried before (its glyphs alone and grown by half its strokes' weight, #6535, on its own warp and on its saved grid), before a grid moved onto its drawn art, and only where that box is another: its glyph outlines with their fills and strokes baked as the envelope bakes them (geometry effects on them applied: a stroke a Transform effect moves counts where it is moved to), each piece measured by its visual bounds, which are exact for miter joins (a tip counts where the miter limit keeps it, not the miter allowance at every corner that the bounds with strokes take) and round joins and an upper bound for bevel joins, miters the limit cuts, width profiles and square-capped dashes; a contour of zero length, which paints nothing, doesn't count. Effects on the type object itself are left out, as VectorCraft applies them after the envelope bends the type. The box is measured only when that try comes and the import has a check left for it, and once for an envelope. Groups round type and other objects in the contents are measured as before. In users' files (used locally, never committed) the drawn art of some stroked type in an envelope maps from that box: where the type has sharp corners at its edges (slanted stems, pointed feet) and miter joins, or a stroke moved by a Transform effect (a drop shadow), its glyphs grown by half the weight gave too small a box and the envelope kept its drawn art; and where a glyph holds a contour of zero length at its edge, the glyphs' box counted it. On 224 of our own files: envelopes of type that open live go from 154 in 45 files to 161 in 50, and no file loses one; no file changes whether it opens from its layers or its PDF part; renders at 40 ppi change in 6 files, by at most 0.94% of their pixels, each where an envelope of type now opens live in place of its drawn art (the page's own art): 1 closer to the file's own page and 5 further; the notes change in the same 6 files: the note on type in an envelope goes where none keeps its drawn art, and a file whose envelopes of type all kept their drawn art, which opened without the page comparison, now opens with it and carries its notes (the share of art or type that differs from the page, type the page has without a text object, the PDF part's note on DeviceN colours). A synthetic file of 256 such envelopes of 2,000 characters each opens in the same time as before (13.3 s in a debug build): the box is measured only when its try comes. Tests `ai::envelope::tests::mitred_type_is_also_tried_mapped_from_what_its_stroke_paints_miter_tips_included`, `type_with_a_mitred_character_stroke_is_also_tried_mapped_from_what_it_paints`, `a_stroke_moved_by_a_transform_effect_counts_where_it_paints`, `round_joined_type_is_not_tried_twice_for_the_same_box`, `a_contour_of_zero_length_paints_nothing`, `a_side_within_the_slack_of_the_geometric_box_is_that_side`, `tests_native::a_warp_of_mitred_type_maps_from_what_its_stroke_paints_where_its_drawn_art_does` (#6824, part of #3179) | | 2026-11-11 | minor | `.ai` and EPS import, and what the canvas, every export and `.ai` save draw: type's strokes in an envelope (its characters' and those on its own appearance) paint along the bent glyph outlines at their own weight, Distort Appearance on or off, as the drawn art of users' `.ai` files strokes them (used locally, never committed: there the drawn art keeps those strokes as stroked paths at the type's own weights, and its ring is as wide wherever the grid squeezes or stretches the type). With Distort Appearance, VectorCraft bent them with the art, as their filled outlines, so an envelope of stroked type in a squeezed or stretched grid didn't draw as its drawn art and kept it. The same holds in an envelope inside an envelope. Paths' strokes, geometry effects, opacity masks, linear gradients and pattern fills bend as before. On 224 of our own files: envelopes of type that open live go from 135 in 37 files to 154 in 45, and no file loses one; no file changes whether it opens from its layers or its PDF part; renders at 40 ppi change in 31 files, by at most 2.3% of their pixels, 19 closer to the file's own page and 12 further, 11 of those where an envelope of type now opens live in place of its drawn art (the page's own art) and one by 4 pixels. Tests `envelope_distort::type_strokes_paint_at_their_own_weight_in_a_squeezed_envelope`, `a_stroke_on_types_appearance_paints_at_its_own_weight_in_a_squeezed_envelope`, `a_paths_stroke_still_bends_in_a_squeezed_envelope`, `tests_native::an_envelope_of_stroked_type_whose_drawn_art_strokes_the_bent_outlines_at_the_weight_opens_live` (#6644) | | 2026-11-11 | minor | `.ai` and EPS import, and what SVG export, PDF export and `.ai` save draw: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as a `.ai`'s own page aligns them (see type-parity.md, same date). In 224 users' files (used locally, never committed), 63 render differently: 54 closer to the page, 7 further, 1 alike and 1 that couldn't be compared; among them the median share of pixels that differ from the page went from 4.4% to 1.0%. Of the 7: one now opens from its layers instead of its PDF part (they differ from the page by less than the import's 5% limit now; type note 3.8%); one has a centred line whose spacing inside it differs from the page's, which now centres on the page's line while half of it no longer lies on the page's glyphs (type note 1.4% to 2.4%); five moved by less than 0.05 of a percentage point, in type the page draws in other glyphs. The type note shows a smaller share in 6 files; 2 more envelopes of type open live (129 to 131, none fewer in any file). SVG import: `text-anchor` aligns a line's advance, which ends after its last character's letter spacing, so a centred or right-aligned letter-spaced line moves back by half or all of it and stays where a reader draws it; SVG export, which anchors lines so, reads back unchanged (test `import_text::anchored_letter_spaced_lines_stay_where_a_reader_draws_them`). Affinity import: centred or right-aligned tracked artistic text moves by half or all of its last character's tracking, as layout now aligns it (unverified against Affinity, whose files we don't have), and differently aligned paragraphs line up by the widths layout aligns them by (`affinity_features::artistic_text_aligns_its_lines_within_the_longest`). Scores and estimates unchanged. (#6610) | | 2026-11-11 | minor | `.ai` and EPS import: while an envelope's contents are edited, the editing data keeps its mesh (a mesh's, a top object's or a warp's grid) in its dictionary, and in some files that mesh lies away from the drawn art by a move, the contents with the drawn art, as if the mesh hadn't followed the envelope when it moved: the envelope drew its contents elsewhere and kept its drawn art. A mesh or top object saved in Edit Contents (or a warp of type tried on its saved grid) whose mesh draws the contents as large as the drawn art, within half a point over width and height together, but further from it than that, is now tried again, after every other way and with one more of the import's checks, with its mesh moved by as far as the drawn art's box lies from the box of what it draws; it opens live there where it then draws as the drawn art. In users' files, used locally and never committed, only envelopes saved in Edit Contents draw elsewhere than their drawn art, and nothing in their dictionaries says by how much they moved. Tests `ai::tests::an_envelope_in_edit_contents_whose_mesh_stayed_behind_opens_live_on_its_drawn_art`, `tests_native::a_warp_of_type_in_edit_contents_whose_grid_stayed_behind_opens_on_its_drawn_art` (#6570) | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index b1ceaf70ea..b8c8a86178 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-12 · **Change:** minor (Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-12 · **Change:** minor (`.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; scores and estimates unchanged); previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Live Paint Bucket update (2026-11-12): one drag fills the faces crossed in the same group (#6373). > @@ -1482,7 +1482,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A `.ai`, or a PDF saved with Illustrator's editing data, whose editing data can't be decompressed opens from its PDF part with a warning that its layers weren't read and why, and an export or Save As to its own path asks first (`acknowledgeLoss`), as for a file whose layers the reader can't read (`crates/eps/src/import/tests_native.rs`, `crates/engine/src/cmd/fileio/tests_aiimport.rs`). A `.ai` or EPS opened from its editing data with one object on a shown layer that the reader can't read (an unknown operator inside a group, a pattern fill whose pattern it doesn't have, a symbol instance, a placed file without a usable preview) keeps its layers and groups: in that object's place, its layer gets a group of the page's objects inside the object's box, named after it, with a warning that lists what came in as the page's art and an export or Save As to its own path asking first (`acknowledgeLoss`). The file still opens from its page or PDF part when no box can be found, when live art or another unread object shares the page art inside it, when the object spans two artboards or lies on an artboard that has no page, when no page art lies inside its box, when that page art is inside a page group with a clip, mask, transparency or appearance, when the object holds a frame of threaded type, when the page art uses a pattern, image or swatch that the page lacks or that differs from the editing data's, or when the page art doesn't carry the object's transparency (#4806; `crates/eps/src/import/tests_native.rs`, `crates/engine/src/cmd/fileio/tests_aiimport.rs`). A `.ai` or EPS opened from its editing data with one object on a shown layer that the reader can't read (an unknown operator inside a group, a pattern fill whose pattern it doesn't have, a symbol instance, a placed file without a usable preview) keeps its layers and groups: in that object's place, its layer gets a group of the page's objects inside the object's box, named after it, with a warning that lists what came in as the page's art and an export or Save As to its own path asking first (`acknowledgeLoss`). The file still opens from its page or PDF part when no box can be found, when live art or another unread object shares the page art inside it, when the object spans two artboards, or when the page art doesn't carry the object's transparency (#4806; `crates/eps/src/import/tests_native.rs`, `crates/engine/src/cmd/fileio/tests_aiimport.rs`). - In a `.ai` opened from its editing data, an envelope made with a warp, a mesh or a top object opens as a live envelope of its contents, with its warp style, bend and distortions, its mesh points and handles or its top object's outline, its Envelope Options, its Fidelity and whether its contents are being edited. When Distort Appearance is on and the size the file saves for the contents matches their bounds with strokes, the contents map from that stroked box, until an edit in Edit Contents changes how far the strokes reach; VectorCraft's new envelopes map from the geometric box, as do contents with no width or no height, such as a single straight line. An envelope that can't be read, or that VectorCraft draws differently from the file's drawn art, keeps that drawn art, with a note. An envelope of type opens live, its type laid out from the text document as its contents, where VectorCraft's own envelope of that type draws as the drawn art the file saves (compared as for the other envelopes, seen on white and on black, so white type counts, and only where the layers with it are compared with the page and draw as it, the envelope weighed as the art it draws); elsewhere, and where the type's font isn't available, a text or visibility variable binds the type, or the envelope is in a symbol's or a pattern's art, it keeps its drawn art, with its type hidden and a note that says the type isn't editable (#3179; `crates/eps/src/import/ai/tests.rs`, `crates/eps/src/import/tests_native.rs`). A warp of type whose own warp, VectorCraft's, doesn't draw as its drawn art is tried again as a mesh envelope on the grid the file saves for it: its type stays editable and keeps the file's shape, but the warp's settings (style, bend) are lost, as the document has no place for them on a mesh. Type with strokes in an envelope with Distort Appearance on is also tried mapped from its glyphs grown by as far as its strokes paint along a side (half the weight of a centred stroke), without what miter joins add at corners, where the size the file saves for it doesn't already give that box; the drawn-art check decides which one opens. An envelope's grid reads its way round from all its rows and columns, so a mesh bent far round reads the way it runs. While an envelope's contents are edited, its mesh is kept in its dictionary, and in some files that mesh lies away from the drawn art by a move, the contents with the drawn art (as if the mesh hadn't followed the envelope when it moved): a mesh or top object saved in Edit Contents whose mesh draws the contents as large as the drawn art but elsewhere is tried again, after every other way, with its mesh moved onto that art, and opens there where it then draws as it. The drawn art of these files strokes type in an envelope along its bent outlines at the stroke's own weight, Distort Appearance on or off, and VectorCraft draws it so (#6644): an envelope of stroked type whose grid squeezes or stretches it opens live where it draws as that art. + In a `.ai` opened from its editing data, an envelope made with a warp, a mesh or a top object opens as a live envelope of its contents, with its warp style, bend and distortions, its mesh points and handles or its top object's outline, its Envelope Options, its Fidelity and whether its contents are being edited. When Distort Appearance is on and the size the file saves for the contents matches their bounds with strokes, the contents map from that stroked box, until an edit in Edit Contents changes how far the strokes reach; VectorCraft's new envelopes map from the geometric box, as do contents with no width or no height, such as a single straight line. An envelope that can't be read, or that VectorCraft draws differently from the file's drawn art, keeps that drawn art, with a note. An envelope of type opens live, its type laid out from the text document as its contents, where VectorCraft's own envelope of that type draws as the drawn art the file saves (compared as for the other envelopes, seen on white and on black, so white type counts, and only where the layers with it are compared with the page and draw as it, the envelope weighed as the art it draws); elsewhere, and where the type's font isn't available, a text or visibility variable binds the type, or the envelope is in a symbol's or a pattern's art, it keeps its drawn art, with its type hidden and a note that says the type isn't editable (#3179; `crates/eps/src/import/ai/tests.rs`, `crates/eps/src/import/tests_native.rs`). A warp of type whose own warp, VectorCraft's, doesn't draw as its drawn art is tried again as a mesh envelope on the grid the file saves for it: its type stays editable and keeps the file's shape, but the warp's settings (style, bend) are lost, as the document has no place for them on a mesh. Type with strokes in an envelope with Distort Appearance on is also tried mapped from its glyphs grown by as far as its strokes paint along a side (half the weight of a centred stroke), without what miter joins add at corners, where the size the file saves for it doesn't already give that box; after those tries (and before a grid moved onto its drawn art), it is also tried mapped from the box of what it paints, where that is another box, as users' files map some such type: its glyph outlines with their fills and strokes baked as the envelope bakes them, so geometry effects on them count (a stroke a Transform effect moves paints where it is moved to), each measured by its visual bounds (exact for miter joins, a tip counting where the miter limit keeps it, and for round joins; an upper bound for bevel joins, miters the limit cuts, width profiles and square-capped dashes), and a contour of zero length, which paints nothing, left out; effects on the type object itself are left out, as VectorCraft applies them after the envelope bends the type. The drawn-art check decides which one opens. An envelope's grid reads its way round from all its rows and columns, so a mesh bent far round reads the way it runs. While an envelope's contents are edited, its mesh is kept in its dictionary, and in some files that mesh lies away from the drawn art by a move, the contents with the drawn art (as if the mesh hadn't followed the envelope when it moved): a mesh or top object saved in Edit Contents whose mesh draws the contents as large as the drawn art but elsewhere is tried again, after every other way, with its mesh moved onto that art, and opens there where it then draws as it. The drawn art of these files strokes type in an envelope along its bent outlines at the stroke's own weight, Distort Appearance on or off, and VectorCraft draws it so (#6644): an envelope of stroked type whose grid squeezes or stretches it opens live where it draws as that art. In a `.ai` opened from its editing data, Convert to Shape on a whole path or type object opens as a live Rectangle, Rounded Rectangle or Ellipse effect with its Absolute or Relative size, its corner radius, its place among the object's effects and whether it is hidden. A relative size in the file is added to each side. A relative Ellipse, or a setting VectorCraft doesn't read, keeps the drawn art (`crates/eps/src/import/ai/style/tests.rs`, `crates/eps/src/import/ai/tests.rs`, `crates/eps/src/import/tests_native.rs`). In a `.ai` opened from its editing data, Bas Relief in an art style takes its Detail, Smoothness and Light direction from the style's settings block, and an object other than type with it opens as itself with the live effect. A settings block that VectorCraft can't read (malformed, another effect's, a value out of range or a key it doesn't know) keeps the object's drawn look (part of #637; [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [Photoshop File Formats Specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646); `crates/eps/src/import/ai/style/tests.rs`, `crates/eps/src/import/ai/tests.rs`). PDF export and `.ai` saves write a page with a side longer than 14,400 pt with a `UserUnit` (PDF 1.6), its longer side divided by 14,400 and rounded up to the next thousandth, so that no side is longer than 14,400 units (ISO 32000-1, Annex C.2); a PDF 1.5 file with such a page is written as PDF 1.6 with PDF 1.5's encryption, PDF/X files and PDF 1.3 and 1.4 files write it in points (in PDF 1.3 and 1.4, a page past 32,767 pt that needs a real number past 32,767 is refused with an error naming it), a page whose short side is 3 pt or longer but would be under 3 units at that `UserUnit` gets a smaller one that keeps the short side at 3 units, and the export's warnings give each such page's size and how it is written (#6382). The Save PDF dialog's "Write pages longer than 200 in at full size in points" (`longPagesInPoints`, off by default) writes such pages in points without a `UserUnit` at every PDF version, in files without a PDF/X or PDF/A standard. @@ -2056,6 +2056,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | Date | Change | Summary | |---|---|---| +| 2026-11-12 | minor | `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints (its strokes' miter tips, and strokes a Transform effect moves, included), after its glyphs grown by half its strokes' weight; `.ai` import evidence updated (#6824); scores and estimates unchanged. | | 2026-11-12 | minor | Live Paint Bucket fills faces crossed in one drag (#6373). Scores and estimates unchanged. | | 2026-11-11 | minor | Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does (Smart Guides, Snap to Point and the ruler guides, pixels, the grid); evidence updated; scores unchanged. | | 2026-11-11 | minor | Eyedropper copies effective character dimensions between transformed text objects (#6404); scores and estimates unchanged. | From 74235d8959969eb25e96305aee1f7ba8a9dd142f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 08:10:16 -0800 Subject: [PATCH 02/15] Color: a double-click right of an RGB field switches between percent and 0 to 255 In RGB mode a double-click in the cell right of the R, G or B field switches all three fields and sliders between 0 to 255 and percent (0 to 100 with a % suffix, as the CMYK fields show). The color does not change; a typed percent converts back (50% is 127.5 of 255) and a slider click picks a whole percent. Web Safe RGB, the hex field and the other modes keep their units. Only RGB rows have the cell. It is blank, is highlighted under the pointer, and takes no keyboard focus, so Tab does not stop on it. The RGB sliders are narrower by the cell's width and spacing, so an RGB row is as wide as a row in the other modes and Tint, in a narrow panel too. While a mixed selection disables the rows, a double-click on the cell does nothing, as the fields beside it take no input. The double-click runs ui.colorPanel {rgbPercent}, which takes a bool and answers it. The setting is off by default and is kept with the preferences (ui.color_rgb_percent); a saved value that is not true or false reads as off. The color mixer in the Fill and Stroke chips' popovers (Control bar and Properties panel) and the gradient stop dialog show the same rows and follow the same setting. Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/panels/color.rs | 74 ++++++++-- crates/ui-egui/src/panels/color/tests.rs | 180 ++++++++++++++++++++++- crates/ui-egui/src/state.rs | 5 + docs/control-protocol.md | 23 +-- docs/mcp.md | 3 +- docs/target-app-parity.md | 1 + 8 files changed, 266 insertions(+), 24 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 4f3ddeb86d..b869f511c1 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1236,7 +1236,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorPanel", "Color Panel Options", "", - "{mode?: grayscale|rgb|hsb|cmyk|websafe, options?: bool, recentColors?: bool} pick the Color panel's mode as its panel menu does (the active color converts to the mode's model as one undo step), Show Options (true) or Hide Options (false), and check (true) or uncheck (false) Show Recent Colors, which shows or hides the panel's Recent Colors row (applied colors still join the list while it is hidden; the Swatches panel keeps its row); all three are kept with the preferences; RGB, HSB, Web Safe RGB and hex values use the working RGB space (ui.inspect: ui.color_mode, ui.color_hide_options, ui.color_show_recent_colors) → {mode (null: none picked yet), options, recentColors, shown: the mode the panel shows the color in, or tint for a tint of a global or spot swatch}", + "{mode?: grayscale|rgb|hsb|cmyk|websafe, options?: bool, recentColors?: bool, rgbPercent?: bool} pick the Color panel's mode as its panel menu does (the active color converts to the mode's model as one undo step), Show Options (true) or Hide Options (false), check (true) or uncheck (false) Show Recent Colors, which shows or hides the panel's Recent Colors row (applied colors still join the list while it is hidden; the Swatches panel keeps its row), and show the RGB mode's R, G and B in percent (true) or from 0 to 255 (false), as a double-click right of an RGB field switches them (the color does not change; Web Safe RGB and the hex field stay in 0 to 255); all four are kept with the preferences; RGB, HSB, Web Safe RGB and hex values use the working RGB space (ui.inspect: ui.color_mode, ui.color_hide_options, ui.color_show_recent_colors, ui.color_rgb_percent) → {mode (null: none picked yet), options, recentColors, rgbPercent, shown: the mode the panel shows the color in, or tint for a tint of a global or spot swatch}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index b05da18e12..e975167a5a 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1237,7 +1237,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorPanel", "Color Panel Options", "", - "{mode?: grayscale|rgb|hsb|cmyk|websafe, options?: bool, recentColors?: bool} pick the Color panel's mode as its panel menu does (the active color converts to the mode's model as one undo step), Show Options (true) or Hide Options (false), and check (true) or uncheck (false) Show Recent Colors, which shows or hides the panel's Recent Colors row (applied colors still join the list while it is hidden; the Swatches panel keeps its row); all three are kept with the preferences; RGB, HSB, Web Safe RGB and hex values use the working RGB space (ui.inspect: ui.color_mode, ui.color_hide_options, ui.color_show_recent_colors) → {mode (null: none picked yet), options, recentColors, shown: the mode the panel shows the color in, or tint for a tint of a global or spot swatch}", + "{mode?: grayscale|rgb|hsb|cmyk|websafe, options?: bool, recentColors?: bool, rgbPercent?: bool} pick the Color panel's mode as its panel menu does (the active color converts to the mode's model as one undo step), Show Options (true) or Hide Options (false), check (true) or uncheck (false) Show Recent Colors, which shows or hides the panel's Recent Colors row (applied colors still join the list while it is hidden; the Swatches panel keeps its row), and show the RGB mode's R, G and B in percent (true) or from 0 to 255 (false), as a double-click right of an RGB field switches them (the color does not change; Web Safe RGB and the hex field stay in 0 to 255); all four are kept with the preferences; RGB, HSB, Web Safe RGB and hex values use the working RGB space (ui.inspect: ui.color_mode, ui.color_hide_options, ui.color_show_recent_colors, ui.color_rgb_percent) → {mode (null: none picked yet), options, recentColors, rgbPercent, shown: the mode the panel shows the color in, or tint for a tint of a global or spot swatch}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/panels/color.rs b/crates/ui-egui/src/panels/color.rs index 4e13f629a5..4aee419bd1 100644 --- a/crates/ui-egui/src/panels/color.rs +++ b/crates/ui-egui/src/panels/color.rs @@ -14,8 +14,10 @@ //! Hide Options leaves just the proxy and the spectrum (the app keeps it between sessions too). //! Unchecking Show Recent Colors hides the Recent Colors row while applied colors still join the //! list (the app keeps it between sessions too). +//! A double-click right of an RGB field switches R, G and B between 0 to 255 and percent (the app +//! keeps it between sessions too); Web Safe RGB and the hex field stay in 0 to 255. //! `ui.colorPanel` picks a mode, shows or hides the options and checks or unchecks Show Recent -//! Colors as the panel menu does. +//! Colors as the panel menu does, and switches RGB to percent and back. use egui::{Color32, Rect, Sense, Stroke, StrokeKind, Ui, vec2}; use serde_json::{Value, json}; @@ -298,6 +300,24 @@ pub fn deserialize_show_recent_colors<'de, D: serde::Deserializer<'de>>(d: D) -> Ok(v.as_bool().unwrap_or(true)) } +/// Serde reader for the saved RGB in percent ([`crate::UiState::color_rgb_percent`]): `true` shows +/// percent and any other value 0 to 255, so an unknown value doesn't lose the rest of the +/// preferences. +pub fn deserialize_rgb_percent<'de, D: serde::Deserializer<'de>>(d: D) -> Result { + let v = ::deserialize(d)?; + Ok(v.as_bool().unwrap_or_default()) +} + +/// An RGB component (0 to 255) in percent, as the field shows it while RGB shows in percent. +fn to_percent(v: f32) -> f32 { + v * 100.0 / 255.0 +} + +/// A percent typed or picked while RGB shows in percent, as an RGB component (0 to 255). +fn from_percent(p: f32) -> f32 { + p * 255.0 / 100.0 +} + /// The mode the panel shows `color` in: with nothing selected (the defaults for new art) the mode /// picked last, which the app keeps between sessions, else [`display_mode`]. fn shown_mode(app: &VectorcraftApp, color: Option<&Color>) -> Mode { @@ -522,11 +542,12 @@ fn recolor(app: &mut VectorcraftApp, ui: &Ui, tgt: &Target, invert: bool, behind } } -/// `ui.colorPanel {mode?, options?, recentColors?}`: pick a mode as the panel menu does -/// ([`set_mode`]), Show Options (true) or Hide Options (false), and check (true) or uncheck -/// (false) Show Recent Colors. → {mode, options, recentColors, shown}: the mode picked last (null: -/// none yet), whether the options show, whether Show Recent Colors is checked, and the mode the -/// panel shows the color in (`tint` for a tint of a global or spot swatch). +/// `ui.colorPanel {mode?, options?, recentColors?, rgbPercent?}`: pick a mode as the panel menu +/// does ([`set_mode`]), Show Options (true) or Hide Options (false), check (true) or uncheck +/// (false) Show Recent Colors, and show RGB in percent (true) or 0 to 255 (false). → {mode, +/// options, recentColors, rgbPercent, shown}: the mode picked last (null: none yet), whether the +/// options show, whether Show Recent Colors is checked, whether RGB shows in percent, and the mode +/// the panel shows the color in (`tint` for a tint of a global or spot swatch). pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result { let mode = match p.get("mode") { None | Some(Value::Null) => None, @@ -534,6 +555,7 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result Result json!("tint"), @@ -554,6 +579,7 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result)>| { diff --git a/crates/ui-egui/src/panels/color/tests.rs b/crates/ui-egui/src/panels/color/tests.rs index 36acc60e4a..4cdd50f7fc 100644 --- a/crates/ui-egui/src/panels/color/tests.rs +++ b/crates/ui-egui/src/panels/color/tests.rs @@ -676,6 +676,179 @@ fn show_recent_colors_comes_back_after_a_restart() { assert_eq!((app.ui.color_mode, app.ui.color_hide_options, app.ui.color_show_recent_colors), (None, false, false)); } +/// The fill's R, G and B from 0 to 1. +fn fill_rgb(app: &VectorcraftApp) -> [f32; 3] { + working_rgb(&crate::panels::current_paints(app).0.color().expect("a solid fill")) +} + +/// One frame of the panel at `time` with `events`; returns the rect of the cell right of the field +/// of slider row `i` (None: the row has no cell). +fn units_cell(app: &mut VectorcraftApp, ctx: &egui::Context, i: usize, time: f64, events: Vec) -> Option { + let input = egui::RawInput { time: Some(time), events, ..Default::default() }; + let mut rect = None; + let mut out = ctx.run_ui(input, |ui| { + show(app, ui); + rect = ctx.read_response(ui.scope_id().with("color-units").with(i)).map(|r| r.rect); + }); + out.textures_delta.clear(); + rect +} + +/// The rect of the slider that screen readers name `label`, in a frame of `ctx` (`width`: the +/// screen's width; None: the screen of the frame before). +fn slider_rect(app: &mut VectorcraftApp, ctx: &egui::Context, label: &str, width: Option) -> Rect { + ctx.enable_accesskit(); + let screen_rect = width.map(|w| Rect::from_min_size(egui::Pos2::ZERO, vec2(w, 800.0))); + let mut nodes = vec![]; + for _ in 0..2 { + let mut out = ctx.run_ui(egui::RawInput { screen_rect, ..Default::default() }, |ui| show(app, ui)); + out.textures_delta.clear(); + nodes = out.platform_output.accesskit_update.map(|u| u.nodes).unwrap_or_default(); + } + let slider = nodes.iter().find(|(_, n)| n.role() == egui::accesskit::Role::Slider && n.label() == Some(label)); + let b = slider.and_then(|(_, n)| n.bounds()).unwrap_or_else(|| panic!("no slider is named {label:?}")); + Rect::from_min_max(egui::pos2(b.x0 as f32, b.y0 as f32), egui::pos2(b.x1 as f32, b.y1 as f32)) +} + +/// Double-click the cell right of the field of slider row `i`, at `time` and a moment later. +fn double_click_units(app: &mut VectorcraftApp, ctx: &egui::Context, i: usize, time: f64) { + let run = |app: &mut VectorcraftApp, time: f64, events: Vec| units_cell(app, ctx, i, time, events); + let pos = run(app, time, vec![]).expect("the cell is drawn").center(); + let button = |pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE }; + run(app, time + 0.05, vec![egui::Event::PointerMoved(pos), button(true)]); + run(app, time + 0.1, vec![button(false)]); + run(app, time + 0.15, vec![button(true)]); + run(app, time + 0.2, vec![button(false)]); + run(app, time + 0.25, vec![]); +} + +/// In RGB mode a double-click right of an RGB field switches R, G and B between 0 to 255 and +/// percent, as `ui.colorPanel {rgbPercent}` does. The color does not change; a typed percent and a +/// slider click convert back to 0 to 255. Web Safe RGB and the hex field stay in 0 to 255. Only +/// RGB rows have the cell, and Tab does not stop on it. +#[test] +fn rgb_percent_switches_the_rgb_fields_between_percent_and_0_to_255() { + use crate::panels::tests_appearance::{click, frame_events, text_rect}; + use crate::widgets::accessibility_tests::{slider_value, tab_stops, tree}; + let mut app = app(); + let ctx = egui::Context::default(); + app.run("paint.setFill", json!({"color": "#336699"})).unwrap(); + let texts = |app: &mut VectorcraftApp| frame_events(&ctx, app, vec![], show).into_iter().map(|(t, _)| t).collect::>(); + let has = |texts: &[String], all: &[&str]| all.iter().all(|s| texts.iter().any(|t| t == s)); + assert!(has(&texts(&mut app), &["51", "102", "153"])); + assert_eq!(app.run("ui.colorPanel", json!({"rgbPercent": true})).unwrap()["rgbPercent"], true); + let shown = texts(&mut app); + assert!(has(&shown, &["20%", "40%", "60%", "336699"]), "{shown:?}"); + assert_eq!(paints_hex(&app).0, "#336699", "the color does not change"); + let v = |n: f64, text: &str| (Some(n), Some(0.0), Some(100.0), Some(text.to_string())); + let sliders = tree(|ui| show(&mut app, ui)); + assert_eq!(slider_value(&sliders, "G"), v(40.0, "40%")); + // A typed percent sets the component: 50 % is 127.5 of 255. + let field = text_rect(&frame_events(&ctx, &mut app, vec![], show), "20%").center(); + click(&ctx, &mut app, field, show); + let key = |key, modifiers| egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers }; + frame_events(&ctx, &mut app, vec![key(egui::Key::A, egui::Modifiers::COMMAND), egui::Event::Text("50".into())], show); + frame_events(&ctx, &mut app, vec![key(egui::Key::Enter, egui::Modifiers::NONE)], show); + let [r, g, b] = fill_rgb(&app); + assert!((r - 0.5).abs() < 1e-6 && (g - 0.4).abs() < 1e-6 && (b - 0.6).abs() < 1e-6, "{r} {g} {b}"); + assert!(has(&texts(&mut app), &["50%", "40%", "60%"])); + // A click a third of the way along the B slider's bar picks 33 %, a whole percent. + let rgb_slider = slider_rect(&mut app, &ctx, "B", None); + let (bar_left, bar_w) = (rgb_slider.left() + 4.0, rgb_slider.width() - 8.0); + click(&ctx, &mut app, egui::pos2(bar_left + bar_w / 3.0, rgb_slider.center().y), show); + let p = fill_rgb(&app)[2] * 100.0; + assert!((p - 33.0).abs() < 1e-3, "{p}"); + // The cells take no keyboard focus: Tab goes from field to slider without stopping on them. + let cells: Vec<_> = (0..3).filter_map(|i| units_cell(&mut app, &ctx, i, 5.0, vec![]).map(|_| i)).collect(); + assert_eq!(cells, [0, 1, 2], "each RGB row has a cell"); + let mut units = egui::Id::NULL; + let stops = tab_stops(&ctx, 24, |events| { + frame_events(&ctx, &mut app, events, |app, ui| { + show(app, ui); + units = ui.scope_id().with("color-units"); + }); + }); + let cell_ids: Vec = (0..3).map(|i| units.with(i)).collect(); + assert!(stops.len() >= 6 && stops.iter().all(|s| !cell_ids.contains(s)), "{stops:?}"); + app.run("paint.setFill", json!({"color": "#803366"})).unwrap(); + assert!((fill_rgb(&app)[0] - 128.0 / 255.0).abs() < 1e-6); + // A double-click right of the G field switches back to 0 to 255, and another to percent. + double_click_units(&mut app, &ctx, 1, 10.0); + assert!(!app.ui.color_rgb_percent); + assert!(has(&texts(&mut app), &["128", "51", "102"])); + assert_eq!(paints_hex(&app).0, "#803366", "the color does not change"); + double_click_units(&mut app, &ctx, 1, 20.0); + assert!(app.ui.color_rgb_percent); + assert!(has(&texts(&mut app), &["50%", "20%", "40%"])); + assert_eq!(app.run("ui.colorPanel", json!({})).unwrap()["rgbPercent"], true); + // RGB sliders are narrower by the cell and its spacing, in a narrow panel too. + let cell_room = 10.0 + ctx.global_style().spacing.item_spacing.x; + let rgb_w = slider_rect(&mut app, &ctx, "B", Some(400.0)).width(); + let narrow_rgb = slider_rect(&mut app, &ctx, "B", Some(150.0)).width(); + // Web Safe RGB shows 0 to 255. It has no cells, and its sliders keep the room the RGB cells + // take. + app.run("paint.setFill", json!({"color": "#336699"})).unwrap(); + app.run("ui.colorPanel", json!({"mode": "websafe"})).unwrap(); + assert!(has(&texts(&mut app), &["51", "102", "153"])); + assert_eq!(units_cell(&mut app, &ctx, 1, 30.0, vec![]), None); + let web_w = slider_rect(&mut app, &ctx, "B", Some(400.0)).width(); + assert!((web_w - rgb_w - cell_room).abs() < 0.5, "{web_w} {rgb_w}"); + let narrow_web = slider_rect(&mut app, &ctx, "B", Some(150.0)).width(); + assert!((narrow_web - narrow_rgb - cell_room).abs() < 0.5, "{narrow_web} {narrow_rgb}"); + // HSB shows its own units, with no cells and sliders as wide as Web Safe RGB's. + app.run("ui.colorPanel", json!({"mode": "hsb"})).unwrap(); + assert!(has(&texts(&mut app), &["210°", "67%", "60%"])); + assert_eq!(units_cell(&mut app, &ctx, 1, 31.0, vec![]), None); + assert!((slider_rect(&mut app, &ctx, "B", Some(400.0)).width() - web_w).abs() < 0.5); + assert!(app.ui.color_rgb_percent); +} + +/// While a mixed selection disables the RGB rows, a double-click right of an RGB field does not +/// switch the units, as the fields beside it take no input. +#[test] +fn rgb_percent_does_not_switch_while_the_rows_are_disabled() { + let mut app = app(); + let ctx = egui::Context::default(); + app.run("ui.colorPanel", json!({"mode": "rgb"})).unwrap(); + let b = app.run("shape.rectangle", json!({"x": 80, "y": 10, "width": 50, "height": 50})).unwrap()["id"].clone(); + app.run("select.all", json!({})).unwrap(); + app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + app.run("paint.setFill", json!({"color": "#00ff00", "ids": [b]})).unwrap(); + units_cell(&mut app, &ctx, 1, 1.0, vec![]); + assert_eq!(crate::panels::mixed_paints(&app, &ctx), (true, false)); + double_click_units(&mut app, &ctx, 1, 2.0); + assert!(!app.ui.color_rgb_percent); + // With one color the rows take input, and the same double-click switches the units. + app.run("paint.setFill", json!({"color": "#336699"})).unwrap(); + double_click_units(&mut app, &ctx, 1, 3.0); + assert!(app.ui.color_rgb_percent); +} + +/// RGB in percent is kept with the UI state, which the app saves with its preferences. A saved +/// state without it, or with a value that isn't true or false, reads as 0 to 255, and the rest of +/// the state still loads. A value that isn't true or false in the command answers an error and +/// changes nothing. +#[test] +fn rgb_percent_comes_back_after_a_restart() { + let mut app = app(); + app.run("ui.colorPanel", json!({"rgbPercent": true})).unwrap(); + let saved: crate::UiState = serde_json::from_value(serde_json::to_value(&app.ui).unwrap()).unwrap(); + assert!(saved.color_rgb_percent); + assert_eq!(crate::control::inspect(&app, &egui::Context::default())["ui"]["color_rgb_percent"], true); + let old: crate::UiState = serde_json::from_value(json!({"place_link": false})).unwrap(); + assert!(!old.color_rgb_percent, "a state saved before the setting existed shows 0 to 255"); + for v in [json!(7), json!("percent"), json!({}), Value::Null] { + let ui: crate::UiState = serde_json::from_value(json!({"color_rgb_percent": v, "place_link": false})).unwrap(); + assert_eq!((ui.color_rgb_percent, ui.place_link), (false, false), "{v}"); + } + for v in [json!("yes"), json!(1), json!([])] { + let e = app.run("ui.colorPanel", json!({"mode": "cmyk", "rgbPercent": v})).unwrap_err(); + assert_eq!(e, "`rgbPercent` must be true or false", "{v}"); + } + assert_eq!((app.ui.color_mode, app.ui.color_rgb_percent), (None, true)); + assert_eq!(app.run("ui.colorPanel", json!({"rgbPercent": false})).unwrap()["rgbPercent"], false); +} + /// `ui.colorPanel {mode}` picks a mode as the panel menu does: HSB shows an RGB fill as H, S and /// B, and CMYK converts it as one undo step. #[test] @@ -684,7 +857,7 @@ fn ui_color_panel_picks_a_mode_as_the_menu_does() { let ctx = egui::Context::default(); app.run("paint.setFill", json!({"color": "#336699"})).unwrap(); let r = app.run("ui.colorPanel", json!({"mode": "hsb"})).unwrap(); - assert_eq!(r, json!({"mode": "hsb", "options": true, "recentColors": true, "shown": "hsb"})); + assert_eq!(r, json!({"mode": "hsb", "options": true, "recentColors": true, "rgbPercent": false, "shown": "hsb"})); assert_eq!(slider_labels(&mut app, &ctx), ["H", "S", "B"]); assert_eq!(crate::control::inspect(&app, &ctx)["ui"]["color_mode"], "hsb"); assert_eq!(paints_hex(&app).0, "#336699", "HSB keeps the RGB color"); @@ -694,7 +867,10 @@ fn ui_color_panel_picks_a_mode_as_the_menu_does() { assert!(matches!(crate::panels::current_paints(&app).0.color(), Some(Color::Rgb { .. })), "undo restores it"); assert_eq!(paints_hex(&app).0, "#336699"); // `{}` reads the settings: CMYK stays picked, and the RGB fill shows in its own model. - assert_eq!(app.run("ui.colorPanel", json!({})).unwrap(), json!({"mode": "cmyk", "options": true, "recentColors": true, "shown": "rgb"})); + assert_eq!( + app.run("ui.colorPanel", json!({})).unwrap(), + json!({"mode": "cmyk", "options": true, "recentColors": true, "rgbPercent": false, "shown": "rgb"}) + ); // A tint of a global swatch shows Tint mode. app.run("swatch.new", json!({"name": "Ink", "color": {"c": 0, "m": 1, "y": 0, "k": 0}, "spot": true})).unwrap(); app.run("paint.setFill", json!({"swatch": "Ink", "tint": 50})).unwrap(); diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 4a0e73da6b..14d651564f 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -670,6 +670,10 @@ pub struct UiState { /// recent colors keeps filling while the row is hidden. #[serde(default = "yes", deserialize_with = "crate::panels::color::deserialize_show_recent_colors")] pub color_show_recent_colors: bool, + /// Color panel: RGB mode shows R, G and B in percent instead of 0 to 255 (a double-click right + /// of an RGB field, `ui.colorPanel`, [`crate::panels::color::deserialize_rgb_percent`]). + #[serde(default, deserialize_with = "crate::panels::color::deserialize_rgb_percent")] + pub color_rgb_percent: bool, /// The SVG Options chosen last (`svg` object of the export/save commands; null: never used). #[serde(default)] pub svg_options: Value, @@ -1116,6 +1120,7 @@ impl Default for UiState { color_mode: None, color_hide_options: false, color_show_recent_colors: true, + color_rgb_percent: false, svg_options: Value::Null, place_link: true, dialog_file: None, diff --git a/docs/control-protocol.md b/docs/control-protocol.md index b3f4e56bde..a0b62da973 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -238,15 +238,20 @@ Edit or Apply Colors runs `ui.recolorDialog {colors, library?}` with the harmony recolours as usual; with nothing selected the colours themselves are the rows and `ui.dialog.confirm` saves them as a new colour group (`swatch.newGroup`, named by the `groupName` field). -Color panel options: `ui.colorPanel {mode?, options?, recentColors?}` picks the panel's mode as its panel menu does -(`grayscale`, `rgb`, `hsb`, `cmyk` or `websafe`; the active color converts to the mode's model as one undo step), -shows (`options: true`) or hides (`false`) the options, and checks (`recentColors: true`) or unchecks (`false`) Show -Recent Colors, which shows or hides the panel's Recent Colors row. Applied colors still join the list while the row -is hidden, and the Swatches panel keeps its own row. It answers `{mode, options, recentColors, shown}`: `mode` is null -until a mode is picked, and `shown` is the mode the panel shows the color in, or `tint` for a tint of a global or spot -swatch. Another mode, `lab` included, answers an error, as does an `options` or `recentColors` value that is not true -or false. The desktop app keeps the three settings with its preferences, and `ui.inspect` reports them as -`ui.color_mode`, `ui.color_hide_options` and `ui.color_show_recent_colors`. +Color panel options: `ui.colorPanel {mode?, options?, recentColors?, rgbPercent?}` picks the panel's mode as its +panel menu does (`grayscale`, `rgb`, `hsb`, `cmyk` or `websafe`; the active color converts to the mode's model as one +undo step), shows (`options: true`) or hides (`false`) the options, and checks (`recentColors: true`) or unchecks +(`false`) Show Recent Colors, which shows or hides the panel's Recent Colors row. Applied colors still join the list +while the row is hidden, and the Swatches panel keeps its own row. `rgbPercent: true` shows the RGB mode's R, G and B +in percent and `false` shows them from 0 to 255, as a double-click right of an RGB field switches them; the color does +not change, and Web Safe RGB and the hex field stay in 0 to 255. The color mixer in the popovers of the Fill and +Stroke chips (Control bar and Properties panel) and the gradient stop dialog show the Color panel's rows and follow +the same setting. It answers `{mode, options, recentColors, rgbPercent, +shown}`: `mode` is null until a mode is picked, and `shown` is the mode the panel shows the color in, or `tint` for a +tint of a global or spot swatch. Another mode, `lab` included, answers an error, as does an `options`, `recentColors` +or `rgbPercent` value that is not true or false. The desktop app keeps the four settings with its preferences, and +`ui.inspect` reports them as `ui.color_mode`, `ui.color_hide_options`, `ui.color_show_recent_colors` and +`ui.color_rgb_percent`. Color Themes panel (`window.panel {panel: "colorThemes"}`): its Create tab makes a theme on a harmony wheel and its My Themes tab lists the saved themes; every action runs a command (`colorTheme.save`, `colorTheme.delete`, diff --git a/docs/mcp.md b/docs/mcp.md index 996908799f..58fc044512 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -533,7 +533,8 @@ space. RGB edits preserve the other native channels; HSB uses those same working display sRGB retain their native numeric values. `ui.colorPanel` selects the panel mode and `ui.colorPicker` opens the picker through `run_command` with the remote backend. `ui.colorPanel {"recentColors": false}` unchecks the panel menu's Show Recent Colors, which hides the Color panel's Recent Colors row, and `true` shows it again; -applied colors still join the list while it is hidden. +applied colors still join the list while it is hidden. `ui.colorPanel {"rgbPercent": true}` shows the Color panel's +RGB fields in percent, as a double-click right of an RGB field does, and `false` shows them from 0 to 255 again. | Tool | Arguments | Notes | |---|---|---| diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 2962c63b7e..0921b2ed72 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1323,6 +1323,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Recent Colors keeps the last 30 solid colors applied, newest first and each once, and the list stays the same when another document is opened or made active; a 31st color drops the oldest ([Select colors using the Color panel](https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/select-colors-using-the-color-panel.html)). The list lasts for the session. In the Color and Swatches panels the chips wrap onto further rows when the panel is too narrow for one row (`paint.recent`). Tests: `recent_colors_keep_thirty_colors_across_documents` in `crates/engine/src/tests/paintproxy.rs`, `all_thirty_recent_colors_wrap_into_a_narrow_panel` in `crates/ui-egui/src/panels/color/tests.rs`. Unchecking Show Recent Colors in the Color panel's menu hides its Recent Colors row, and checking it shows the row again ([Select colors using the Color panel](https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/select-colors-using-the-color-panel.html)). In VectorCraft the item is checked by default and kept between sessions, applied colors still join the list while the row is hidden, Hide Options hides the row either way, and the Swatches panel keeps its row (`ui.colorPanel {recentColors}`). Tests: `show_recent_colors_hides_and_shows_the_row` in `crates/ui-egui/src/panels/color/tests.rs`. A Cmd/Ctrl-click on the Color panel's spectrum applies Complement and a Cmd/Ctrl+Shift-click applies Invert to the active Fill or Stroke (`paint.complement`, `paint.invert`); with Alt also held, the click recolors the inactive one, as the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) list them. + A double-click right of an RGB field switches the Color panel's R, G and B between percent and 0 to 255 ([Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html), Color panel). In VectorCraft the color does not change, Web Safe RGB and the hex field stay in 0 to 255, and the panel keeps the choice between sessions (`ui.colorPanel {rgbPercent}`); the color mixer of the Fill and Stroke chips and the gradient stop dialog follow the same setting. Tests: `rgb_percent_switches_the_rgb_fields_between_percent_and_0_to_255`, `rgb_percent_does_not_switch_while_the_rows_are_disabled` and `rgb_percent_comes_back_after_a_restart` in `crates/ui-egui/src/panels/color/tests.rs`. View › Proof Setup › Color blindness – Tritanopia-type turns Proof Colors on and proofs the canvas with the tritanopia simulation of Brettel, Viénot and Mollon (1997). The Separations Preview panel's Proof Setup list offers the same target (`view.proofSetup {target: "tritanopia"}`). Grays keep their value. The Separations Preview panel's Gamut Check button reports one color outside the CMYK gamut in the singular and more in the plural, in English and in each language's plural forms (`gamut_check_status_takes_the_plural_form` in `crates/ui-egui/src/i18n/tests.rs`). - **Document Color Mode outside the layers:** File › Document Color Mode (in one undo step) and `document.open {colorMode}` also convert the colors of graph designs, graphic styles, opacity-mask art, the tile that pattern editing's Cancel puts back and the art of brushes (with a Hue Shift brush's key color); a tint of a global swatch there becomes the converted swatch's color at its tint, as in the art. From 5b09cf9c09f1737932125cf8380060a4efd4f719 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 13:45:55 -0800 Subject: [PATCH 03/15] Document Info: Spot Color Objects leaves out fills and strokes at opacity 0 A spot-colored fill or stroke whose opacity is 0 prints no ink, but Spot Color Objects still listed its object and objects.spots counted it. Such fills and strokes are now left out; an object stays listed while another of its fills or strokes prints the spot color. Pattern Objects and Gradient Objects are unchanged. --- crates/engine/src/cmd/docinfo.rs | 50 ++++++++++++++++++++++++++++---- docs/mcp.md | 3 +- docs/target-app-parity.md | 2 +- 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/docinfo.rs b/crates/engine/src/cmd/docinfo.rs index 4ed63e7ec1..b21bf8178e 100644 --- a/crates/engine/src/cmd/docinfo.rs +++ b/crates/engine/src/cmd/docinfo.rs @@ -18,7 +18,7 @@ pub fn specs() -> Vec { "Document Info", ["Window", "Document Info"], None, - "{selectionOnly?, category?: document|objects|graphicStyles|brushes|spotColors|patterns|gradients|symbols|fonts|fontDetails|linkedImages|embeddedImages|repeats (only that one in sections and the text), format?: \"text\" (→ {text}: the report Document Info › Save… and Package write)} → {document, objects: {paths, compoundPaths, groups, …}, pathLength: pt (the paths' total length, compound paths' included, guides left out), fonts, images, swatches, graphicStyleNames (with selectionOnly: the styles the selected objects are linked to), brushNames (the Brushes panel's brushes; with selectionOnly: the brushes the selected objects' strokes use), repeatObjects: [{id, name, type: radial|grid|mirror, instances, rows?, cols?}] (the Repeat objects, those in groups and other repeats included; with selectionOnly: those in the selection), spotObjects: [{id, name, spotColors}] (the objects filled or stroked with a spot color swatch, as a solid color or in the stops of a gradient with a stop above opacity 0, at a tint above 0, and grayscale images colorized with one, each once, by the rules patternObjects follows, with the spot colors they use; Registration and process colors are not spot colors; objects.spots counts them), spotColorNames and spotColors (the spot colors those objects use), patternObjects: [{id, name, patterns}] (the objects filled or stroked with a pattern, each once, those in groups and type whose drawn characters use one included, hidden fills and strokes, strokes with no width, guides, compound path members' own fills and strokes, images' fills and strokes without a shape and characters that draw nothing left out, with the patterns they use, which objects.patterns counts; with selectionOnly: those in the selection), patternNames (the patterns those objects use), gradientObjects: [{id, name, gradients}] (the objects filled or stroked with a gradient, by the same rules, with the gradients they use: a linked gradient swatch's name, else Linear gradient, Radial gradient or Freeform gradient; objects.gradients counts them), gradientNames (the gradients those objects use), …, sections: [{id, title, rows: [[label, value]]}] (the panel's categories; fontDetails: each font's file and whether its license lets it be embedded)}. An image linked to a file outside the automation read roots has link null, and its Linked Images row names the file alone", + "{selectionOnly?, category?: document|objects|graphicStyles|brushes|spotColors|patterns|gradients|symbols|fonts|fontDetails|linkedImages|embeddedImages|repeats (only that one in sections and the text), format?: \"text\" (→ {text}: the report Document Info › Save… and Package write)} → {document, objects: {paths, compoundPaths, groups, …}, pathLength: pt (the paths' total length, compound paths' included, guides left out), fonts, images, swatches, graphicStyleNames (with selectionOnly: the styles the selected objects are linked to), brushNames (the Brushes panel's brushes; with selectionOnly: the brushes the selected objects' strokes use), repeatObjects: [{id, name, type: radial|grid|mirror, instances, rows?, cols?}] (the Repeat objects, those in groups and other repeats included; with selectionOnly: those in the selection), spotObjects: [{id, name, spotColors}] (the objects filled or stroked with a spot color swatch, as a solid color or in the stops of a gradient with a stop above opacity 0, at a tint above 0, fills and strokes at an opacity of 0 left out, and grayscale images colorized with one, each once, by the rules patternObjects follows, with the spot colors they use; Registration and process colors are not spot colors; objects.spots counts them), spotColorNames and spotColors (the spot colors those objects use), patternObjects: [{id, name, patterns}] (the objects filled or stroked with a pattern, each once, those in groups and type whose drawn characters use one included, hidden fills and strokes, strokes with no width, guides, compound path members' own fills and strokes, images' fills and strokes without a shape and characters that draw nothing left out, with the patterns they use, which objects.patterns counts; with selectionOnly: those in the selection), patternNames (the patterns those objects use), gradientObjects: [{id, name, gradients}] (the objects filled or stroked with a gradient, by the same rules, with the gradients they use: a linked gradient swatch's name, else Linear gradient, Radial gradient or Freeform gradient; objects.gradients counts them), gradientNames (the gradients those objects use), …, sections: [{id, title, rows: [[label, value]]}] (the panel's categories; fontDetails: each font's file and whether its license lets it be embedded)}. An image linked to a file outside the automation read roots has link null, and its Linked Images row names the file alone", has_doc, info ), @@ -344,12 +344,14 @@ type PaintNames<'a> = dyn Fn(&Paint) -> Vec + 'a; /// stroke of a guide (drawn in the guide color), of a compound path's member (`members`: the /// compound path's own fills and strokes paint it) or of type whose layout draws nothing /// (`painted_runs`). An image's fills and strokes paint only where an effect gives them a shape. +/// With `ink` (the spot colors), a fill or stroke at an opacity of 0 prints no ink and is left out. fn own_paints( d: &Document, n: &Node, members: &HashSet<*const Node>, painted_runs: Option<&(&vectorcraft_doc::TextObject, BTreeSet)>, label: &PaintNames<'_>, + ink: bool, ) -> Vec { if matches!(n.kind, NodeKind::Path { guide: true, .. }) || members.contains(&std::ptr::from_ref(n)) @@ -364,7 +366,8 @@ fn own_paints( .then(|| vectorcraft_render::effects::image_paint(Some(d), n).into_iter().flat_map(|(_, _, item)| label(item.paint())).collect()); let mut out: Vec = vec![]; for item in &n.appearance.items { - if !item.visible() || matches!(item, vectorcraft_doc::AppearanceItem::Stroke(s) if s.width <= 0.0) { + let prints = item.opacity() > 0.0; + if !item.visible() || matches!(item, vectorcraft_doc::AppearanceItem::Stroke(s) if s.width <= 0.0) || (ink && !prints) { continue; } for name in label(item.paint()) { @@ -501,9 +504,9 @@ fn info(s: &mut Session, p: &Value) -> Result { } // The spot colors, the patterns and the gradients this object's fills and strokes paint, each once. let painted_runs = painted_runs(d, &spot_swatches, n); - let mut used_spots = own_paints(d, n, &members, painted_runs.as_ref(), &spot_label); - let mut used_patterns = own_paints(d, n, &members, painted_runs.as_ref(), &pattern); - let mut used_gradients = own_paints(d, n, &members, painted_runs.as_ref(), &gradient); + let mut used_spots = own_paints(d, n, &members, painted_runs.as_ref(), &spot_label, true); + let mut used_patterns = own_paints(d, n, &members, painted_runs.as_ref(), &pattern, false); + let mut used_gradients = own_paints(d, n, &members, painted_runs.as_ref(), &gradient, false); // The characters' own paints: an inline graphic draws no outline and does not take its // run's paint (a list marker set in its run does), and a stroke with no width paints // nothing. @@ -1228,6 +1231,43 @@ mod tests { assert_eq!(i["objects"]["spots"].as_u64(), Some(1), "{}", i["objects"]); } + /// Spot Color Objects leaves out a fill or stroke at an opacity of 0, which prints no ink, and + /// keeps the object while another of its fills or strokes prints the spot color. Gradient + /// Objects still lists a clear gradient fill. + #[test] + fn spot_color_objects_skip_clear_fills_and_strokes() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 200, "height": 200})).unwrap(); + s.execute("swatch.new", &json!({"name": "Ink", "color": {"model": "cmyk", "c": 0, "m": 1, "y": 1, "k": 0}, "spot": true})).unwrap(); + let rect = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap()["id"].clone(); + s.execute("paint.setFill", &json!({"ids": [rect], "swatch": "Ink"})).unwrap(); + s.execute("paint.setStroke", &json!({"ids": [rect], "swatch": "Ink"})).unwrap(); + let ramp = s.execute("shape.rectangle", &json!({"x": 50, "y": 0, "width": 10, "height": 10})).unwrap()["id"].clone(); + let stops = json!([{"offset": 0, "color": "#000", "swatch": "Ink"}, {"offset": 1, "color": "#fff", "swatch": "Ink"}]); + s.execute("paint.setFill", &json!({"ids": [ramp], "gradient": {"kind": "linear", "stops": stops}})).unwrap(); + s.execute("paint.setStroke", &json!({"ids": [ramp], "none": true})).unwrap(); + let items = |s: &Session, id: &Value| s.doc().unwrap().doc.node(NodeId(id.as_u64().unwrap())).unwrap().appearance.items.clone(); + let spots = |s: &mut Session| { + let i = s.execute("document.info", &json!({})).unwrap(); + let mut ids: Vec = i["spotObjects"].as_array().unwrap().iter().map(|o| o["id"].as_u64().unwrap()).collect(); + ids.sort_unstable(); + (ids, i["objects"]["spots"].as_u64(), i["objects"]["gradients"].as_u64()) + }; + // The rectangle's fill at an opacity of 0: its stroke still prints the spot color. + s.execute("select.set", &json!({"ids": [rect]})).unwrap(); + let fill = items(&s, &rect).iter().position(|i| matches!(i, vectorcraft_doc::AppearanceItem::Fill(_))).unwrap(); + s.execute("appearance.setItem", &json!({"index": fill, "opacity": 0})).unwrap(); + assert_eq!(spots(&mut s), (vec![rect.as_u64().unwrap(), ramp.as_u64().unwrap()], Some(2), Some(1))); + // Every fill and stroke of both objects at an opacity of 0. + for id in [&rect, &ramp] { + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + for index in 0..items(&s, id).len() { + s.execute("appearance.setItem", &json!({"index": index, "opacity": 0})).unwrap(); + } + } + assert_eq!(spots(&mut s), (vec![], None, Some(1))); + } + /// Document Info › Objects counts an object with a gradient or a pattern on both its fill and /// its stroke once, and with Selection Only a selection that holds a group and an object inside /// it counts that object once. diff --git a/docs/mcp.md b/docs/mcp.md index 84ce94f85a..c4c5ec1303 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6483,7 +6483,8 @@ swatch a gradient is linked to, else `Linear gradient`, `Radial gradient` or `Fr lists them as Gradient Objects and `objects.gradients` counts them; gradient swatches no art uses are not listed; with `selectionOnly`, those in the selection), `gradientNames` (the gradients those objects use), `spotObjects` (`[{id, name, spotColors}]`: every object filled or stroked with a spot color swatch, as a solid color or in the -stops of a gradient with a stop above opacity 0, at a tint above 0, and every grayscale image colorized with one, by +stops of a gradient with a stop above opacity 0, at a tint above 0, leaving out fills and strokes at an opacity of 0, +and every grayscale image colorized with one, by the same rules as `patternObjects`, with the spot colors it uses; a process color, even one of the same color, and Registration are not spot colors; the spotColors category lists them as Spot Color Objects and `objects.spots` counts them; spot swatches no art uses are not listed; with `selectionOnly`, those diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 8e501889db..e9293a52a0 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1394,7 +1394,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Document Info has a Repeat Objects category after Embedded Images. It lists each radial, grid and mirror Repeat object by name with its kind and the number of instances it makes. For a grid it gives the rows and columns instead, followed by the number of instances it draws when that is fewer. With Selection Only it lists the Repeat objects in the selection. The Document Info report and Package's report list them too (`document.info {category: "repeats"}`, `repeatObjects`). Document Info's Pattern Objects category lists the objects whose fill or stroke is a pattern, the category the [Document Info panel](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/document-info-panel.html) page describes, each by name with the patterns it uses. With Selection Only it lists those in the selection, and the Document Info report and Package's report list them too (`document.info {category: "patterns"}`, `patternObjects`). Listing an object with a pattern fill and a pattern stroke once, listing objects inside groups and type objects whose characters use a pattern, and leaving out hidden fills and strokes, strokes with no width, guides, a compound path member's own fills and strokes, an image's fills and strokes without a shape, characters the type does not draw and patterns no art uses, and counting the listed objects in Objects, are VectorCraft's own rules. Test: `cmd::docinfo::tests::info_lists_the_pattern_objects` (vectorcraft-engine). Document Info's Gradient Objects category lists the objects whose fill or stroke is a gradient, the category the [Document Info panel](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/document-info-panel.html) page describes as the count of objects with gradient fills or strokes. Each object is listed by name with the gradients it uses. With Selection Only it lists those in the selection, and the Document Info report and Package's report list them too (`document.info {category: "gradients"}`, `gradientObjects`). Naming a linked gradient by its swatch and any other gradient by its kind, and leaving out paint that draws nothing by the rules Pattern Objects follows, gradient swatches no art uses, gradient meshes and gradients drawn by effects, are VectorCraft's own rules. Objects counts the listed objects as Gradient Objects. Test: `cmd::docinfo::tests::info_lists_the_gradient_objects` (vectorcraft-engine). - Document Info's Spot Color Objects category lists the objects that use spot colors, the category the [Document Info panel](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/document-info-panel.html) page describes as objects using spot color separations. Each object is listed by name with the spot colors it uses. With Selection Only it lists those in the selection, and the Document Info report and Package's report list them too (`document.info {category: "spotColors"}`, `spotObjects`). Taking a solid color or a gradient stop linked to a spot swatch at a tint above 0 and a grayscale image colorized with one, leaving out process colors that look the same, Registration, gradients whose stops are all at an opacity of 0, paint that draws nothing by the rules Pattern Objects follows, spot swatches no art uses and spot colors inside patterns, symbols, opacity masks, effects and placed files, are VectorCraft's own rules. Objects counts the listed objects as Spot Color Objects. Tests: `cmd::docinfo::tests::info_lists_the_spot_color_objects` and `spot_color_objects_take_colorized_images_and_skip_clear_gradients` (vectorcraft-engine). + Document Info's Spot Color Objects category lists the objects that use spot colors, the category the [Document Info panel](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/document-info-panel.html) page describes as objects using spot color separations. Each object is listed by name with the spot colors it uses. With Selection Only it lists those in the selection, and the Document Info report and Package's report list them too (`document.info {category: "spotColors"}`, `spotObjects`). Taking a solid color or a gradient stop linked to a spot swatch at a tint above 0 and a grayscale image colorized with one, leaving out process colors that look the same, Registration, gradients whose stops are all at an opacity of 0, fills and strokes at an opacity of 0, paint that draws nothing by the rules Pattern Objects follows, spot swatches no art uses and spot colors inside patterns, symbols, opacity masks, effects and placed files, are VectorCraft's own rules. Objects counts the listed objects as Spot Color Objects. Tests: `cmd::docinfo::tests::info_lists_the_spot_color_objects`, `spot_color_objects_take_colorized_images_and_skip_clear_gradients` and `spot_color_objects_skip_clear_fills_and_strokes` (vectorcraft-engine). Document Info's Save… writes the category the panel shows, with Selection Only applied, as the [Document Info panel](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/document-info-panel.html) page describes ("Exports the selected category's visible information to a text file"). With All Categories shown it writes every category, which is VectorCraft's own rule (`docInfo.save {category}`). Test: `panels::doc_info::tests::save_writes_the_category_the_panel_shows`. The Brushes panel menu's Select All Unused selects the brushes that are not used in the document, as the [Brushes](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/brushes.html) page (archived copy) describes. A brush counts as used when a stroke paints with it in the art (opacity masks included), in symbols, graph designs, pattern tiles or graphic styles, or in the art of a used brush (`brush.unused`). A rename in Brush Options and Delete Brush change every stroke that paints with the brush: in the layers and opacity masks, symbols, graph designs, pattern tiles, graphic styles and the art of other brushes. A rename gives those strokes the new name, and Delete Brush makes them plain strokes, in one undo step. From 7998954a95ba3651629cc63251cddd60fbb51ab1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 13:46:37 -0800 Subject: [PATCH 04/15] Cutting Tools: weeding lines stop at an outline that lies on a line A weeding line at v0 + k*step can round just past the edge of an outline segment that lies on it: across 0.1 to 0.5 the one line sits at 0.30000000000000004, and (0.30000000000000004 - 0.1) / 0.2 is 1.0000000000000002. The candidate range for that segment then came out empty, so the line was not stopped there and ran over the art's edge. The candidate range is now widened by a small tolerance before rounding; `near` still leaves out lines the segment does not meet. docs/mcp.md and the params text of `addon.cutting.weed` now state the `spacing` range (more than 0, at most 100000 pt), the 1000-line limit each way, and that a request giving both `count` and `spacing` is refused. --- crates/engine/src/cmd/addons/cutting/weed.rs | 2 +- .../src/cmd/addons/cutting/weed/geometry.rs | 7 ++++--- .../src/cmd/addons/cutting/weed/tests.rs | 18 ++++++++++++++++++ docs/mcp.md | 7 ++++--- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/addons/cutting/weed.rs b/crates/engine/src/cmd/addons/cutting/weed.rs index a05770a024..e5873d08d6 100644 --- a/crates/engine/src/cmd/addons/cutting/weed.rs +++ b/crates/engine/src/cmd/addons/cutting/weed.rs @@ -40,7 +40,7 @@ pub fn specs() -> Vec { "Weed Box and Lines…", ["Object", "Plug-ins", "Cutting Tools"], None, - "{margin?: pt 0..100000 (9: from the art to the weed box), box?: true (false: the weeding lines only), direction?: \"horizontal\" | \"vertical\" | \"both\" (\"both\"), count?: whole number 0..1000 of lines each way (1), spacing?: pt (instead of count: as few lines as keep them at most this far apart), gap?: pt 0..100000 (0: the lines stop at the art's outlines), weight?: pt 0.01..1000 (0.3), swatch?: a color swatch the lines are stroked in (\"[Registration]\")} add a weed box around the selected art and weeding lines across it that divide it evenly, each running from one side of the box to the other and left out over the art and within `gap` of its outlines, so the waste lifts off in pieces. The art is measured by the outlines a cutter cuts: closed paths enclose their area by their fill rule and open paths are lines, compound paths by all their subpaths, type by its glyph outlines, a clip group by what shows inside its clipping path, images by their frames, placed files by the art they show (by their boxes when the file can't be read), symbol instances by their art and live objects by the art they draw; strokes, effects and hidden objects are left out. One group named Weeding, stroked with no fill, on top of the current layer (outside the clip groups around a group edited in isolation), selected, as one undo step → {id: the group, box: its weed box or null, lines (pieces of weeding line)}", + "{margin?: pt 0..100000 (9: from the art to the weed box), box?: true (false: the weeding lines only), direction?: \"horizontal\" | \"vertical\" | \"both\" (\"both\"), count?: whole number 0..1000 of lines each way (1), spacing?: pt more than 0, at most 100000 (instead of count, never with it: as few lines as keep them at most this far apart, up to 1000 each way), gap?: pt 0..100000 (0: the lines stop at the art's outlines), weight?: pt 0.01..1000 (0.3), swatch?: a color swatch the lines are stroked in (\"[Registration]\")} add a weed box around the selected art and weeding lines across it that divide it evenly, each running from one side of the box to the other and left out over the art and within `gap` of its outlines, so the waste lifts off in pieces. The art is measured by the outlines a cutter cuts: closed paths enclose their area by their fill rule and open paths are lines, compound paths by all their subpaths, type by its glyph outlines, a clip group by what shows inside its clipping path, images by their frames, placed files by the art they show (by their boxes when the file can't be read), symbol instances by their art and live objects by the art they draw; strokes, effects and hidden objects are left out. One group named Weeding, stroked with no fill, on top of the current layer (outside the clip groups around a group edited in isolation), selected, as one undo step → {id: the group, box: its weed box or null, lines (pieces of weeding line)}", has_selection, weed )] diff --git a/crates/engine/src/cmd/addons/cutting/weed/geometry.rs b/crates/engine/src/cmd/addons/cutting/weed/geometry.rs index 4642031e71..0db89fb2ee 100644 --- a/crates/engine/src/cmd/addons/cutting/weed/geometry.rs +++ b/crates/engine/src/cmd/addons/cutting/weed/geometry.rs @@ -723,12 +723,13 @@ pub(super) fn lines(region: &Region, outline: &[Segment], frame: Rect, n: Counts continue; } // The lines (0-based) each outline segment comes within `gap` of: lines k (1-based) lie at - // v0 + k·step. + // v0 + k·step. The range is widened by a small tolerance so that a line whose position + // rounds just past a segment's end is still measured; `near` drops lines the segment misses. let reach = |&(a, b): &Segment| { let (va, vb) = (uv(a, vertical).1, uv(b, vertical).1); let (lo, hi) = (va.min(vb) - gap, va.max(vb) + gap); - let first = ((lo - v0) / step).ceil().max(1.0); - let last = ((hi - v0) / step).floor().min(count as f64); + let first = ((lo - v0) / step - 1e-9).ceil().max(1.0); + let last = ((hi - v0) / step + 1e-9).floor().min(count as f64); if step > 0.0 && first <= last { (first as usize - 1)..(last as usize) } else { 0..0 } }; // The outlines near each line, found once for all of them, by index into `outline`. diff --git a/crates/engine/src/cmd/addons/cutting/weed/tests.rs b/crates/engine/src/cmd/addons/cutting/weed/tests.rs index 1003ef1db3..69114f8991 100644 --- a/crates/engine/src/cmd/addons/cutting/weed/tests.rs +++ b/crates/engine/src/cmd/addons/cutting/weed/tests.rs @@ -541,6 +541,24 @@ fn indexed_crossings_find_the_same_stretches() { } } +/// An outline that lies on a weeding line stops it even when the line's position rounds just past +/// the outline's: the one line across 0.1 to 0.5 lies at 0.1 + 0.2, which is 0.30000000000000004, +/// and (0.30000000000000004 - 0.1) / 0.2 is 1.0000000000000002. +#[test] +fn an_outline_on_a_rounded_line_position_stops_the_line() { + let doc = vectorcraft_doc::Document::new(800.0, 600.0); + let c = 0.1 + 0.2; + let mut p = BezPath::new(); + p.move_to((20.0, c)); + p.line_to((80.0, c)); + let n = Node::path(NodeId(1), PathData::from_bezpath(&p), Appearance::default()); + let region = super::geometry::Reader::new(&doc).read(&[&n]).unwrap().unwrap(); + let outline = region.outline().unwrap(); + let counts = super::geometry::Counts { horizontal: 1, vertical: 0 }; + let pieces = super::geometry::lines(®ion, &outline, Rect::new(0.0, 0.1, 100.0, 0.5), counts, 0.0, 100).unwrap(); + assert_eq!(pieces, [(Point::new(0.0, c), Point::new(20.0, c)), (Point::new(80.0, c), Point::new(100.0, c))]); +} + #[test] fn art_nested_too_deep_is_refused() { // A rectangle inside `levels` groups, each holding the next. A document keeps none this deep, diff --git a/docs/mcp.md b/docs/mcp.md index 84ce94f85a..1a5b2e388c 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -9966,9 +9966,10 @@ selected art and weeding lines across the box, so the waste vinyl around the art VectorCraft's own. The weed box is a rectangle `margin` points (0 to 100000, default 9) outside the art's bounds; `box: false` leaves it out. The weeding lines run `"horizontal"`, `"vertical"` or `"both"` ways (default `"both"`) from one side of the box to the other and divide it evenly: `count` lines each way (a whole number from 0 to 1000, default 1), -or with `spacing` instead, as few lines as keep them at most that far apart. A line is left out over the art's area and -within `gap` points of its outlines (0 to 100000, default 0: the lines stop at the outlines), so it ends in several -pieces, each a straight path. The lines and the box are stroked `weight` points wide (0.01 to 1000, default 0.3) in the +or with `spacing` points instead (more than 0 and at most 100000), as few lines as keep them at most that far apart. A +`spacing` that needs more than 1000 lines each way is refused, and so is a request that gives both `count` and +`spacing`. A line is left out over the art's area and within `gap` points of its outlines (0 to 100000, default 0: the +lines stop at the outlines), so it ends in several pieces, each a straight path. The lines and the box are stroked `weight` points wide (0.01 to 1000, default 0.3) in the color swatch `swatch` (default `"[Registration]"`), with no fill. The art is measured by the outlines a cutter cuts. Closed paths enclose their area by their fill rule, so the hole of a From 31b669a0a1f5124e6b1a50130db2c4b3f0e8ac59 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 13:22:45 -0800 Subject: [PATCH 05/15] Recolor Artwork: the Color Theme Picker picks new colors from the art on the canvas The Color Theme Picker button beside the Assign and Edit tabs turns on picking from the canvas. A click takes the color palette of the object a Selection tool click takes there, a drag takes the palette of the art inside its marquee, and Shift adds more picks. The rows that are not excluded take the palette as their new colors and the art previews them; OK keeps the recolor as one undo step. - recolor.pickTheme {picks, colors?} returns the palette of the art picked: visible fills and strokes, gradient stops, text, mesh points, pattern tiles, symbol art, colorize colors and image pixels. Clip groups, clipping opacity masks and isolation mode limit it to what shows, and it changes nothing. - Each object read weighs the same; similar colors merge (k-means in Lab) into at most `colors`, most used first. Image reads are bounded (65,536 pixels a pick, 1,048,576 pixels and 64 images in all), and past 4,096 distinct colors, close colors merge before clustering. - The dialog's themePicker and themePicks fields drive it from ui.dialog.set. A new Colors count keeps the picks. --- crates/color/src/recolor.rs | 115 +++ crates/doc/src/hit.rs | 6 +- crates/doc/src/lib.rs | 2 +- crates/doc/src/pixels.rs | 72 ++ crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + crates/engine/src/cmd/recolor.rs | 819 ++++++++++++++++++ crates/engine/src/tests/recolor.rs | 269 ++++++ crates/ui-egui/src/dialogs/recolor.rs | 250 +++++- crates/ui-egui/src/i18n/bg.tsv | 2 + crates/ui-egui/src/i18n/bs.tsv | 2 + crates/ui-egui/src/i18n/ca.tsv | 2 + crates/ui-egui/src/i18n/cs.tsv | 2 + crates/ui-egui/src/i18n/da.tsv | 2 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 2 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fi.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/hi.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 2 + crates/ui-egui/src/i18n/id.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 2 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ka.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 2 + crates/ui-egui/src/i18n/pl.tsv | 2 + crates/ui-egui/src/i18n/pt-br.tsv | 2 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sv.tsv | 2 + crates/ui-egui/src/i18n/tr.tsv | 2 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + docs/mcp.md | 21 + docs/ui-parity.md | 2 + 37 files changed, 1605 insertions(+), 6 deletions(-) diff --git a/crates/color/src/recolor.rs b/crates/color/src/recolor.rs index 5117f16a36..93c0ad0f37 100644 --- a/crates/color/src/recolor.rs +++ b/crates/color/src/recolor.rs @@ -485,6 +485,88 @@ pub fn cluster(colors: &[Color], weights: &[f32], n: usize) -> Vec> { rows } +/// The distinct colors [`theme_palette`] clusters, at most. +const THEME_CANDIDATES: usize = 4096; + +/// The color palette of the weighted colors `samples` (color, weight), for Recolor Artwork's Color +/// Theme Picker: at most `n` colors. The same color given twice counts once with both weights, +/// and past [`THEME_CANDIDATES`] distinct colors, colors close in Lab merge into the heaviest of +/// them first. +/// The colors are grouped as [`cluster`] groups them, each group shows its heaviest color (a color +/// of `samples`, in its own model; on a tie the one given first), and the heaviest group comes +/// first (on a tie the group whose first color was given first). Samples without a positive, +/// finite weight are left out, so no samples give no colors. +pub fn theme_palette(samples: &[(Color, f32)], n: usize) -> Vec { + let mut index: std::collections::HashMap = std::collections::HashMap::new(); + let mut colors: Vec = vec![]; + let mut weights: Vec = vec![]; + for (c, w) in samples { + if !(w.is_finite() && *w > 0.0) { + continue; + } + let i = *index.entry(ColorKey::of(c)).or_insert_with(|| { + colors.push(*c); + weights.push(0.0); + colors.len() - 1 + }); + weights[i] += w; + } + if colors.is_empty() || n == 0 { + return vec![]; + } + // At most THEME_CANDIDATES colors are clustered: past that, colors in the same cube of Lab + // space merge into the heaviest of them, the cubes doubling in size until few enough remain. + if colors.len() > THEME_CANDIDATES { + let labs: Vec<[f32; 3]> = colors + .iter() + .map(|c| { + let l = c.to_lab(); + [l.l, l.a, l.b] + }) + .collect(); + let mut side = 2.0f32; + loop { + let mut cube: std::collections::HashMap<[i32; 3], usize> = std::collections::HashMap::new(); + let (mut top, mut sum): (Vec, Vec) = (vec![], vec![]); + for (i, lab) in labs.iter().enumerate() { + let k = lab.map(|v| (v / side).floor() as i32); + match cube.get(&k) { + Some(&j) => { + sum[j] += weights[i]; + if weights[i] > weights[top[j]] { + top[j] = i; + } + } + None => { + cube.insert(k, top.len()); + top.push(i); + sum.push(weights[i]); + } + } + } + if top.len() <= THEME_CANDIDATES { + colors = top.iter().map(|&i| colors[i]).collect(); + weights = sum; + break; + } + side *= 2.0; + } + } + let mut groups: Vec<(f32, usize, Color)> = cluster(&colors, &weights, n) + .into_iter() + .filter_map(|g| { + let total: f32 = g.iter().map(|&i| weights[i]).sum(); + let top = g.iter().copied().fold(None::, |best, i| match best { + Some(b) if weights[b] >= weights[i] => Some(b), + _ => Some(i), + })?; + Some((total, *g.first()?, colors[top])) + }) + .collect(); + groups.sort_by(|a, b| b.0.total_cmp(&a.0).then(a.1.cmp(&b.1))); + groups.into_iter().map(|g| g.2).collect() +} + /// A set of colours to snap to (Limit to Library), with their Lab values cached. #[derive(Clone, Debug, Default)] pub struct Palette(Vec<(Color, Lab)>); @@ -691,6 +773,39 @@ mod tests { assert!(cluster(&[], &[], 3).is_empty()); } + /// The Color Theme Picker's palette: similar colors merge, each group shows its heaviest + /// color in its own model, and the heaviest group comes first. + #[test] + fn theme_palette_takes_the_heaviest_color_of_each_group_heaviest_first() { + let red = Color::rgb(1.0, 0.0, 0.0); + let pink = Color::rgb(1.0, 0.2, 0.2); + let blue = Color::cmyk(1.0, 0.8, 0.0, 0.0); + let navy = Color::cmyk(1.0, 0.9, 0.0, 0.3); + let samples = [(pink, 1.0), (blue, 2.0), (red, 3.0), (navy, 2.5), (red, 0.5)]; + // Blue and navy weigh 4.5, and so do red (3 + 0.5, its two samples add up) and pink. + assert_eq!(theme_palette(&samples, 2), vec![red, navy], "a tie: the group given first"); + let samples = [(pink, 1.0), (blue, 2.0), (red, 3.0), (navy, 1.0)]; + assert_eq!(theme_palette(&samples, 2), vec![red, blue], "heaviest group first, its heaviest color"); + assert_eq!(theme_palette(&samples, 9).len(), 4, "never more colors than given"); + assert_eq!(theme_palette(&samples, 1), vec![red]); + assert!(theme_palette(&samples, 0).is_empty()); + assert!(theme_palette(&[(red, 0.0), (blue, f32::NAN), (pink, -1.0)], 3).is_empty(), "no weight, no colors"); + assert!(theme_palette(&[], 3).is_empty()); + } + + /// Past 4,096 distinct colors, close colors merge before clustering: the palette still keeps + /// a heavy color apart from thousands of light ones. + #[test] + fn theme_palette_merges_close_colors_past_its_candidate_limit() { + let mut samples: Vec<(Color, f32)> = (0..20_000).map(|i| (Color::rgb(0.0, 0.0, 0.3 + 0.7 * i as f32 / 20_000.0), 0.001)).collect(); + samples.extend((0..20_000).map(|i| (Color::rgb(1.0, 0.8 * i as f32 / 20_000.0, 0.0), 0.0001))); + samples.push((Color::rgb(0.0, 1.0, 0.0), 50.0)); + let p = theme_palette(&samples, 3); + assert_eq!(p.len(), 3); + assert_eq!(p[0], Color::rgb(0.0, 1.0, 0.0), "the heavy green first, exactly as given"); + assert!(p[1].to_hsb()[0] > 180.0 && p[2].to_hsb()[0] < 90.0, "then the blues, then the reds and oranges: {p:?}"); + } + #[test] fn hue_shift_with_own_model_puts_every_colour_of_the_row_in_the_new_model() { let to = Color::cmyk(0.0, 1.0, 1.0, 0.0); diff --git a/crates/doc/src/hit.rs b/crates/doc/src/hit.rs index 6eae9c1488..fd907a26cc 100644 --- a/crates/doc/src/hit.rs +++ b/crates/doc/src/hit.rs @@ -569,7 +569,7 @@ fn clip_contains(clip: &Node, p: Point) -> bool { /// The regions `clip` clips to ([`Node::clip_shapes`]), text counted by its frame as in /// [`clip_contains`]. -fn clip_regions(clip: &Node) -> Vec<(vectorcraft_geom::BezPath, vectorcraft_geom::FillRule)> { +pub fn clip_regions(clip: &Node) -> Vec<(vectorcraft_geom::BezPath, vectorcraft_geom::FillRule)> { let frame = |n: &Node| { let b = n.geometric_bounds()?; Some(Node::path(n.id, vectorcraft_geom::shapes::rectangle(b), Default::default())) @@ -640,7 +640,7 @@ fn source_of(n: &Node, scope: Option) -> bool { /// Do clicks and marquees skip the child `i` of `parent` with `scope` isolated? For a Shaper /// Group that is its original shapes (its first child), or, in Construction mode, when they are /// isolated, the art the group shows. -fn shaper_hides(parent: &Node, i: usize, scope: Option) -> bool { +pub fn shaper_hides(parent: &Node, i: usize, scope: Option) -> bool { parent.extras().shaper.is_some() && (i == 0) != source_of(parent, scope) } @@ -1356,7 +1356,7 @@ fn marquee_with(doc: &Document, r: Rect, scope: Option, leaves: bool, wh /// The part of a marquee `r` in which it can touch the children of `parent`. For a clip group or a /// layer with a clipping mask, this is what [`marquee_in_clip`] returns for its clipping path (None /// when the marquee misses it); otherwise it is all of `r`. -fn marquee_in(parent: &Node, r: Rect) -> Option { +pub fn marquee_in(parent: &Node, r: Rect) -> Option { match parent.children().and_then(|c| c.first()) { Some(clip) if parent.clips() => marquee_in_clip(clip, r), _ => Some(r), diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rs index 2c5759f202..d183394651 100644 --- a/crates/doc/src/lib.rs +++ b/crates/doc/src/lib.rs @@ -51,7 +51,7 @@ pub mod overprint; pub mod pattern; pub mod perspective; mod pixels; -pub use pixels::{GraySource, MAX_RASTER_ALLOC}; +pub use pixels::{GraySource, MAX_RASTER_ALLOC, PixelPick}; pub mod placed_document; pub mod plugin_data; pub mod profiles; diff --git a/crates/doc/src/pixels.rs b/crates/doc/src/pixels.rs index 30d8a7a63b..7edf64eb5e 100644 --- a/crates/doc/src/pixels.rs +++ b/crates/doc/src/pixels.rs @@ -11,6 +11,10 @@ use crate::ImageBlob; /// address and aborts when an allocation fails, so it keeps the decoder's own 512 MB. pub const MAX_RASTER_ALLOC: u64 = if cfg!(target_arch = "wasm32") { 512 << 20 } else { 2 << 30 }; +/// A box of an image to sample, in 0 to 1 units of its width and height (`None`: all of it), and +/// the pixel centres to take from it ([`ImageBlob::sample_pixels`]). +pub type PixelPick<'a> = (Option<[f64; 4]>, &'a dyn Fn(f64, f64) -> bool); + /// The pixels of encoded image `bytes` as RGBA; `None` when they can't be decoded, would take /// more than `max` bytes as RGBA, or need more than `max` bytes to decode. The size is read from /// the header first: the decoder's limit is on the file's samples, and a gray image is a quarter @@ -61,6 +65,49 @@ impl ImageBlob { Some(Self::png(png)) } + /// For each of `picks`, at most `budget` of the image's pixels (at least one), spread evenly + /// in rows and columns over the pick's box (`[u0, v0, u1, v1]`, where 0 to 1 spans the + /// image's width and height from the top left; clipped to the image; `None`: the whole image), + /// as straight RGBA. Only pixels whose centres the pick's function takes (in the same 0 to 1 + /// units) are given. The image is decoded once for all the picks. `None` when it can't be + /// decoded within [`MAX_RASTER_ALLOC`]. + pub fn sample_pixels(&self, picks: &[PixelPick<'_>], budget: usize) -> Option>> { + let img = rgba_within(&self.bytes, MAX_RASTER_ALLOC)?; + let (w, h) = img.dimensions(); + let (fw, fh) = (f64::from(w), f64::from(h)); + let span = |a: f64, b: f64, n: f64| { + let (a, b) = (a.min(b), a.max(b)); + ((a * n).floor().clamp(0.0, n) as u32, (b * n).ceil().clamp(0.0, n) as u32) + }; + let sample = |area: Option<[f64; 4]>, keep: &dyn Fn(f64, f64) -> bool| { + let [u0, v0, u1, v1] = area.unwrap_or([0.0, 0.0, 1.0, 1.0]); + let (x0, x1) = span(u0, u1, fw); + let (y0, y1) = span(v0, v1, fh); + if x0 >= x1 || y0 >= y1 { + return vec![]; + } + // Rows and columns in proportion to the box, at most `budget` cells in all. + let (bw, bh, budget) = (f64::from(x1 - x0), f64::from(y1 - y0), budget.max(1) as f64); + let (sx, sy) = if bw * bh <= budget { + (1, 1) + } else { + let rows = (budget * bh / bw).sqrt().floor().clamp(1.0, bh.min(budget)); + let cols = (budget / rows).floor().clamp(1.0, bw); + ((bw / cols).ceil() as usize, (bh / rows).ceil() as usize) + }; + let mut out = vec![]; + for y in (y0..y1).step_by(sy) { + for x in (x0..x1).step_by(sx) { + if keep((f64::from(x) + 0.5) / fw, (f64::from(y) + 0.5) / fh) { + out.push(img.get_pixel(x, y).0); + } + } + } + out + }; + Some(picks.iter().map(|(area, keep)| sample(*area, *keep)).collect()) + } + /// The image as a grayscale PNG: `f` gives each pixel's gray level from its (straight) RGB, and /// the PNG has an alpha channel only when some pixel isn't opaque. `f` runs once per distinct /// color. `None` when the image can't be decoded, or when its file stores grayscale already @@ -276,6 +323,31 @@ mod tests { image::load_from_memory(&b.bytes).unwrap().to_rgba8().pixels().map(|p| p.0).collect() } + /// Sampling reads the pixels of a box of the image, spread to about the budget, and only those + /// whose centres `keep` takes. + #[test] + fn sampled_pixels_stay_in_their_box_and_budget() { + // 4 × 2: a red left half and a blue right half. + let (r, b) = ([255, 0, 0, 255], [0, 0, 255, 255]); + let img = blob(&[r, r, b, b, r, r, b, b], 4, 2); + let any = |_: f64, _: f64| true; + let one = |b: &ImageBlob, area: Option<[f64; 4]>, budget: usize| b.sample_pixels(&[(area, &any)], budget).unwrap().remove(0); + assert_eq!(one(&img, None, 100).len(), 8, "the budget covers every pixel"); + assert_eq!(one(&img, Some([0.5, 0.0, 1.0, 1.0]), 100), vec![b; 4], "the right half"); + assert_eq!(one(&img, Some([1.0, 1.0, 0.5, 0.0]), 100), vec![b; 4], "a box given backwards"); + assert!(one(&img, Some([2.0, 0.0, 3.0, 1.0]), 100).is_empty(), "outside the image"); + assert_eq!(one(&img, None, 2).len(), 2, "every second pixel of every second row"); + assert_eq!(one(&img, None, 0), vec![r], "a budget of 0 counts as 1"); + let left = |u: f64, _: f64| u < 0.5; + let both = img.sample_pixels(&[(None, &left), (Some([0.5, 0.0, 1.0, 1.0]), &any)], 100).unwrap(); + assert_eq!(both, vec![vec![r; 4], vec![b; 4]], "several picks, each with the centres its function takes"); + // A narrow image keeps to the budget too. + let tall = blob(&vec![r; 5000], 1, 5000); + let n = one(&tall, None, 100).len(); + assert!((50..=100).contains(&n), "{n} pixels"); + assert!(ImageBlob::png(b"not a png".to_vec()).sample_pixels(&[(None, &any)], 100).is_none()); + } + /// A GIF whose `w` × `h` screen holds one opaque red pixel at the top left. The file holds no /// other pixels, and the decoder makes them transparent. fn gif_with_one_red_pixel(w: u16, h: u16) -> Vec { diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index 060791972f..bc41b2c585 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -467,6 +467,7 @@ pub(super) const ALLOWED: &[&str] = &[ "perspective.transform", "recolor.apply", "recolor.colors", + "recolor.pickTheme", "recolor.randomize", "recolor.reduce", "select.add", diff --git a/crates/engine/src/cmd/recolor.rs b/crates/engine/src/cmd/recolor.rs index 74347caa04..34091017e3 100644 --- a/crates/engine/src/cmd/recolor.rs +++ b/crates/engine/src/cmd/recolor.rs @@ -11,6 +11,7 @@ use vectorcraft_color::recolor::{ColorKey, GlobalAdjust, Method, Preserve, Rng, use vectorcraft_color::{Color, Paint, Swatch}; use vectorcraft_doc::swatches::{node_colors, node_paints, override_paints}; use vectorcraft_doc::{Document, Node, NodeId, NodeKind}; +use vectorcraft_geom::{Point, Rect}; use super::colorcmds::{NotChanged, Recolor, Scope, left_out}; use super::{CommandSpec, Result, Session, always, bad, checked_ids_param, cmd, color_value, has_doc, index, str_param, switch_or, text_param}; @@ -53,9 +54,827 @@ pub fn specs() -> Vec { always, randomize ), + cmd!( + query "recolor.pickTheme", + "Color Theme Picker", + [], + None, + "{picks: [{at: [x, y]} (a click: the object a Selection tool click there takes, with everything inside it) | {rect: [x0, y0, x1, y1]} (a marquee: every painted object it touches, and the part of each image inside it)] (1 to 256, in document points), colors?: 5 (1 to 64)} → {colors: [colour keys, the most used first], objects: the number of objects read} the colour palette of the art picked, for Recolor Artwork's Color Theme Picker: visible fills and strokes, gradient stops, text, mesh points, pattern tiles (with the patterns they use), the art of symbol instances (placed through their 9-slice guides), the colorize colour of an image it applies to and other images' pixels (at most 65,536 pixels of each pick of an image, spread evenly, and 1,048,576 pixels of at most 64 images in all; pixels less than half opaque and images that can't be decoded are left out). In a clip group, or under an opacity mask that clips, only what shows inside the clipping path or the mask art is read; a blend, envelope or repeat a marquee touches is read whole. Hidden or fully transparent objects and fill or stroke items are left out; locked objects are read. Each object read weighs the same, shared among its colours (an image's among its pixels; the vector art a symbol instance places counts as one object, each image it places on its own); similar colours merge (k-means in Lab) into at most `colors`, each shown by its most used colour in its own model. Picks that touch no art give no colours. Changes nothing", + has_doc, + pick_theme + ), ] } +/// The pixels one read of an image by the Color Theme Picker takes, at most, the pixels all its +/// reads share, and the images one pick reads, at most. +const THEME_PIXELS: usize = 65_536; +const THEME_TOTAL_PIXELS: usize = 1 << 20; +const MAX_THEME_IMAGES: usize = 64; +/// The image reads one pick queues, at most. +const MAX_THEME_READS: usize = 4096; +/// The stroke segments the opacity masks one pick reads are outlined along, at most. +const MASK_OUTLINE_SEGMENTS: usize = 20_000; +/// The point-in-region tests one pick makes to find whether outlines show through clip groups, +/// and the clipping-path elements the pixels of one image are tested against, at most. +const THEME_WORK: usize = 4_000_000; +/// The picks one `recolor.pickTheme` takes, and the colours it gives, at most. +const MAX_PICKS: usize = 256; +const MAX_THEME_COLORS: u64 = 64; +/// The objects the Color Theme Picker reads through, one inside another, at most. +const MAX_THEME_DEPTH: usize = 256; + +/// A pick of the Color Theme Picker: a click at a point or a marquee. +enum Pick { + At(Point), + Area(Rect), +} + +impl Pick { + /// `{at: [x, y]}` or `{rect: [x0, y0, x1, y1]}`, finite numbers. + fn param(v: &Value, cmd: &str) -> Result { + let numbers = |a: &Value, n: usize| -> Option> { + let a = a.as_array().filter(|a| a.len() == n)?; + a.iter().map(|x| x.as_f64().filter(|x| x.is_finite())).collect() + }; + match (v.get("at"), v.get("rect")) { + (Some(at), None) => { + numbers(at, 2).map(|p| Pick::At(Point::new(p[0], p[1]))).ok_or_else(|| bad(cmd, format!("`at` must be [x, y] (got {at})"))) + } + (None, Some(r)) => numbers(r, 4) + .map(|r| Pick::Area(Rect::new(r[0], r[1], r[2], r[3]).abs())) + .ok_or_else(|| bad(cmd, format!("`rect` must be [x0, y0, x1, y1] (got {r})"))), + _ => Err(bad(cmd, format!("each pick is {{at: [x, y]}} or {{rect: [x0, y0, x1, y1]}} (got {v})"))), + } + } +} + +/// A filled region: its outline and fill rule. +type Region = (vectorcraft_geom::BezPath, vectorcraft_geom::FillRule); + +/// An image the Color Theme Picker reads: its pixels, where it lies, the marquee it is read in +/// (`None`: all of it) and the region the clip groups around it show (`None`: unclipped). An +/// image its colorize paint applies to ([`vectorcraft_doc::ImageBlob::takes_colorize`]) gives that +/// paint's colours where a pixel read shows ink (opaque and darker than white). +#[derive(Clone)] +struct ImageRead<'a> { + blob: &'a vectorcraft_doc::ImageBlob, + xf: vectorcraft_geom::Affine, + size: (f64, f64), + area: Option, + clip: Option>, + colorize: Option>, +} + +/// The colours the Color Theme Picker has read: each object weighs 1, shared among its colours. +struct Theme<'a> { + d: &'a Document, + boxes: vectorcraft_doc::SymbolBoxes<'a>, + samples: Vec<(Color, f32)>, + /// The images to read, each image decoded once for all its reads ([`Self::read_images`]), + /// and the images they read. + images: Vec>, + blobs: std::collections::HashSet<*const vectorcraft_doc::ImageBlob>, + /// What the clip groups being read show, in document space: the union of these regions + /// (none: nothing shows); `None` outside clip groups. + clip: Option>, + /// The colours of the patterns read so far, and the patterns whose tiles are being read. + pattern_colors: HashMap, Vec>)>, + pattern_stack: Vec, + /// The region tests [`Self::shows`] has made. + work: std::cell::Cell, + /// The object isolated in isolation mode. + scope: Option, + /// The stroke segments opacity masks may still be outlined along ([`mask_regions`]). + mask_budget: usize, + objects: usize, +} + +/// The region both `a` and `b` (each a union of regions) cover, filled non-zero. +fn intersect_regions(a: &[Region], b: &[Region]) -> Vec { + let paths: Vec = a.iter().chain(b).map(|(bp, _)| vectorcraft_geom::PathData::from_bezpath(bp)).collect(); + let inputs: Vec<(&vectorcraft_geom::PathData, vectorcraft_geom::FillRule)> = + paths.iter().zip(a.iter().chain(b)).map(|(p, (_, rule))| (p, *rule)).collect(); + let split = a.len(); + let both = vectorcraft_pathops::boolean_n(&inputs, |inside| inside.iter().any(|i| *i < split) && inside.iter().any(|i| *i >= split)); + if both.subpaths.is_empty() { vec![] } else { vec![(both.to_bezpath(), vectorcraft_geom::FillRule::NonZero)] } +} + +impl<'a> Theme<'a> { + fn new(d: &'a Document) -> Self { + Self { + d, + boxes: d.symbol_boxes(), + samples: vec![], + images: vec![], + blobs: std::collections::HashSet::new(), + clip: None, + pattern_colors: HashMap::new(), + pattern_stack: vec![], + work: std::cell::Cell::new(0), + scope: None, + mask_budget: MASK_OUTLINE_SEGMENTS, + objects: 0, + } + } + + fn add(&mut self, colors: Vec) { + if colors.is_empty() { + return; + } + let w = 1.0 / colors.len() as f32; + self.samples.extend(colors.into_iter().map(|c| (c, w))); + self.objects += 1; + } + + /// Read the images queued, each image's pixels decoded once, as colours: the pixels a read + /// gives that fall in one cell of 16 levels a channel merge into their average, weighted by how + /// many there are, and the cells of all the reads add up, so the images give at most 16³ + /// colours. Images that can't be decoded give none. The first [`MAX_THEME_IMAGES`] images + /// are read, and all the reads share [`THEME_TOTAL_PIXELS`] pixels (each read at least one, at + /// most [`THEME_PIXELS`]). + fn read_images(&mut self) { + let reads = std::mem::take(&mut self.images); + // The reads of each image, in the order its first read came. + let mut by_image: Vec<(*const vectorcraft_doc::ImageBlob, Vec<&ImageRead>)> = vec![]; + for r in &reads { + let key: *const vectorcraft_doc::ImageBlob = r.blob; + match by_image.iter().position(|(k, _)| *k == key) { + Some(i) => by_image[i].1.push(r), + None if by_image.len() < MAX_THEME_IMAGES => by_image.push((key, vec![r])), + None => {} + } + } + let count: usize = by_image.iter().map(|(_, g)| g.len()).sum(); + let budget = (THEME_TOTAL_PIXELS / count.max(1)).clamp(1, THEME_PIXELS); + let mut pixels: HashMap<[u8; 3], ([f64; 3], f64)> = HashMap::new(); + for (_, group) in by_image { + let keeps: Vec bool + '_>> = group + .iter() + .map(|r| { + let (xf, (w, h), area, clip) = (r.xf, r.size, r.area, &r.clip); + Box::new(move |u: f64, v: f64| { + let p = xf * Point::new(u * w, v * h); + area.is_none_or(|a| a.contains(p)) + && clip.as_ref().is_none_or(|rs| rs.iter().any(|(bp, rule)| vectorcraft_geom::hit::fill_contains(bp, *rule, p))) + }) as Box bool + '_> + }) + .collect(); + let picks: Vec = group + .iter() + .zip(&keeps) + .map(|(r, keep)| { + use vectorcraft_geom::kurbo::Shape; + let (w, h) = r.size; + let inv = r.xf.inverse(); + // The box sampled: the marquee, cut to the clipping paths' bounds, so a small + // region a clip shows of a large image is still sampled densely. + let clip_box = r.clip.as_ref().map(|rs| rs.iter().map(|(bp, _)| bp.bounding_box()).reduce(|a, b| a.union(b)).unwrap_or_default()); + let region = match (r.area, clip_box) { + (Some(a), Some(c)) => Some(a.intersect(c)), + (a, c) => a.or(c), + }; + let box_uv = region.map(|a| { + let uv: Vec = + [(a.x0, a.y0), (a.x1, a.y0), (a.x0, a.y1), (a.x1, a.y1)].into_iter().map(|(x, y)| inv * Point::new(x, y)).collect(); + let low = |f: fn(&Point) -> f64| uv.iter().map(f).fold(f64::INFINITY, f64::min); + let high = |f: fn(&Point) -> f64| uv.iter().map(f).fold(f64::NEG_INFINITY, f64::max); + [low(|p| p.x) / w, low(|p| p.y) / h, high(|p| p.x) / w, high(|p| p.y) / h] + }); + (box_uv, keep.as_ref()) + }) + .collect(); + // Each sampled pixel inside a clip group is tested against the clipping regions: the + // pixels one image gives keep that work within THEME_WORK path elements. + let elements = + group.iter().map(|r| r.clip.as_ref().map_or(0, |rs| rs.iter().map(|(bp, _)| bp.elements().len()).sum::())).max().unwrap_or(0); + let budget = THEME_WORK.checked_div(elements).map_or(budget, |w| budget.min(w.max(1))); + let Some(each) = group[0].blob.sample_pixels(&picks, budget) else { continue }; + for (px, read) in each.into_iter().zip(&group) { + if let Some(colors) = &read.colorize { + // Ink: an opaque pixel darker than white takes the colorize paint. + if !colors.is_empty() && px.iter().any(|p| p[3] >= 128 && p[..3].iter().any(|v| *v < 255)) { + let w = 1.0 / colors.len().max(1) as f32; + self.samples.extend(colors.iter().map(|c| (*c, w))); + self.objects += 1; + } + continue; + } + let mut cells: HashMap<[u8; 3], ([u64; 3], u64)> = HashMap::new(); + for [r, g, b, _] in px.into_iter().filter(|p| p[3] >= 128) { + let cell = cells.entry([r >> 4, g >> 4, b >> 4]).or_default(); + for (sum, v) in cell.0.iter_mut().zip([r, g, b]) { + *sum += u64::from(v); + } + cell.1 += 1; + } + let total: u64 = cells.values().map(|c| c.1).sum(); + if total == 0 { + continue; + } + for (key, (sum, n)) in cells { + let cell = pixels.entry(key).or_default(); + for (acc, s) in cell.0.iter_mut().zip(sum) { + *acc += s as f64 / total as f64; + } + cell.1 += n as f64 / total as f64; + } + self.objects += 1; + } + } + let mut cells: Vec<_> = pixels.into_iter().collect(); + // The same order on every run. + cells.sort_unstable_by_key(|c| c.0); + for (_, (sum, w)) in cells { + let [r, g, b] = sum.map(|s| (s / w).round().clamp(0.0, 255.0) as u8); + self.samples.push((Color::rgb8(r, g, b), w as f32)); + } + } + + /// Read `n` and everything visible inside it: each image (its part inside `area` when given, + /// and inside the clipping paths around it) and each other object with colours of its own + /// (that touches `area` when given, and shows inside the clipping paths around it). The art a + /// symbol instance shows (with a dynamic instance's own paints), placed where the instance + /// draws it, and the objects a blend, an envelope or a repeat draws elsewhere than they lie, + /// are read whole when the instance or the live object touches `area`. `depth` counts the + /// objects passed through: deeper art is left out. An enabled opacity mask that clips (and is + /// not inverted) shows the object only where its mask art is lighter than black + /// ([`mask_regions`]), as a clip group would. + fn read(&mut self, n: &Node, area: Option, depth: usize) { + let Some(mask) = n.extras().mask.as_deref().filter(|m| !m.disabled && m.clip && !m.invert) else { + return self.read_unmasked(n, area, depth); + }; + let regions = mask_regions(&mask.art, &mut self.mask_budget); + let outer = self.clip.clone(); + self.clip = Some(match &outer { + None => regions, + Some(o) => intersect_regions(o, ®ions), + }); + self.read_unmasked(n, area, depth); + self.clip = outer; + } + + /// [`Self::read`] without `n`'s opacity mask. + fn read_unmasked(&mut self, n: &Node, area: Option, depth: usize) { + // Hidden and fully transparent objects show nothing. + if depth > MAX_THEME_DEPTH || !n.visible || n.opacity <= 0.0 || matches!(n.kind, NodeKind::Path { guide: true, .. }) { + return; + } + let touches = area.is_none_or(|r| self.touches(n, r)); + match &n.kind { + NodeKind::Image(im) => { + if !touches { + return; + } + // A document keeps its images' pixels in its image store. + let Some(blob) = self.d.images.get(&im.key) else { return }; + // An image with a colorize paint shows that paint's color, not its own pixels; + // other paints its appearance has (with effects that draw them) count as well. + let colorized = n.extras().colorize.is_some() && blob.takes_colorize(); + let own = if colorized || n.extras().colorize.is_none() { + self.own(n, true) + } else { + // A colorize paint the image does not take (a linked image's preview) + // shows nothing. + let mut plain = n.clone(); + plain.extras_mut().colorize = None; + self.own(&plain, true) + }; + let colorize = if colorized { + Some(own) + } else { + if self.shows(n, area) { + self.add(own); + } + None + }; + let size = (f64::from(im.width.max(1)), f64::from(im.height.max(1))); + self.queue_image(ImageRead { blob, xf: im.xf, size, area, clip: self.clip.clone(), colorize }); + return; + } + NodeKind::SymbolInstance { symbol, xf } => { + if touches + && self.shows(n, area) + && let Some(s) = self.d.symbols.iter().find(|s| s.name == *symbol) + { + // The instance's own paints; its overrides show in its art. + let own = self.own(n, false); + self.add(own); + // The art as the instance places it: through the symbol's 9-slice guides when + // it has them, else by the instance's transform. Art that would place too many + // objects is left out, as the renderer leaves it out. + let dynamic = (!n.extras().symbol_overrides.is_empty()).then(|| vectorcraft_doc::symbol_overrides::dynamic_art(&s.art, n)); + if let Some(placed) = self.d.place_symbol_art(symbol, dynamic.as_ref().unwrap_or(&s.art), *xf) { + // The vector art counts as one object, each of its colours once, so an + // object the 9-slice guides cut into several copies does not count more. + // Each image placed is read on its own, as images are elsewhere. + let (samples, objects) = (self.samples.len(), self.objects); + self.read(&placed, None, depth + 1); + let added = self.samples.split_off(samples); + self.objects = objects; + let mut seen = std::collections::HashSet::new(); + let colors: Vec = added.into_iter().map(|(c, _)| c).filter(|c| seen.insert(ColorKey::of(c))).collect(); + self.add(colors); + } + } + return; + } + NodeKind::Blend { .. } | NodeKind::Envelope { .. } | NodeKind::Repeat(_) => { + if touches && self.shows(n, area) { + let own = self.own(n, true); + self.add(own); + // The copies are drawn elsewhere than the objects lie: the clipping paths + // around the live object, tested above, do not apply to the objects. + let clip = self.clip.take(); + for c in n.children().into_iter().flatten() { + self.read(c, None, depth + 1); + } + self.clip = clip; + } + return; + } + _ => {} + } + if touches && self.shows(n, area) { + let own = self.own(n, true); + self.add(own); + } + // A compound path's members are its geometry: the compound paints them. + if matches!(n.kind, NodeKind::Compound { .. }) { + return; + } + // A clip group's clipping path paints whole, over the art it clips: it is read in the + // marquee as given and under the clip groups around it alone. + let clip_child = n.children().and_then(|c| c.first()).filter(|_| n.clips()); + if let Some(first) = clip_child { + self.read(first, area, depth + 1); + } + let inner = match area { + Some(r) => match vectorcraft_doc::hit::marquee_in(n, r) { + Some(inner) => Some(inner), + None => return, + }, + None => None, + }; + // A clip group shows its art where its clipping path's regions and the clip groups around + // it all show. + let outer = self.clip.clone(); + if n.clips() + && let Some(first) = n.children().and_then(|c| c.first()) + { + let regions: Vec = vectorcraft_doc::hit::clip_regions(first); + self.clip = Some(match &outer { + None => regions, + Some(o) => intersect_regions(o, ®ions), + }); + } + // A Shaper Group's original shapes, which the group keeps but does not show, are left out. + for (i, c) in n.children().into_iter().flatten().enumerate().skip(usize::from(clip_child.is_some())) { + if !vectorcraft_doc::hit::shaper_hides(n, i, self.scope) { + self.read(c, inner, depth + 1); + } + } + self.clip = outer; + } + + /// Does `n` show inside the region the clip groups around it show, in `area` when given? Its + /// box (cut to `area`) meets a region of it: the region's outline crosses the box, or a point + /// on a 9 × 9 grid over the part of the box inside the region's bounds lies in the region. + fn shows(&self, n: &Node, area: Option) -> bool { + use vectorcraft_geom::kurbo::Shape; + let Some(regions) = &self.clip else { return true }; + let Some(b) = n.visual_bounds_with(&self.boxes) else { return false }; + let b = area.map_or(b, |r| b.intersect(r)); + let valid = |r: &Rect| r.width() >= 0.0 && r.height() >= 0.0; + if !valid(&b) { + return false; + } + // A path or compound path paints along its outline, and inside it where it has a visible + // fill: a point along the outline, or (filled) a point of a 9 × 9 grid over the part of the + // box inside a region's bounds that lies in both its fill and the region, must show. + let filled = has_fill(n); + let outline: Option<(Vec<&vectorcraft_geom::PathData>, vectorcraft_geom::FillRule)> = match &n.kind { + NodeKind::Path { path, rule, .. } => Some((vec![path], *rule)), + NodeKind::Compound { children, rule } => Some((children.iter().filter(|c| c.visible).filter_map(|c| c.path_data()).collect(), *rule)), + _ => None, + }; + if let Some((paths, own_rule)) = outline { + use vectorcraft_geom::ParamCurve; + use vectorcraft_geom::kurbo::ParamCurveArclen; + // The work all these tests do is bounded: past it, objects count as shown. + if self.work.get() > THEME_WORK { + return true; + } + let half = stroke_reach(n); + let cost: usize = regions.iter().map(|(bp, _)| bp.elements().len().max(1)).sum(); + let in_region = |p: Point| { + // Past the work allowed, the outline counts as shown. + if self.work.get() > THEME_WORK { + return true; + } + self.work.set(self.work.get() + cost); + regions.iter().any(|(bp, rule)| { + vectorcraft_geom::hit::fill_contains(bp, *rule, p) || half > 0.0 && vectorcraft_geom::hit::stroke_contains(bp, 0.0, half, p) + }) + }; + let mut fill = vectorcraft_geom::BezPath::new(); + for p in &paths { + fill.extend(p.to_bezpath().elements().iter().copied()); + } + // At most 4,096 points along the outline, shared among its segments by length, no + // farther apart than half the smallest region's width or height where that allows. + let step = regions + .iter() + .map(|(bp, _)| bp.bounding_box()) + .chain(area) + .map(|rb| rb.width().min(rb.height())) + .fold(f64::INFINITY, f64::min) + .max(0.01) + / 2.0; + // With a marquee, only the outline inside it (within the stroke's reach) counts. + let picked = area.map(|r| r.inflate(half, half)); + let segs: Vec<(vectorcraft_geom::PathSeg, f64)> = fill + .segments() + .take(4096) + .map(|s| { + let len = s.arclen(0.5); + (s, if len.is_finite() { len } else { 0.0 }) + }) + .collect(); + let total: f64 = segs.iter().map(|(_, l)| l).sum(); + let points = (total / step).ceil().clamp(64.0, 4096.0); + let along = segs.iter().any(|(seg, len)| { + let n = if total > 0.0 { (points * len / total).round().clamp(1.0, 4096.0) as u32 } else { 1 }; + (0..=n).any(|i| { + let p = seg.eval(f64::from(i) / f64::from(n)); + picked.is_none_or(|r| r.contains(p)) && in_region(p) + }) + }); + return along + || filled + && regions.iter().any(|(bp, _)| { + let g = b.intersect(bp.bounding_box()); + valid(&g) + && (0..81).any(|i| { + let p = Point::new(g.x0 + g.width() * f64::from(i % 9) / 8.0, g.y0 + g.height() * f64::from(i / 9) / 8.0); + in_region(p) && vectorcraft_geom::hit::fill_contains(&fill, own_rule, p) + }) + }); + } + regions.iter().any(|(bp, rule)| { + let g = b.intersect(bp.bounding_box()); + valid(&g) + && (vectorcraft_geom::hit::intersects_rect(&vectorcraft_geom::PathData::from_bezpath(bp), b) + || (0..81).any(|i| { + let p = Point::new(g.x0 + g.width() * f64::from(i % 9) / 8.0, g.y0 + g.height() * f64::from(i / 9) / 8.0); + vectorcraft_geom::hit::fill_contains(bp, *rule, p) + })) + }) + } + + /// Does the marquee `r` touch what `n` paints? A path or a compound path is touched where its + /// outline comes within half its widest visible stroke of `r` or, when it has a visible fill, + /// where `r`'s centre lies in that fill; any other object is touched by its box. + fn touches(&self, n: &Node, r: Rect) -> bool { + let boxed = n.visual_bounds_with(&self.boxes).is_some_and(|b| b.x0 <= r.x1 && r.x0 <= b.x1 && b.y0 <= r.y1 && r.y0 <= b.y1); + let filled = || has_fill(n); + let half = stroke_reach(n); + let near = r.inflate(half, half); + let crosses = |paths: &[&vectorcraft_geom::PathData], rule: vectorcraft_geom::FillRule| { + paths.iter().any(|p| vectorcraft_geom::hit::intersects_rect(p, near)) + || filled() && { + let mut bp = vectorcraft_geom::BezPath::new(); + for p in paths { + bp.extend(p.to_bezpath().elements().iter().copied()); + } + // A point on a 5 × 5 grid over the part of the marquee in the path's box lies + // in its fill. + use vectorcraft_geom::kurbo::Shape; + let g = r.intersect(bp.bounding_box()); + g.width() >= 0.0 + && g.height() >= 0.0 + && (0..25).any(|i| { + let p = Point::new(g.x0 + g.width() * f64::from(i % 5) / 4.0, g.y0 + g.height() * f64::from(i / 5) / 4.0); + vectorcraft_geom::hit::fill_contains(&bp, rule, p) + }) + } + }; + match &n.kind { + NodeKind::Path { path, rule, .. } => boxed && crosses(&[path], *rule), + NodeKind::Compound { children, rule } => { + let paths: Vec<&vectorcraft_geom::PathData> = children.iter().filter(|c| c.visible).filter_map(|c| c.path_data()).collect(); + boxed && crosses(&paths, *rule) + } + _ => boxed, + } + } +} + +/// The regions where opacity mask art `art` lets the masked object show: the regions +/// ([`vectorcraft_doc::hit::clip_regions`]) of its visible paths and compound paths filled lighter +/// than black (a solid color, a gradient with a stop lighter than black, or a pattern), the +/// outlines of the strokes lighter than black they have (dashes read as solid), the frames of its +/// images, the boxes of its type painted lighter than black, the boxes of art with effects (with +/// what the effects reach), and the regions of its clip groups and live objects whole. Black, +/// unfilled and unstroked paths without effects hide; how light the art is beyond that is not +/// read. Strokes are outlined along at most `budget` segments in all (it counts down); past that +/// a stroke counts by its box grown by half its width. +fn mask_regions(art: &Node, budget: &mut usize) -> Vec { + // Any color but black lets the masked art show. + fn light(p: &Paint) -> bool { + let lit = |c: &Color| c.to_rgba8(1.0)[..3].iter().any(|v| *v > 0); + match p { + Paint::None => false, + Paint::Solid { color, .. } => lit(color), + Paint::Gradient(g) => g.gradient.stops.iter().any(|s| lit(&s.color)), + _ => true, + } + } + fn walk(n: &Node, depth: usize, out: &mut Vec, budget: &mut usize) { + use vectorcraft_geom::kurbo::Shape; + // The mask art's root masks even when it is hidden. + // Guides draw nothing. + if depth > MAX_THEME_DEPTH || depth > 0 && (!n.visible || n.opacity <= 0.0) || matches!(n.kind, NodeKind::Path { guide: true, .. }) { + return; + } + // Art with effects can show light anywhere near it (a glow on black art): it counts + // whole, as a clipping path would. + let effects = !n.appearance.effects.is_empty() + || n.appearance.items.iter().any(|it| match it { + vectorcraft_doc::AppearanceItem::Fill(l) => l.visible && !l.effects.is_empty(), + vectorcraft_doc::AppearanceItem::Stroke(l) => l.visible && !l.effects.is_empty(), + }); + if effects { + if let Some(b) = n.visual_bounds() { + out.push((b.to_path(0.1), vectorcraft_geom::FillRule::NonZero)); + } + return; + } + let lit = n + .appearance + .items + .iter() + .any(|it| matches!(it, vectorcraft_doc::AppearanceItem::Fill(l) if l.visible && l.opacity > 0.0 && light(&l.paint))); + let stroke = n + .appearance + .items + .iter() + .filter_map(|it| match it { + vectorcraft_doc::AppearanceItem::Stroke(l) if l.visible && l.opacity > 0.0 && l.width > 0.0 && light(&l.paint) => Some(l.width / 2.0), + _ => None, + }) + .fold(None, |a: Option, w| Some(a.map_or(w, |a| a.max(w)))); + let boxed = |out: &mut Vec| { + if let Some(b) = n.geometric_bounds() { + out.push((b.to_path(0.1), vectorcraft_geom::FillRule::NonZero)); + } + }; + match &n.kind { + NodeKind::Path { .. } | NodeKind::Compound { .. } => { + if lit { + out.extend(vectorcraft_doc::hit::clip_regions(n)); + } + // A stroke shows the art along it: its outline with round ends and corners, a + // dashed stroke read as solid (the most it can show). + if let Some(half) = stroke { + let paths: Vec<&vectorcraft_geom::PathData> = match &n.kind { + NodeKind::Path { path, .. } => vec![path], + NodeKind::Compound { children, .. } => children.iter().filter_map(|c| c.path_data()).collect(), + _ => vec![], + }; + for p in paths { + // Past MASK_OUTLINE_SEGMENTS outlined segments, a stroke counts by its + // box grown by half its width. + let segments = p.to_bezpath().elements().len(); + if *budget < segments { + if let Some(b) = p.bounds().filter(|_| half.is_finite()) { + out.push((b.inflate(half, half).to_path(0.1), vectorcraft_geom::FillRule::NonZero)); + } + continue; + } + *budget -= segments; + let region = vectorcraft_pathops::outline_stroke( + p, + half * 2.0, + vectorcraft_pathops::Cap::Round, + vectorcraft_pathops::Join::Round, + 10.0, + ); + if !region.subpaths.is_empty() { + out.push((region.to_bezpath(), vectorcraft_geom::FillRule::NonZero)); + } + } + } + } + NodeKind::Image(_) => out.extend(vectorcraft_doc::hit::clip_regions(n)), + NodeKind::Text(t) => { + if lit || stroke.is_some() || t.runs.iter().any(|r| light(&r.style.fill) || r.style.stroke_width > 0.0 && light(&r.style.stroke)) { + boxed(out); + } + } + NodeKind::Group { clip: false, .. } | NodeKind::Layer { clip: false, .. } => { + // A Shaper Group's original shapes are kept but not drawn. + for (i, c) in n.children().into_iter().flatten().enumerate() { + if !vectorcraft_doc::hit::shaper_hides(n, i, None) { + walk(c, depth + 1, out, budget); + } + } + } + // Clip groups, live objects and placed documents count by the regions they clip to. + _ => out.extend(vectorcraft_doc::hit::clip_regions(n)), + } + } + let mut out = vec![]; + walk(art, 0, &mut out, budget); + out +} + +/// Does `n` have a fill item that paints: visible, not fully transparent and not None? +fn has_fill(n: &Node) -> bool { + n.appearance + .items + .iter() + .any(|it| matches!(it, vectorcraft_doc::AppearanceItem::Fill(l) if l.visible && l.opacity > 0.0 && !matches!(l.paint, Paint::None))) +} + +/// How far `n`'s widest painting stroke reaches from its path: half its width (0 without one). +fn stroke_reach(n: &Node) -> f64 { + let paints = |l: &vectorcraft_doc::StrokeLayer| l.visible && l.opacity > 0.0 && !matches!(l.paint, Paint::None) && l.width.is_finite(); + n.appearance + .items + .iter() + .filter_map(|it| match it { + vectorcraft_doc::AppearanceItem::Stroke(l) if paints(l) => Some(l.width.max(0.0) / 2.0), + _ => None, + }) + .fold(0.0, f64::max) +} + +/// The paints `m` shows: its visible fill items and its visible strokes wider than 0, its text's +/// fills and strokes wider than 0, and its colorize paint. +fn shown_paints(m: &Node) -> impl Iterator { + let runs = match &m.kind { + NodeKind::Text(t) => t.runs.as_slice(), + _ => &[], + }; + let items = m.appearance.items.iter().filter_map(|it| match it { + vectorcraft_doc::AppearanceItem::Fill(l) if l.visible && l.opacity > 0.0 => Some(&l.paint), + vectorcraft_doc::AppearanceItem::Stroke(l) if l.visible && l.opacity > 0.0 && l.width > 0.0 => Some(&l.paint), + _ => None, + }); + let text = runs.iter().flat_map(|r| std::iter::once(&r.style.fill).chain((r.style.stroke_width > 0.0).then_some(&r.style.stroke))); + items.chain(text).chain(m.extras().colorize.as_deref()) +} + +/// Add the colours `m` shows itself to `out` (solid colours, gradient stops, its text's colours +/// and its mesh points; the paints a dynamic symbol instance keeps for objects of its art only +/// when `overrides` is set), and the names of the patterns it paints with to `patterns`, leaving +/// out names already there. +fn paint_colors_of(m: &Node, overrides: bool, out: &mut Vec, patterns: &mut Vec) { + let kept = override_paints(m).filter(|_| overrides); + for p in shown_paints(m).chain(kept) { + match p { + Paint::Solid { color, .. } => out.push(*color), + Paint::Gradient(g) => out.extend(g.gradient.stops.iter().map(|s| s.color)), + Paint::Pattern { pattern, .. } if !patterns.contains(pattern) => patterns.push(pattern.clone()), + _ => {} + } + } + if let NodeKind::Mesh(mesh) = &m.kind { + out.extend(mesh.points.iter().map(|p| p.color)); + } +} + +impl<'a> Theme<'a> { + /// Queue image read `r`, within the limits of a pick: at most [`MAX_THEME_READS`] reads of + /// [`MAX_THEME_IMAGES`] images; nothing inside clip groups that show nothing. + fn queue_image(&mut self, r: ImageRead<'a>) { + if self.images.len() >= MAX_THEME_READS || r.clip.as_ref().is_some_and(Vec::is_empty) { + return; + } + let key: *const vectorcraft_doc::ImageBlob = r.blob; + if !self.blobs.contains(&key) { + if self.blobs.len() >= MAX_THEME_IMAGES { + return; + } + self.blobs.insert(key); + } + self.images.push(r); + } + + /// The colours `m` paints itself ([`paint_colors_of`]; a dynamic symbol instance's paints for + /// objects of its art only with `overrides`), and the colours its pattern tiles show, read as + /// document art is read (clip groups and symbols included; the tiles' images join this pick's + /// image reads). Each pattern's colours + /// are read once; a pattern whose tile uses itself, directly or through other patterns, adds + /// nothing more the second time. + fn own(&mut self, m: &Node, overrides: bool) -> Vec { + let mut out = vec![]; + let mut patterns: Vec = vec![]; + paint_colors_of(m, overrides, &mut out, &mut patterns); + for name in patterns { + if let Some((colors, reads)) = self.pattern_colors.get(&name) { + out.extend(colors); + // The tiles' images count again for each use, within the pick's limits. + let reads = reads.clone(); + for r in reads { + self.queue_image(r); + } + continue; + } + if self.pattern_stack.contains(&name) || self.pattern_stack.len() >= MAX_THEME_DEPTH { + continue; + } + let Some(def) = self.d.pattern(&name) else { continue }; + let mut sub = Theme::new(self.d); + sub.pattern_stack = std::mem::take(&mut self.pattern_stack); + sub.pattern_stack.push(name.clone()); + sub.pattern_colors = std::mem::take(&mut self.pattern_colors); + // The tiles' images join this pick's image reads, within its limits. + sub.images = std::mem::take(&mut self.images); + sub.blobs = std::mem::take(&mut self.blobs); + // The tiles share this pick's limits on work too. + sub.work.set(self.work.get()); + sub.mask_budget = self.mask_budget; + let before = sub.images.len(); + for a in &def.art { + sub.read(a, None, 0); + } + sub.pattern_stack.pop(); + self.pattern_stack = std::mem::take(&mut sub.pattern_stack); + self.pattern_colors = std::mem::take(&mut sub.pattern_colors); + let reads: Vec> = sub.images.get(before..).unwrap_or_default().to_vec(); + self.images = std::mem::take(&mut sub.images); + self.blobs = std::mem::take(&mut sub.blobs); + self.work.set(sub.work.get()); + self.mask_budget = sub.mask_budget; + let colors: Vec = sub.samples.iter().map(|(c, _)| *c).collect(); + out.extend(&colors); + self.pattern_colors.insert(name, (colors, reads)); + } + out + } +} + +fn pick_theme(s: &mut Session, p: &Value) -> Result { + const C: &str = "recolor.pickTheme"; + let picks = match p.get("picks") { + Some(Value::Array(a)) if !a.is_empty() && a.len() <= MAX_PICKS => a.iter().map(|v| Pick::param(v, C)).collect::>>()?, + Some(Value::Array(a)) => return Err(bad(C, format!("`picks` must hold 1 to {MAX_PICKS} picks (got {})", a.len()))), + Some(v) => return Err(bad(C, format!("`picks` must be an array (got {v})"))), + None => return Err(bad(C, "missing `picks`")), + }; + let n = super::menucmds::whole_or(p, "colors", 5, C)?; + if !(1..=MAX_THEME_COLORS).contains(&n) { + return Err(bad(C, format!("`colors` must be between 1 and {MAX_THEME_COLORS} (got {n})"))); + } + let st = s.doc()?; + let d = &st.doc; + let mut theme = Theme::new(d); + theme.scope = st.isolation; + // In isolation mode: the isolated object, everything inside it and the containers around it. + let scope: Option> = st.isolation.and_then(|iso| d.node(iso)).map(|iso| { + let mut allowed = std::collections::HashSet::new(); + iso.walk(&mut |m| { + allowed.insert(m.id); + }); + let mut up = d.parent_of(iso.id); + while let Some(p) = up { + allowed.insert(p); + up = d.parent_of(p); + } + allowed + }); + for pick in picks { + match pick { + Pick::At(pt) => { + // In isolation mode only the isolated art (and the groups around it) can be hit; + // isolated Shaper Group originals are hittable then. + let opt = vectorcraft_doc::hit::HitOptions { scope: st.isolation, ..Default::default() }; + let hit = match &scope { + Some(allowed) => vectorcraft_doc::hit::hit_test_visible_skipping(d, pt, opt, &|id| !allowed.contains(&id)), + None => vectorcraft_doc::hit::hit_test_visible(d, pt, opt), + }; + if let Some(n) = hit.and_then(|h| d.node(h.top_object(st.isolation))) { + theme.read(n, None, 0); + } + } + Pick::Area(r) => match st.isolation.and_then(|iso| d.node(iso)) { + // In isolation mode a marquee reads the isolated art alone. + Some(iso) => theme.read(iso, Some(r), 0), + None => { + for l in &d.layers { + theme.read(l, Some(r), 0); + } + } + }, + } + } + theme.read_images(); + let colors = vectorcraft_color::recolor::theme_palette(&theme.samples, index(n)); + Ok(json!({"colors": colors.iter().map(key_str).collect::>(), "objects": theme.objects})) +} + /// A colour the art uses: how often, and the global swatch it is linked to. struct Used { color: Color, diff --git a/crates/engine/src/tests/recolor.rs b/crates/engine/src/tests/recolor.rs index 37464de71d..4707ae98fd 100644 --- a/crates/engine/src/tests/recolor.rs +++ b/crates/engine/src/tests/recolor.rs @@ -1079,3 +1079,272 @@ fn global_adjust_refuses_params_of_the_wrong_form() { run(&mut s, "recolor.apply", json!({"map": map, "globalAdjust": {"saturation": null, "temperature": -100}})); assert_ne!(fill(&s, art).to_hex(), "#ff0000", "an amount at the end of the range applies"); } + +/// A placed `w` × `h` px image whose left half is `left` and right half `right` (RGBA), and its +/// bounds on the page. +fn halves_image(s: &mut Session, w: u32, h: u32, left: [u8; 4], right: [u8; 4]) -> (NodeId, vectorcraft_geom::Rect) { + let img = image::RgbaImage::from_fn(w, h, |x, _| image::Rgba(if x < w / 2 { left } else { right })); + let mut png = Vec::new(); + img.write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png).unwrap(); + let r = run(s, "file.place", json!({"name": "halves.png", "dataBase64": vectorcraft_format::base64_encode(&png)})); + let id = NodeId(r["ids"][0].as_u64().unwrap()); + let b = s.doc().unwrap().doc.node(id).unwrap().visual_bounds().unwrap(); + (id, b) +} + +fn pick_theme(s: &mut Session, p: Value) -> Vec { + keys(&run(s, "recolor.pickTheme", p)["colors"]) +} + +/// A click takes the palette of the object a Selection tool click takes (a whole group), the most +/// used color first, each in its own model; a click on empty canvas or on a hidden object takes +/// nothing. Locked objects are read. Picking changes nothing. +#[test] +fn theme_picker_click_takes_the_palette_of_the_whole_object() { + let mut s = session(); + let a = rect(&mut s, json!("#ff0000")); + let b = rect(&mut s, json!({"c": 0, "m": 0, "y": 100, "k": 0})); + let c = rect(&mut s, json!("#ff0000")); + run(&mut s, "paint.setStroke", json!({"ids": [c.0], "color": "#0000ff"})); + // x 70 to 85 and 90 to 105. + let hidden = rect(&mut s, json!("#00ff00")); + let locked = rect(&mut s, json!("#ff00ff")); + run(&mut s, "select.set", json!({"ids": [a.0, b.0, c.0]})); + run(&mut s, "object.group", json!({})); + run(&mut s, "object.hide", json!({"ids": [hidden.0]})); + run(&mut s, "object.lock", json!({"ids": [locked.0]})); + let undo = s.doc().unwrap().history.undo.len(); + let doc = s.doc().unwrap().doc.clone(); + // A click on `b` (x 30 to 45): the group's three rectangles, red the most used. + let r = run(&mut s, "recolor.pickTheme", json!({"picks": [{"at": [37, 17]}]})); + assert_eq!(keys(&r["colors"]), ["rgb 255 0 0", "cmyk 0 0 100 0", "rgb 0 0 255"], "{r}"); + assert_eq!(r["objects"], 3); + assert_eq!(pick_theme(&mut s, json!({"picks": [{"at": [37, 17]}], "colors": 2})).len(), 2, "at most `colors`"); + assert!(pick_theme(&mut s, json!({"picks": [{"at": [300, 150]}]})).is_empty(), "empty canvas"); + assert!(pick_theme(&mut s, json!({"picks": [{"at": [77, 17]}]})).is_empty(), "a hidden object"); + assert_eq!(pick_theme(&mut s, json!({"picks": [{"at": [97, 17]}]})), ["rgb 255 0 255"], "a locked object"); + assert_eq!(s.doc().unwrap().history.undo.len(), undo, "no undo step"); + assert!(std::sync::Arc::ptr_eq(&s.doc().unwrap().doc, &doc), "the document stays as it was"); +} + +/// A marquee takes the part of an image inside it and every painted object it touches; several +/// picks (Shift) add up. A click on an image takes all its pixels. +#[test] +fn theme_picker_marquee_takes_the_area_and_picks_add_up() { + let mut s = session(); + let (_, b) = halves_image(&mut s, 64, 32, [255, 0, 0, 255], [0, 0, 255, 255]); + let (mid, y) = ((b.x0 + b.x1) / 2.0, (b.y0 + b.y1) / 2.0); + let left = json!({"rect": [b.x0 + 1.0, b.y0 + 1.0, mid - 1.0, b.y1 - 1.0]}); + assert_eq!(pick_theme(&mut s, json!({"picks": [left]})), ["rgb 255 0 0"], "the left half alone"); + let right_backwards = json!({"rect": [b.x1 - 1.0, b.y1 - 1.0, mid + 1.0, b.y0 + 1.0]}); + assert_eq!(pick_theme(&mut s, json!({"picks": [right_backwards]})), ["rgb 0 0 255"], "a marquee drawn backwards"); + let both = pick_theme(&mut s, json!({"picks": [left, right_backwards]})); + assert_eq!(both.len(), 2, "Shift adds a second area: {both:?}"); + assert_eq!(pick_theme(&mut s, json!({"picks": [{"at": [mid, y]}]})).len(), 2, "a click takes the whole image"); + // Two rectangles away from the image: a marquee touching both takes both. + let r1 = rect(&mut s, json!("#00ff00")); + let r2 = rect(&mut s, json!("#ffff00")); + let (b1, b2) = { + let d = &s.doc().unwrap().doc; + (d.node(r1).unwrap().visual_bounds().unwrap(), d.node(r2).unwrap().visual_bounds().unwrap()) + }; + let over = json!({"rect": [b1.x1 - 2.0, b1.y0 + 2.0, b2.x0 + 2.0, b1.y0 + 4.0]}); + let mut got = pick_theme(&mut s, json!({"picks": [over]})); + got.sort(); + assert_eq!(got, ["rgb 0 255 0", "rgb 255 255 0"]); +} + +/// Pixels less than half opaque are left out, and so is an image whose pixels can't be read. +#[test] +fn theme_picker_leaves_out_clear_pixels_and_unreadable_images() { + let mut s = session(); + let (_, b) = halves_image(&mut s, 8, 8, [255, 0, 0, 255], [0, 0, 255, 100]); + let all = json!({"rect": [b.x0, b.y0, b.x1, b.y1]}); + assert_eq!(pick_theme(&mut s, json!({"picks": [all]})), ["rgb 255 0 0"]); + let cut = super::menucmds::place_undecodable_png(&mut s); + let cb = s.doc().unwrap().doc.node(cut).unwrap().visual_bounds().unwrap(); + let r = run(&mut s, "recolor.pickTheme", json!({"picks": [{"rect": [cb.x0, cb.y0, cb.x1, cb.y1]}]})); + assert!(r["colors"].as_array().unwrap().iter().all(|k| k == "rgb 255 0 0"), "the undecodable image adds nothing: {r}"); +} + +/// A large image is read through about 65,536 pixels: its palette still holds both halves. +#[test] +fn theme_picker_reads_a_large_image_within_its_pixel_budget() { + let mut s = session(); + let (_, b) = halves_image(&mut s, 2000, 1000, [10, 200, 30, 255], [250, 240, 10, 255]); + let (mid, y) = ((b.x0 + b.x1) / 2.0, (b.y0 + b.y1) / 2.0); + let mut got = pick_theme(&mut s, json!({"picks": [{"at": [mid, y]}]})); + got.sort(); + assert_eq!(got, ["rgb 10 200 30", "rgb 250 240 10"]); +} + +/// A symbol instance gives the colors of the art it shows, by a click or a marquee; a pattern fill +/// gives the colors of its tile and of the patterns the tile uses. +#[test] +fn theme_picker_reads_symbol_art_and_nested_patterns() { + let mut s = session(); + let r = rect(&mut s, json!("#00ff00")); + run(&mut s, "select.set", json!({"ids": [r.0]})); + let inst = NodeId(run(&mut s, "symbol.new", json!({"name": "Dot"}))["id"].as_u64().unwrap()); + let b = s.doc().unwrap().doc.node(inst).unwrap().visual_bounds().unwrap(); + let (cx, cy) = ((b.x0 + b.x1) / 2.0, (b.y0 + b.y1) / 2.0); + assert_eq!(pick_theme(&mut s, json!({"picks": [{"at": [cx, cy]}]})), ["rgb 0 255 0"], "a click on the instance"); + assert_eq!(pick_theme(&mut s, json!({"picks": [{"rect": [cx, cy, cx + 1.0, cy + 1.0]}]})), ["rgb 0 255 0"], "a marquee"); + select_all(&mut s); + run(&mut s, "edit.clear", json!({})); + // Pattern "inner" of a red square fills a square, which becomes pattern "outer". + let red = rect(&mut s, json!("#ff0000")); + let inner = run(&mut s, "object.pattern.make", json!({"ids": [red.0], "edit": false}))["name"].as_str().unwrap().to_string(); + let tile = rect(&mut s, json!("#0000ff")); + run(&mut s, "paint.setFill", json!({"ids": [tile.0], "swatch": inner})); + let outer = run(&mut s, "object.pattern.make", json!({"ids": [tile.0], "edit": false}))["name"].as_str().unwrap().to_string(); + let art = rect(&mut s, json!("#0000ff")); + run(&mut s, "paint.setFill", json!({"ids": [art.0], "swatch": outer})); + let b = s.doc().unwrap().doc.node(art).unwrap().visual_bounds().unwrap(); + let got = pick_theme(&mut s, json!({"picks": [{"at": [(b.x0 + b.x1) / 2.0, (b.y0 + b.y1) / 2.0]}]})); + assert!(got.contains(&"rgb 255 0 0".to_string()), "the inner pattern's red: {got:?}"); +} + +/// A grayscale image that a fill color colorizes gives that color, not its grays. +#[test] +fn theme_picker_reads_the_color_of_a_colorized_image() { + let mut s = session(); + let mut png = Vec::new(); + image::GrayImage::from_pixel(8, 8, image::Luma([90])).write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png).unwrap(); + let r = run(&mut s, "file.place", json!({"name": "gray.png", "dataBase64": vectorcraft_format::base64_encode(&png)})); + let id = NodeId(r["ids"][0].as_u64().unwrap()); + let b = s.doc().unwrap().doc.node(id).unwrap().visual_bounds().unwrap(); + let at = json!({"picks": [{"at": [(b.x0 + b.x1) / 2.0, (b.y0 + b.y1) / 2.0]}]}); + assert_eq!(pick_theme(&mut s, at.clone()), ["rgb 90 90 90"], "uncolorized: its grays"); + run(&mut s, "paint.setFill", json!({"ids": [id.0], "color": "#ff0000"})); + assert!(s.doc().unwrap().doc.node(id).unwrap().extras().colorize.is_some(), "the fill colorizes the image"); + assert_eq!(pick_theme(&mut s, at), ["rgb 255 0 0"]); +} + +/// A hidden fill gives no color, and a marquee in a clip group reads only what the clipping path +/// lets through. +#[test] +fn theme_picker_leaves_out_hidden_fills_and_clipped_art() { + let mut s = session(); + let shape = |s: &mut Session, x: f64, w: f64, fill: &str| { + let id = NodeId(run(s, "shape.rectangle", json!({"x": x, "y": 10, "width": w, "height": 15}))["id"].as_u64().unwrap()); + run(s, "paint.setFill", json!({"ids": [id.0], "color": fill})); + run(s, "paint.setStroke", json!({"ids": [id.0], "none": true})); + id + }; + let hidden = shape(&mut s, 200.0, 15.0, "#ff00ff"); + run(&mut s, "select.set", json!({"ids": [hidden.0]})); + run(&mut s, "appearance.setItem", json!({"index": 0, "visible": false})); + assert!(pick_theme(&mut s, json!({"picks": [{"rect": [205, 12, 210, 20]}]})).is_empty(), "a hidden fill"); + // A marquee inside an outlined square without a fill misses it; inside a filled one it takes it. + let outline = shape(&mut s, 250.0, 40.0, "#00ffff"); + run(&mut s, "paint.setFill", json!({"ids": [outline.0], "none": true})); + run(&mut s, "paint.setStroke", json!({"ids": [outline.0], "color": "#ffff00"})); + assert!(pick_theme(&mut s, json!({"picks": [{"rect": [260, 13, 270, 20]}]})).is_empty(), "inside the outline"); + assert_eq!(pick_theme(&mut s, json!({"picks": [{"rect": [245, 13, 260, 20]}]})), ["rgb 255 255 0"], "across the outline"); + run(&mut s, "paint.setFill", json!({"ids": [outline.0], "color": "#00ffff"})); + assert_eq!(pick_theme(&mut s, json!({"picks": [{"rect": [260, 13, 270, 20]}]})).len(), 2, "inside the fill"); + // Red runs from x 10 to 110 and green from 50 to 60; the clipping path lets x 10 to 40 through. + let red = shape(&mut s, 10.0, 100.0, "#ff0000"); + let green = shape(&mut s, 50.0, 10.0, "#00ff00"); + let clip = shape(&mut s, 10.0, 30.0, "#0000ff"); + run(&mut s, "select.set", json!({"ids": [red.0, green.0, clip.0]})); + run(&mut s, "object.clippingMask.make", json!({})); + assert_eq!(pick_theme(&mut s, json!({"picks": [{"rect": [30, 12, 55, 20]}]})), ["rgb 255 0 0"]); +} + +/// An image in a clip group gives only the pixels inside its clipping path, by a click or a +/// marquee. +#[test] +fn theme_picker_reads_an_image_inside_its_clipping_path() { + let mut s = session(); + // Red, with blue 6 × 3 px blocks in the corners, which an ellipse inscribed in the image leaves out. + let (w, h) = (64, 32); + let img = image::RgbaImage::from_fn(w, h, |x, y| { + let corner = (x < 6 || x >= w - 6) && (y < 3 || y >= h - 3); + image::Rgba(if corner { [0, 0, 255, 255] } else { [255, 0, 0, 255] }) + }); + let mut png = Vec::new(); + img.write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png).unwrap(); + let r = run(&mut s, "file.place", json!({"name": "corners.png", "dataBase64": vectorcraft_format::base64_encode(&png)})); + let id = NodeId(r["ids"][0].as_u64().unwrap()); + let b = s.doc().unwrap().doc.node(id).unwrap().visual_bounds().unwrap(); + let all = json!({"picks": [{"rect": [b.x0, b.y0, b.x1, b.y1]}]}); + assert_eq!(pick_theme(&mut s, all.clone()).len(), 2, "unclipped: red and blue"); + let e = NodeId(run(&mut s, "shape.ellipse", json!({"x": b.x0, "y": b.y0, "width": b.width(), "height": b.height()}))["id"].as_u64().unwrap()); + run(&mut s, "select.set", json!({"ids": [id.0, e.0]})); + run(&mut s, "object.clippingMask.make", json!({})); + assert_eq!(pick_theme(&mut s, all), ["rgb 255 0 0"], "a marquee"); + let center = json!({"picks": [{"at": [(b.x0 + b.x1) / 2.0, (b.y0 + b.y1) / 2.0]}]}); + assert_eq!(pick_theme(&mut s, center), ["rgb 255 0 0"], "a click"); +} + +/// An object in a clip group that its clipping path hides gives no color, even inside the +/// clipping path's box. +#[test] +fn theme_picker_leaves_out_art_a_curved_clipping_path_hides() { + let mut s = session(); + let shape = |s: &mut Session, x: f64, y: f64, w: f64, h: f64, fill: &str| { + let id = NodeId(run(s, "shape.rectangle", json!({"x": x, "y": y, "width": w, "height": h}))["id"].as_u64().unwrap()); + run(s, "paint.setFill", json!({"ids": [id.0], "color": fill})); + run(s, "paint.setStroke", json!({"ids": [id.0], "none": true})); + id + }; + // A red square in the middle of a 100 × 100 ellipse, and a green one in its top left corner. + let red = shape(&mut s, 40.0, 40.0, 20.0, 20.0, "#ff0000"); + let green = shape(&mut s, 0.0, 0.0, 8.0, 8.0, "#00ff00"); + let e = NodeId(run(&mut s, "shape.ellipse", json!({"x": 0, "y": 0, "width": 100, "height": 100}))["id"].as_u64().unwrap()); + let all = json!({"picks": [{"rect": [-5, -5, 105, 105]}]}); + let mut both = pick_theme(&mut s, all.clone()); + both.retain(|k| k == "rgb 255 0 0" || k == "rgb 0 255 0"); + assert_eq!(both.len(), 2, "unclipped: both squares"); + run(&mut s, "select.set", json!({"ids": [red.0, green.0, e.0]})); + run(&mut s, "object.clippingMask.make", json!({})); + assert_eq!(pick_theme(&mut s, all), ["rgb 255 0 0"], "the corner square is hidden"); +} + +/// In isolation mode a click and a marquee read only the isolated art. +#[test] +fn theme_picker_reads_only_the_isolated_art() { + let mut s = session(); + let a = rect(&mut s, json!("#ff0000")); + let b = rect(&mut s, json!("#0000ff")); + run(&mut s, "select.set", json!({"ids": [a.0, b.0]})); + let g = NodeId(run(&mut s, "object.group", json!({}))["id"].as_u64().unwrap()); + // Green on top of the blue square (x 30 to 45). + let green = NodeId(run(&mut s, "shape.rectangle", json!({"x": 30, "y": 10, "width": 15, "height": 15}))["id"].as_u64().unwrap()); + run(&mut s, "paint.setFill", json!({"ids": [green.0], "color": "#00ff00"})); + run(&mut s, "paint.setStroke", json!({"ids": [green.0], "none": true})); + assert_eq!(pick_theme(&mut s, json!({"picks": [{"at": [37, 17]}]})), ["rgb 0 255 0"], "outside isolation: the top object"); + run(&mut s, "object.isolate", json!({"id": g.0})); + let got = pick_theme(&mut s, json!({"picks": [{"at": [37, 17]}]})); + assert_eq!(got, ["rgb 0 0 255"], "a click reaches the isolated blue square under the green one"); + let mut got = pick_theme(&mut s, json!({"picks": [{"rect": [5, 5, 60, 30]}]})); + got.sort(); + assert_eq!(got, ["rgb 0 0 255", "rgb 255 0 0"], "a marquee leaves out the green square"); +} + +/// Bad parameters are refused with an error naming them. +#[test] +fn theme_picker_refuses_bad_params() { + let mut s = session(); + rect(&mut s, json!("#ff0000")); + let many: Vec = (0..257).map(|_| json!({"at": [0, 0]})).collect(); + for (p, msg) in [ + (json!({}), "missing `picks`"), + (json!({"picks": {"at": [0, 0]}}), "`picks` must be an array"), + (json!({"picks": []}), "`picks` must hold 1 to 256 picks (got 0)"), + (json!({"picks": many}), "`picks` must hold 1 to 256 picks (got 257)"), + (json!({"picks": [{"at": [0]}]}), "`at` must be [x, y]"), + (json!({"picks": [{"at": ["1", 2]}]}), "`at` must be [x, y]"), + (json!({"picks": [{"rect": [0, 0, 10]}]}), "`rect` must be [x0, y0, x1, y1]"), + (json!({"picks": [{"at": [0, 0], "rect": [0, 0, 1, 1]}]}), "each pick is"), + (json!({"picks": [{"point": [0, 0]}]}), "each pick is"), + (json!({"picks": [{"at": [0, 0]}], "colors": 0}), "`colors` must be between 1 and 64 (got 0)"), + (json!({"picks": [{"at": [0, 0]}], "colors": 65}), "`colors` must be between 1 and 64 (got 65)"), + (json!({"picks": [{"at": [0, 0]}], "colors": 2.5}), "`colors` must be a whole number"), + ] { + let e = s.execute("recolor.pickTheme", &p).unwrap_err().to_string(); + assert!(e.contains(msg), "{p}: {e}"); + } +} diff --git a/crates/ui-egui/src/dialogs/recolor.rs b/crates/ui-egui/src/dialogs/recolor.rs index 6f696f4302..ef2d710d18 100644 --- a/crates/ui-egui/src/dialogs/recolor.rs +++ b/crates/ui-egui/src/dialogs/recolor.rs @@ -25,6 +25,13 @@ //! Opened on colours alone (the Color Guide's Edit or Apply Colors without art), OK saves the new //! colours as a colour group named `groupName`. //! +//! The Color Theme Picker button beside the tabs turns on picking from the canvas: a click on an +//! object takes the palette of the object a Selection tool click takes, a drag takes the palette +//! of the art inside its marquee, and Shift adds to the picks so far (`recolor.pickTheme`). The +//! rows that aren't excluded take the picked colors as their new colors, the most used color first +//! and repeating when the rows outnumber them, and the art previews them; OK keeps them as one +//! undo step. A new count of Colors keeps the picks: the new rows take them again. +//! //! Fields (`ui.dialog.set`): `rows` ([{from: [keys], to: key, exclude?, tint?: percent of a spot //! color}]), `colors` (null: Auto, or a count), `method`, `preserveWhite`, `preserveBlack`, //! `preserveGrays`, `limitTo` (library id, "document" for the document's swatches, "" for none), @@ -33,7 +40,9 @@ //! a gray and Tint for a spot color; `global`: Global Adjust, on the Edit tab), `globalAdjust` //! (`{saturation, brightness, temperature, luminosity}` in percent, sent as `recolor.apply`'s //! `globalAdjust` in every slider mode), `display` (the Edit tab's `smooth`, `segmented` or `bars`; -//! unset: `smooth`). Changing `colors`, a preserve flag or `limitTo` reduces the rows again. +//! unset: `smooth`), `themePicker` (the Color Theme Picker is on), `themePicks` (its picks, as +//! `recolor.pickTheme`'s `picks`; a new list recolors the rows). Changing `colors`, a preserve +//! flag or `limitTo` reduces the rows again. use egui::{Rect, Sense, Ui, pos2, vec2}; use serde_json::{Value, json}; @@ -142,7 +151,7 @@ pub fn open(app: &mut VectorcraftApp, p: &Value) -> Result { "preserveWhite": kept("preserveWhite", true), "preserveBlack": kept("preserveBlack", true), "preserveGrays": kept("preserveGrays", false), "limitTo": limit, "group": group, "groupName": if new_group { Some(NEW_GROUP) } else { group }, "tab": "assign", "rule": Harmony::Complementary.id(), "linked": true, - "preview": true, "__art": art, "__assign": assign, "__newGroup": new_group, + "preview": true, THEME_PICKER: false, THEME_PICKS: [], "__art": art, "__assign": assign, "__newGroup": new_group, }); let mut d = Dialog::new(KIND, fields); // Without art the rows are there from the start: limit them now (art's rows snap as they reduce). @@ -203,6 +212,99 @@ fn sync(app: &mut VectorcraftApp, d: &mut Dialog) { Err(e) => app.status(e.to_string()), } d.fields.insert(DONE.into(), sig); + // New rows take the colors picked with the Color Theme Picker again. + d.fields.remove(THEME_DONE); +} + +/// The fields of the Color Theme Picker: whether a click or drag on the canvas picks colors, and +/// the picks so far (`recolor.pickTheme`'s `picks`); the picks the rows last took them from. +const THEME_PICKER: &str = "themePicker"; +const THEME_PICKS: &str = "themePicks"; +const THEME_DONE: &str = "__themePicked"; + +/// When the picks of the Color Theme Picker changed, give the rows that aren't excluded the +/// palette of the art picked (`recolor.pickTheme`, as many colors as those rows), in row order; +/// with fewer colors than rows, the colors repeat. Picks that touch no art leave the rows as they +/// are. +fn sync_theme(app: &mut VectorcraftApp, d: &mut Dialog) { + let picks = d.fields.get(THEME_PICKS).cloned().unwrap_or(Value::Null); + if !picks.as_array().is_some_and(|a| !a.is_empty()) || d.fields.get(THEME_DONE) == Some(&picks) { + return; + } + d.fields.insert(THEME_DONE.into(), picks.clone()); + let mut rs = rows(d); + let active = active_rows(&rs); + if active.is_empty() { + return; + } + // The art as it is, not as the preview shows it; the preview runs again afterwards. + if d.fields.remove(super::form::PREVIEWED).is_some() { + let _ = app.session.cancel_interaction(); + } + let colors = match app.session.execute("recolor.pickTheme", &json!({"picks": picks, "colors": active.len().min(64)})) { + Ok(r) => r["colors"].as_array().map(|a| a.iter().filter_map(color_value).collect::>()).unwrap_or_default(), + Err(e) => return app.status(e.to_string()), + }; + if colors.is_empty() { + return; + } + for (n, &i) in active.iter().enumerate() { + set_to(&mut rs[i], &colors[n % colors.len()]); + } + snap(app, d, &mut rs); + d.fields.insert("rows".into(), Value::Array(rs)); + // The rows hold no slider edit. + d.fields.remove(COMPS); +} + +/// The picks recolor.pickTheme takes at most; the oldest go first. +const MAX_PICKS: usize = 256; + +/// While the Color Theme Picker is on: a layer over the canvas, under the dialog, takes the clicks +/// and drags there as picks (with Shift they add to the picks so far, else they replace them) and +/// draws a drag's marquee, whose sides follow the document's axes. +fn theme_overlay(app: &VectorcraftApp, ctx: &egui::Context, d: &mut Dialog) { + let (Some(rect), Some(view)) = (app.canvas_rect, app.view()) else { return }; + let xf = crate::canvas::Xf::new(rect, view); + let accent = Tokens::get(ctx).accent; + let id = egui::Id::unique("recolor-theme-picker"); + let shown = egui::Area::new(id).order(egui::Order::Middle).fixed_pos(rect.min).movable(false).show(ctx, |ui| { + let resp = ui.allocate_rect(rect, Sense::click_and_drag()).on_hover_cursor(egui::CursorIcon::Crosshair); + let shift = ui.input(|i| i.modifiers.shift); + // Where a press on the canvas began, kept from the first frame that sees it for the frame + // that releases it (the pointer forgets it then). + let from = egui::Id::unique("recolor-theme-drag"); + if let Some(o) = ui.input(|i| i.pointer.press_origin()).filter(|o| rect.contains(*o)) { + ui.data_mut(|m| m.insert_temp(from, o)); + } + if resp.clicked() { + ui.data_mut(|m| m.remove::(from)); + let p = xf.to_doc(resp.interact_pointer_pos().or(ui.input(|i| i.pointer.latest_pos()))?); + return Some((json!({"at": [p.x, p.y]}), shift)); + } + if !(resp.dragged() || resp.drag_stopped()) { + return None; + } + let a = ui.data(|m| m.get_temp::(from))?; + let b = ui.input(|i| i.pointer.latest_pos()); + let (a, b) = (xf.to_doc(a), xf.to_doc(b?)); + if resp.drag_stopped() { + ui.data_mut(|m| m.remove::(from)); + return Some((json!({"rect": [a.x, a.y, b.x, b.y]}), shift)); + } + let corners = [(a.x, a.y), (b.x, a.y), (b.x, b.y), (a.x, b.y), (a.x, a.y)]; + let pts: Vec = corners.iter().map(|&(x, y)| xf.to_screen(vectorcraft_geom::Point::new(x, y))).collect(); + ui.painter().with_clip_rect(rect).extend(egui::Shape::dashed_line(&pts, egui::Stroke::new(1.0, accent), 4.0, 3.0)); + None + }); + // Above the backdrop of the dialog (which a click elsewhere raises), still under its window. + ctx.move_to_top(egui::LayerId::new(egui::Order::Middle, id)); + let Some((pick, add)) = shown.inner else { return }; + let mut picks = if add { d.fields.get(THEME_PICKS).and_then(Value::as_array).cloned().unwrap_or_default() } else { vec![] }; + picks.push(pick); + let extra = picks.len().saturating_sub(MAX_PICKS); + picks.drain(..extra); + d.fields.insert(THEME_PICKS.into(), Value::Array(picks)); } /// With Limit to Library, the rows' new colours snap to the library's nearest colours. @@ -293,7 +395,9 @@ fn apply_params(d: &Dialog) -> Value { fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> bool { sync(app, d); + sync_theme(app, d); let t = Tokens::get(ui.ctx()); + let picking = d.bool(THEME_PICKER); ui.horizontal(|ui| { let tab = d.str("tab"); for (id, label) in [("assign", tl!("Assign")), ("edit", tl!("Edit"))] { @@ -301,6 +405,10 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> bool { d.fields.insert("tab".into(), json!(id)); } } + ui.add_space(8.0); + if widgets::icon_button(ui, "pipette", tl!("Color Theme Picker"), picking, 24.0).clicked() { + d.fields.insert(THEME_PICKER.into(), json!(!picking)); + } ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { // The label is drawn after the menu (right-to-left), so it cannot name it by adjacency. if let Some(i) = widgets::dropdown_named(ui, "recolor-preset", Some(tl!("Preset:")), PRESETS[preset_of(d)], &PRESETS, 130.0) { @@ -311,6 +419,12 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> bool { }); widgets::divider(ui); ui.add_space(4.0); + if d.bool(THEME_PICKER) { + widgets::dim_label(ui, tl!("Click or drag across the art to pick its colors; Shift adds more")); + ui.add_space(4.0); + theme_overlay(app, ui.ctx(), d); + sync_theme(app, d); + } let mut rs = rows(d); let top = ui.cursor().top(); let (changed, pick) = if d.str("tab") == "edit" { (edit_tab(app, ui, d, &mut rs), None) } else { assign_tab(app, ui, d, &mut rs) }; @@ -359,6 +473,7 @@ pub(super) fn with_new_color(app: &VectorcraftApp, mut d: Dialog, i: usize, c: C fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result { let mut d = d.clone(); sync(app, &mut d); + sync_theme(app, &mut d); if d.bool("__newGroup") { // The new colors with the Global Adjust, snapped to Limit to Library, as `recolor.apply` // gives them to a group. @@ -1408,6 +1523,137 @@ mod tests { assert!(to.as_str().is_some_and(|k| k.starts_with("cmyk ")), "a color picked as RGB is CMYK in a CMYK document: {to}"); } + /// A 15 pt square at (`x`, 10) filled with `fill`, without a stroke. + fn square(app: &mut VectorcraftApp, x: f64, fill: &str) -> u64 { + let id = app.run("shape.rectangle", json!({"x": x, "y": 10, "width": 15, "height": 15})).unwrap()["id"].as_u64().unwrap(); + app.run("paint.setFill", json!({"ids": [id], "color": fill})).unwrap(); + app.run("paint.setStroke", json!({"ids": [id], "none": true})).unwrap(); + id + } + + fn fill_hex(app: &VectorcraftApp, id: u64) -> String { + let doc = &app.session.doc().unwrap().doc; + doc.node(vectorcraft_doc::NodeId(id)).unwrap().appearance.fill().and_then(|f| f.paint.color()).unwrap().to_hex() + } + + /// Red and blue squares selected, and green and yellow squares beside them; Recolor Artwork + /// open on the selection with the Exact method, one frame drawn. + fn theme_setup(app: &mut VectorcraftApp, ctx: &egui::Context) -> [u64; 2] { + app.run("file.new", json!({"width": 300, "height": 100})).unwrap(); + let art = [square(app, 10.0, "#ff0000"), square(app, 40.0, "#0000ff")]; + square(app, 100.0, "#00ff00"); + square(app, 130.0, "#ffff00"); + app.run("select.set", json!({"ids": art})).unwrap(); + app.run("ui.recolorDialog", json!({})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert("method".into(), json!(Method::Exact.id())); + crate::theme::install_fonts(ctx); + frame(app, ctx, 0.0, vec![], 0); + art + } + + fn new_colors(app: &VectorcraftApp) -> Vec { + super::rows(app.ui.dialog.as_ref().unwrap()).iter().map(|r| r["to"].clone()).collect() + } + + /// The Color Theme Picker's picks (the `themePicks` field) give the rows that aren't excluded + /// the palette of the art picked, in row order, repeating it when the rows outnumber its + /// colors, and the art previews them. Picks that touch no art leave the rows as they are, and + /// OK keeps the recolor as one undo step. + #[test] + fn theme_picks_give_the_rows_the_palette_of_the_art_picked() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let ctx = egui::Context::default(); + let [red, blue] = theme_setup(&mut app, &ctx); + let mut start = new_colors(&app); + start.sort_by_key(Value::to_string); + assert_eq!(start, [json!("rgb 0 0 255"), json!("rgb 255 0 0")]); + // The red art's row and the blue art's row. + let row_of = |app: &VectorcraftApp, key: &str| super::rows(app.ui.dialog.as_ref().unwrap()).iter().position(|r| r["from"][0] == key).unwrap(); + let (r, b) = (row_of(&app, "rgb 255 0 0"), row_of(&app, "rgb 0 0 255")); + let undo = app.session.doc().unwrap().history.undo.len(); + let set = |app: &mut VectorcraftApp, picks: Value| { + app.ui.dialog.as_mut().unwrap().fields.insert(THEME_PICKS.into(), picks); + }; + set(&mut app, json!([{"at": [107, 17]}])); + frame(&mut app, &ctx, 0.1, vec![], 0); + assert_eq!(new_colors(&app), [json!("rgb 0 255 0"), json!("rgb 0 255 0")], "one color for both rows"); + assert_eq!((fill_hex(&app, red), fill_hex(&app, blue)), ("#00ff00".into(), "#00ff00".into()), "the art previews it"); + set(&mut app, json!([{"at": [107, 17]}, {"rect": [125, 5, 150, 30]}])); + frame(&mut app, &ctx, 0.2, vec![], 0); + assert_eq!(new_colors(&app), [json!("rgb 0 255 0"), json!("rgb 255 255 0")], "a pick added: two colors"); + // An excluded row (the red art's) keeps its new color. + let d = app.ui.dialog.as_mut().unwrap(); + let mut rs = super::rows(d); + rs[r]["exclude"] = json!(true); + d.fields.insert("rows".into(), Value::Array(rs)); + let kept = new_colors(&app)[r].clone(); + set(&mut app, json!([{"at": [47, 17]}])); + frame(&mut app, &ctx, 0.3, vec![], 0); + let after = new_colors(&app); + assert_eq!((&after[r], &after[b]), (&kept, &json!("rgb 0 0 255"))); + set(&mut app, json!([{"at": [250, 80]}])); + frame(&mut app, &ctx, 0.4, vec![], 0); + assert_eq!(new_colors(&app), after, "empty canvas: the rows stay"); + assert_eq!(app.session.doc().unwrap().history.undo.len(), undo, "nothing is committed before OK"); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!((fill_hex(&app, red), fill_hex(&app, blue)), ("#ff0000".into(), "#0000ff".into()), "the excluded row kept red"); + assert_eq!(app.session.doc().unwrap().history.undo.len(), undo + 1, "one undo step"); + } + + /// One frame with `modifiers` held. + fn frame_with(app: &mut VectorcraftApp, ctx: &egui::Context, time: f64, events: Vec, modifiers: egui::Modifiers) { + let events = std::iter::once(egui::Event::ModifiersChanged(modifiers)).chain(events).collect(); + let input = egui::RawInput { time: Some(time), events, ..Default::default() }; + let mut out = ctx.run_ui(input, |ui| super::super::show(app, ui.ctx())); + out.textures_delta.clear(); + } + + /// With the Color Theme Picker on, a click on the canvas picks the object there and a Shift-drag + /// adds the art inside its marquee; with it off the dialog takes no picks from the canvas. + #[test] + fn the_theme_picker_takes_clicks_and_shift_drags_on_the_canvas() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let ctx = egui::Context::default(); + let [red, _] = theme_setup(&mut app, &ctx); + // Clear of the dialog, which centers itself in the screen. + let canvas = Rect::from_min_size(pos2(-1000.0, -1000.0), vec2(3000.0, 3000.0)); + app.canvas_rect = Some(canvas); + let xf = crate::canvas::Xf::new(canvas, app.view().unwrap()); + let at = |x: f64, y: f64| xf.to_screen(vectorcraft_geom::Point::new(x, y)); + let button = |pos, pressed, modifiers| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers }; + let none = egui::Modifiers::NONE; + let click = |app: &mut VectorcraftApp, pos: egui::Pos2, t: f64| { + frame_with(app, &ctx, t, vec![egui::Event::PointerMoved(pos), button(pos, true, none)], none); + frame_with(app, &ctx, t + 0.05, vec![button(pos, false, none)], none); + frame_with(app, &ctx, t + 0.1, vec![], none); + }; + let green = at(107.0, 17.0); + assert!(canvas.contains(green), "{green:?}"); + click(&mut app, green, 1.0); + assert_eq!(app.ui.dialog.as_ref().unwrap().fields.get(THEME_PICKS), Some(&json!([])), "off: no picks"); + assert_eq!(app.ui.dialog.as_ref().unwrap().fields.get(THEME_PICKER), Some(&json!(false)), "the fields `ui.dialog.set` can set"); + app.ui.dialog.as_mut().unwrap().fields.insert(THEME_PICKER.into(), json!(true)); + for n in 0..5 { + frame_with(&mut app, &ctx, 2.0 + f64::from(n) * 0.01, vec![], none); + } + click(&mut app, green, 3.0); + assert_eq!(app.ui.dialog.as_ref().unwrap().fields[THEME_PICKS].as_array().map(Vec::len), Some(1)); + assert_eq!(new_colors(&app), [json!("rgb 0 255 0"), json!("rgb 0 255 0")]); + assert_eq!(fill_hex(&app, red), "#00ff00", "the art previews the picked color"); + // A Shift-drag around the yellow square. + let shift = egui::Modifiers::SHIFT; + let (a, b) = (at(125.0, 5.0), at(150.0, 30.0)); + frame_with(&mut app, &ctx, 4.0, vec![egui::Event::PointerMoved(a), button(a, true, shift)], shift); + frame_with(&mut app, &ctx, 4.05, vec![egui::Event::PointerMoved(a + (b - a) * 0.5)], shift); + frame_with(&mut app, &ctx, 4.1, vec![egui::Event::PointerMoved(b)], shift); + frame_with(&mut app, &ctx, 4.15, vec![button(b, false, shift)], shift); + frame_with(&mut app, &ctx, 4.2, vec![], none); + let picks = app.ui.dialog.as_ref().unwrap().fields[THEME_PICKS].clone(); + assert_eq!(picks.as_array().map(Vec::len), Some(2), "{picks}"); + assert!(picks[1].get("rect").is_some(), "{picks}"); + assert_eq!(new_colors(&app), [json!("rgb 0 255 0"), json!("rgb 255 255 0")]); + } + /// In a CMYK document colors opened alone are saved as a new color group in their own model. #[test] fn a_new_group_from_colors_keeps_their_model_in_a_cmyk_document() { diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 4825b5ea1d..38194b3a42 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -2795,6 +2795,8 @@ digits Malayalam Малаялам Reset Rotate View Нулиране на изгледа на завъртане Rotate View to Selection Завъртане на изгледа спрямо селекцията Reset the rows to the artwork's colors Нулиране на редовете към цветовете на илюстрацията + Color Theme Picker Избор на цветова тема + Click or drag across the art to pick its colors; Shift adds more Щракнете или плъзнете през илюстрацията, за да вземете цветовете ѝ; Shift добавя още Reset to Default Връщане към стандартните Reset to White, Black Нулиране към бяло, черно Reset with Mesh Нулиране с мрежа diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 89622f761c..ada7148cb2 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -2823,6 +2823,8 @@ digits Malayalam Malajalam Randomly change saturation and brightness Nasumično promijeni zasićenje i svjetlinu Recolor this row Ponovo oboji ovaj red Reset the rows to the artwork's colors Vrati redove na boje crteža + Color Theme Picker Birač teme boja + Click or drag across the art to pick its colors; Shift adds more Kliknite ili prevucite preko crteža da uzmete njegove boje; Shift dodaje još Separate colors into rows Razdvoji boje u redove Unlink harmony colors Prekini vezu boja harmonije 1 Color Job Posao s 1 bojom diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 0b642a2007..4cae06ce83 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3573,6 +3573,8 @@ digits Malayalam Malaiàlam Reset Rotate View Restableix la rotació de la vista Reset Ruler Origin Restableix l’origen de les regles Reset the rows to the artwork's colors Restableix les files als colors de l’obra + Color Theme Picker Selector de tema de colors + Click or drag across the art to pick its colors; Shift adds more Feu clic o arrossegueu sobre l’obra per agafar-ne els colors; Maj n’afegeix més Reset to Default Restableix el valor predeterminat Reset to default Restableix el valor predeterminat Reset to Defaults Restableix els valors predeterminats diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index b9599f2f6d..054d6ca71b 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -2859,6 +2859,8 @@ digits Malayalam Malajálamské Randomly change saturation and brightness Náhodně změnit sytost a jas Recolor this row Přebarvit tento řádek Reset the rows to the artwork's colors Obnovit řádky na barvy kresby + Color Theme Picker Výběr barevného motivu + Click or drag across the art to pick its colors; Shift adds more Klepnutím nebo tažením přes kresbu převezmete její barvy; Shift přidá další Separate colors into rows Rozdělit barvy do řádků Unlink harmony colors Zrušit propojení barev harmonie 1 Color Job Zakázka s 1 barvou diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 1256ed94ef..f823886799 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -2643,6 +2643,8 @@ digits Malayalam Malayalam Randomly change saturation and brightness Ændr mætning og lysstyrke tilfældigt Recolor this row Omfarv denne række Reset the rows to the artwork's colors Nulstil rækkerne til grafikkens farver + Color Theme Picker Farvetemavælger + Click or drag across the art to pick its colors; Shift adds more Klik eller træk hen over grafikken for at hente dens farver; Skift tilføjer flere Separate colors into rows Opdel farver i rækker Unlink harmony colors Fjern sammenkædning af harmonifarver 1 Color Job 1-farvejob diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 17392851a3..cdef532c04 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2841,6 +2841,8 @@ digits Malayalam Malayalam Reset Rotate View Ansichtsdrehung zurücksetzen Rotate View to Selection Ansicht nach Auswahl drehen Reset the rows to the artwork's colors Zeilen auf die Farben der Grafik zurücksetzen + Color Theme Picker Farbthema-Auswahl + Click or drag across the art to pick its colors; Shift adds more Klicken oder ziehen Sie über die Grafik, um ihre Farben aufzunehmen; Umschalt fügt weitere hinzu Reset to Default Auf Standard zurücksetzen Reset to White, Black Auf Weiß, Schwarz zurücksetzen Reset with Mesh Mit Gitter zurücksetzen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 48099c9440..3adaf41c73 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3478,6 +3478,8 @@ digits Malayalam Μαλαγιάλαμ Reset Rotate View Επαναφορά περιστροφής προβολής Rotate View to Selection Περιστροφή προβολής ως προς την επιλογή Reset the rows to the artwork's colors Επαναφορά γραμμών στα χρώματα του σχεδίου + Color Theme Picker Επιλογέας χρωματικού θέματος + Click or drag across the art to pick its colors; Shift adds more Κάντε κλικ ή σύρετε πάνω στο σχέδιο για να πάρετε τα χρώματά του· το Shift προσθέτει κι άλλα Reset to White, Black Επαναφορά σε λευκό και μαύρο Reset with Mesh Επαναφορά με πλέγμα Reset with Mesh… Επαναφορά με πλέγμα… diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 8bc2616f25..e10460d2c2 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2874,6 +2874,8 @@ digits Malayalam Malayálam Reset Rotate View Restablecer rotación de vista Rotate View to Selection Rotar vista según la selección Reset the rows to the artwork's colors Restablecer las filas a los colores de la ilustración + Color Theme Picker Selector de tema de color + Click or drag across the art to pick its colors; Shift adds more Haga clic o arrastre sobre la ilustración para tomar sus colores; Mayús añade más Reset to Default Restablecer valores predeterminados Reset to White, Black Restablecer a blanco, negro Reset with Mesh Restablecer con malla diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index d9bf3e80da..dc5e90b7e6 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -2803,6 +2803,8 @@ digits Malayalam Malajalam Randomly change saturation and brightness Muuta kylläisyyttä ja kirkkautta satunnaisesti Recolor this row Väritä tämä rivi uudelleen Reset the rows to the artwork's colors Palauta rivit kuvituksen väreihin + Color Theme Picker Väriteeman valitsin + Click or drag across the art to pick its colors; Shift adds more Napsauta tai vedä kuvituksen yli poimiaksesi sen värit; Vaihto lisää useampia Separate colors into rows Erottele värit riveille Unlink harmony colors Poista harmoniavärien linkitys 1 Color Job 1 värin työ diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 93f330de11..8ad2f33d84 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -2866,6 +2866,8 @@ digits Malayalam Malayalam Reset Rotate View Réinitialiser la rotation de l’affichage Rotate View to Selection Faire pivoter l’affichage selon la sélection Reset the rows to the artwork's colors Réinitialiser les lignes avec les couleurs de l’illustration + Color Theme Picker Sélecteur de thème de couleurs + Click or drag across the art to pick its colors; Shift adds more Cliquez ou faites glisser sur l’illustration pour prélever ses couleurs ; Maj en ajoute d’autres Reset to Default Rétablir les valeurs par défaut Reset to White, Black Réinitialiser à blanc, noir Reset with Mesh Réinitialiser avec un filet diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index d2fc0dc733..4b49a74dbc 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -3904,6 +3904,8 @@ antiAlias Sharp शार्प Reset Text Transform टेक्स्ट ट्रांसफॉर्मर को रीसेट करें Reset Text Transform and Scale टेक्स्ट ट्रांसफॉर्म और स्केल को रीसेट करें Reset the rows to the artwork's colors आर्टवर्क के रंग के लिए पंक्तियों को रीसेट करें + Color Theme Picker रंग थीम पिकर + Click or drag across the art to pick its colors; Shift adds more आर्टवर्क के रंग लेने के लिए उस पर क्लिक करें या खींचें; Shift और जोड़ता है Reset to default डिफ़ॉल्ट पर रीसेट करें Reset to Default डिफ़ॉल्ट पर रीसेट करें Reset to Defaults डिफ़ॉल्ट पर रीसेट करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index eadf8f2058..6cb1887d31 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3425,6 +3425,8 @@ mark-style Japanese Japán Reset Rotate View Nézetforgatás visszaállítása Rotate View to Selection Nézet elforgatása a kijelöléshez Reset the rows to the artwork's colors Sorok visszaállítása a grafika színeire + Color Theme Picker Színtéma-választó + Click or drag across the art to pick its colors; Shift adds more Kattintson vagy húzzon a grafikán a színei felvételéhez; a Shift továbbiakat ad hozzá Reset to default Alapérték visszaállítása Reset to Default Alapérték visszaállítása Reset to Defaults Alapértékek visszaállítása diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 1dc3348ae3..b6e418d3c9 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -2643,6 +2643,8 @@ digits Malayalam Malayalam Randomly change saturation and brightness Ubah saturasi dan kecerahan secara acak Recolor this row Warnai ulang baris ini Reset the rows to the artwork's colors Setel ulang baris ke warna karya seni + Color Theme Picker Pemilih tema warna + Click or drag across the art to pick its colors; Shift adds more Klik atau seret melintasi karya seni untuk mengambil warnanya; Shift menambahkan lagi Separate colors into rows Pisahkan warna ke dalam baris Unlink harmony colors Lepaskan tautan warna harmoni 1 Color Job Pekerjaan 1 warna diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index ee47282a98..c08abb71ec 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -2917,6 +2917,8 @@ digits Malayalam Malayalam Reset Rotate View Reimposta rotazione vista Rotate View to Selection Ruota vista in base alla selezione Reset the rows to the artwork's colors Reimposta le righe sui colori della grafica + Color Theme Picker Selettore tema colore + Click or drag across the art to pick its colors; Shift adds more Fai clic o trascina sulla grafica per prelevarne i colori; Maiusc ne aggiunge altri Reset to Default Reimposta valori predefiniti Reset to White, Black Reimposta su bianco, nero Reset with Mesh Reimposta con trama diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 4d73b8aedc..8ebeee91fb 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -2922,6 +2922,8 @@ mark-style Japanese 日本式 No settings found 設定が見つかりません Reset Profiles プロファイルをリセット Reset the rows to the artwork's colors 行をアートワークのカラーにリセット + Color Theme Picker カラーテーマピッカー + Click or drag across the art to pick its colors; Shift adds more アートワークをクリックまたはドラッグしてカラーを取得します。Shift キーで追加します Reset to Default 初期設定に戻す Reset to White, Black 白、黒にリセット Reset {name} {name}をリセット diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 7ac6cef429..a9fca89616 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -2560,6 +2560,8 @@ digits Malayalam მალაიალამური Randomly change saturation and brightness გაჯერებისა და სიკაშკაშის შემთხვევითი შეცვლა Recolor this row ამ სტრიქონის ხელახლა შეფერადება Reset the rows to the artwork's colors სტრიქონებისთვის ნახატის ფერების დაბრუნება + Color Theme Picker ფერთა თემის ამრჩევი + Click or drag across the art to pick its colors; Shift adds more დააწკაპუნეთ ან გადაატარეთ ნახატზე მისი ფერების ასაღებად; Shift ამატებს კიდევ Separate colors into rows ფერების სტრიქონებად დაყოფა Unlink harmony colors ჰარმონიის ფერების კავშირის გაწყვეტა 1 Color Job 1-ფერიანი ბეჭდვა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index fff1a1a14a..88ef2e7e1b 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -2911,6 +2911,8 @@ mark-style Japanese 일본식 No settings found 설정을 찾을 수 없음 Reset Profiles 프로필 재설정 Reset the rows to the artwork's colors 행을 아트웍 색상으로 재설정 + Color Theme Picker 색상 테마 피커 + Click or drag across the art to pick its colors; Shift adds more 아트웍을 클릭하거나 드래그하여 색상을 가져옵니다. Shift 키로 더 추가합니다 Reset to Default 기본값으로 재설정 Reset to White, Black 흰색, 검정으로 재설정 Reset {name} {name} 재설정 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index c03747f38a..ad97d1eaa5 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -2657,6 +2657,8 @@ digits Malayalam Malayalam Randomly change saturation and brightness Verzadiging en helderheid willekeurig wijzigen Recolor this row Deze rij opnieuw kleuren Reset the rows to the artwork's colors De rijen herstellen naar de kleuren van de artwork + Color Theme Picker Kleurthemakiezer + Click or drag across the art to pick its colors; Shift adds more Klik of sleep over het artwork om de kleuren ervan op te nemen; Shift voegt er meer toe Separate colors into rows Kleuren over rijen verdelen Unlink harmony colors Harmoniekleuren ontkoppelen 1 Color Job Opdracht in 1 kleur diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 40efff131c..8fbeb60004 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -2768,6 +2768,8 @@ digits Malayalam Malajalam Randomly change saturation and brightness Losowo zmień nasycenie i jasność Recolor this row Zmień kolory tego wiersza Reset the rows to the artwork's colors Przywróć w wierszach kolory kompozycji + Color Theme Picker Próbnik motywu kolorów + Click or drag across the art to pick its colors; Shift adds more Kliknij lub przeciągnij po kompozycji, aby pobrać jej kolory; Shift dodaje kolejne Separate colors into rows Rozdziel kolory na wiersze Unlink harmony colors Odłącz kolory harmonii 1 Color Job Praca 1-kolorowa diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index f7bda91264..31d8e7d819 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2412,6 +2412,8 @@ digits Malayalam Malaiala Reset Rotate View Redefinir Visualização Girada Rotate View to Selection Girar Visualização para a Seleção Reset the rows to the artwork's colors Redefinir as linhas para as cores da arte + Color Theme Picker Seletor de Tema de Cores + Click or drag across the art to pick its colors; Shift adds more Clique ou arraste sobre a arte para pegar suas cores; Shift adiciona mais Reset to Default Redefinir para o Padrão Reset to White, Black Redefinir para Branco, Preto Reset with Mesh… Redefinir com Malha… diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 92a9e3c965..5670e5ce37 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -2904,6 +2904,8 @@ digits Malayalam Малаялам Reset Rotate View Сбросить поворот вида Rotate View to Selection Повернуть вид по выделению Reset the rows to the artwork's colors Сбросить строки к цветам рисунка + Color Theme Picker Выбор цветовой темы + Click or drag across the art to pick its colors; Shift adds more Щёлкните или проведите по рисунку, чтобы взять его цвета; Shift добавляет ещё Reset to Default Сбросить к значениям по умолчанию Reset to White, Black Сбросить к белому, чёрному Reset with Mesh Сбросить с сеткой diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index a2c032a5db..9da423bd4b 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -2810,6 +2810,8 @@ digits Malayalam Malayalam Reset Rotate View Återställ Rotera vy Rotate View to Selection Rotera vyn efter markeringen Reset the rows to the artwork's colors Återställ raderna till teckningens färger + Color Theme Picker Färgtemaväljare + Click or drag across the art to pick its colors; Shift adds more Klicka eller dra över teckningen för att hämta dess färger; Skift lägger till fler Reset to Default Återställ till standard Reset to White, Black Återställ till vitt, svart Reset with Mesh Återställ med nät diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 2fea56d318..b975767c1b 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2679,6 +2679,8 @@ digits Malayalam Malayalam Reset Rotate View Döndürme Görünümünü Sıfırla Rotate View to Selection Görünümü Seçime Döndür Reset the rows to the artwork's colors Satırları resmin renklerine göre sıfırlayın + Color Theme Picker Renk Teması Seçici + Click or drag across the art to pick its colors; Shift adds more Renklerini almak için resme tıklayın veya üzerinde sürükleyin; Shift daha fazlasını ekler Reset to Default Varsayılana Sıfırla Reset to White, Black Beyaz, Siyah'a Sıfırla Reset with Mesh Mesh ile Sıfırla diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 4aac86567b..e57f291c8b 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -2909,6 +2909,8 @@ digits Malayalam Малаялам Reset Rotate View Скинути поворот виду Rotate View to Selection Повернути вид за виділенням Reset the rows to the artwork's colors Скинути рядки до кольорів малюнка + Color Theme Picker Вибір колірної теми + Click or drag across the art to pick its colors; Shift adds more Клацніть або проведіть по малюнку, щоб узяти його кольори; Shift додає ще Reset to Default Скинути до значень за замовчуванням Reset to White, Black Скинути до білого, чорного Reset with Mesh Скинути із сіткою diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index f40f0292a2..46d0f80d42 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3198,6 +3198,8 @@ mark-style Japanese Kiểu Nhật Rotate View to Selection Xoay chế độ xem theo vùng chọn Reset Ruler Origin Đặt lại gốc thước Reset the rows to the artwork's colors Đặt lại các hàng về màu của tác phẩm + Color Theme Picker Bộ chọn bộ màu + Click or drag across the art to pick its colors; Shift adds more Nhấp hoặc kéo qua tác phẩm để lấy màu của nó; Shift để thêm Reset to Default Đặt lại về mặc định Reset to default Đặt lại về mặc định Reset to White, Black Đặt lại về Trắng, Đen diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 6602ee3916..c8a101c8ce 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2774,6 +2774,8 @@ digits Malayalam 马拉雅拉姆数字 Reset Rotate View 重置旋转视图 Rotate View to Selection 按所选对象旋转视图 Reset the rows to the artwork's colors 将各行重置为图稿的颜色 + Color Theme Picker 色彩主题拾取器 + Click or drag across the art to pick its colors; Shift adds more 单击或拖过图稿以拾取其颜色;按住 Shift 可添加更多 Reset to Default 恢复默认 Reset to White, Black 重置为白、黑 Reset with Mesh 以网格重置 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 545a75bcad..cf50fc3b7b 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -3882,6 +3882,8 @@ digits Malayalam 馬來亞拉姆數字 Reset Rotate View 重設旋轉檢視 Rotate View to Selection 依選取範圍旋轉檢視 Reset the rows to the artwork's colors 將各列重設為圖稿的顏色 + Color Theme Picker 色彩主題選取器 + Click or drag across the art to pick its colors; Shift adds more 按一下或拖過圖稿以選取其顏色;按住 Shift 可加入更多 Reset to Default 重設為預設值 Reset to White, Black 重設為白色、黑色 Reset with Mesh 以網格重設 diff --git a/docs/mcp.md b/docs/mcp.md index 996908799f..899b349ae3 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3431,6 +3431,27 @@ the library's colors. Colors that no row holds, such as preserved White and Blac {"name":"run_command","arguments":{"command":"recolor.apply","params":{"map":{"#ff0000":"#ff0000","#0000ff":"#0000ff"},"globalAdjust":{"saturation":-40,"temperature":25}}}} ``` +`recolor.pickTheme {picks, colors?}` is the dialog's Color Theme Picker: it returns the color palette of the art picked +as `colors` (keys, the most used first) and `objects` (how many objects it read), and changes nothing. Each pick is +`{at: [x, y]}`, a click that reads the object a Selection tool click there takes with everything inside it, or +`{rect: [x0, y0, x1, y1]}`, a marquee that reads every painted object it touches and the part of each image inside it +(document points; 1 to 256 picks, which add up). It reads visible fills and strokes, gradient stops, text, mesh points, +pattern tiles (with the patterns they use), the art of symbol instances (placed through their 9-slice guides), the +colorize color of an image it applies to and the pixels of other images: at most 65,536 pixels of each pick of an +image, spread evenly, and 1,048,576 pixels of at most 64 images in all, leaving out pixels less than half opaque and +images it can't decode; each image is decoded once for all its picks. In a clip group, or under an opacity mask that +clips, it reads only what shows inside the clipping path or the mask art, and a blend, envelope or repeat that a +marquee touches is read whole. Hidden or fully transparent objects and fill or stroke items are left out, and locked +objects are read. As VectorCraft's own rule, each object read weighs the same, shared among its colors (an image's +among its pixels; the vector art a symbol instance places counts as one object, and each image it places counts on +its own), and similar colors merge (k-means in Lab) into at most `colors` (1 to 64, default 5), each shown by its +most used color in its own model. Picks that touch no art return no colors. In the Recolor Artwork dialog the picks are the `themePicks` field: the rows that aren't +excluded take the palette as their new colors in row order, the colors repeating when the rows outnumber them. + +```json +{"name":"run_command","arguments":{"command":"recolor.pickTheme","params":{"picks":[{"at":[120,80]},{"rect":[200,40,320,140]}],"colors":4}}} +``` + The `recolor.*` commands refuse parameters of the wrong form. A `limitTo` or `method` that is not a string gets the error for an unknown library or method. Other wrong-form parameters get an error that names them. `includeImages`, `includePatterns`, a row's `exclude`, `order`, `saturationBrightness` and the `white`, `black` and diff --git a/docs/ui-parity.md b/docs/ui-parity.md index bb2857d119..f9b4c26637 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -478,6 +478,8 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po - [x] Recolor Artwork › Assign: double-click a row's new color to pick it in the Color Picker, in the model it was picked in (part of #4028); a Lab new color is kept but can't be typed yet (the picker's Lab fields work in RGB); Lab entry, swatch libraries and the row menu remain. +- [x] Recolor Artwork › Color Theme Picker: with the button beside the tabs on, a click on the canvas takes the color palette of an object or image, a drag takes the palette of the art inside its marquee, and Shift adds more picks; the rows that aren't excluded take the palette as their new colors and the art previews them ([Recolor artwork](https://helpx.adobe.com/illustrator/desktop/manage-colors/modify-colors/recolor-artwork.html)). The number and order of the picked colors are VectorCraft's own rule (`recolor.pickTheme`). Tests: `theme_picks_give_the_rows_the_palette_of_the_art_picked` and `the_theme_picker_takes_clicks_and_shift_drags_on_the_canvas` in `crates/ui-egui/src/dialogs/recolor.rs`, `theme_picker_*` in `crates/engine/src/tests/recolor.rs`. + - [x] Recolor Artwork Edit color chips scroll within the screen, preserving the wheel and actions (#3416); 5, 20, 200 and 400 colors, resizing and UI scaling, final-chip editing and preview/history covered by egui_kittest. - [x] Status messages and bounded readouts remain stable as values, canvas hover and background jobs change; ordinary values fit all registered languages and units, and optional groups yield in narrow windows (regressions; contributor rebuilt and confirmed the original-file status-bar scenario on 2026-10-19). Sample widths are cached per UI and refreshed only when language, document units or pixels per point changes. From fcec08e1bbe3044b1fa11d6d6c8603504f9129be Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 15:41:23 -0800 Subject: [PATCH 06/15] Document Info: the clear-paint test expects Gradient Objects to skip clear gradients Gradient Objects now leaves out fills and strokes at an opacity of 0, so the test expects no gradient count once every fill and stroke of the spot gradient object is clear. --- crates/engine/src/cmd/docinfo.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/docinfo.rs b/crates/engine/src/cmd/docinfo.rs index a5a0261610..c548c3d85a 100644 --- a/crates/engine/src/cmd/docinfo.rs +++ b/crates/engine/src/cmd/docinfo.rs @@ -1380,7 +1380,7 @@ mod tests { /// Spot Color Objects leaves out a fill or stroke at an opacity of 0, which prints no ink, and /// keeps the object while another of its fills or strokes prints the spot color. Gradient - /// Objects still lists a clear gradient fill. + /// Objects leaves out a clear gradient fill as well. #[test] fn spot_color_objects_skip_clear_fills_and_strokes() { let mut s = Session::new(); @@ -1412,7 +1412,7 @@ mod tests { s.execute("appearance.setItem", &json!({"index": index, "opacity": 0})).unwrap(); } } - assert_eq!(spots(&mut s), (vec![], None, Some(1))); + assert_eq!(spots(&mut s), (vec![], None, None)); } /// Document Info › Objects counts an object with a gradient or a pattern on both its fill and From c97cea8a65c1d18c38e6e139e8bf033920e3d087 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 14:44:09 -0800 Subject: [PATCH 07/15] Align: artboard Distribute buttons need three artboards with Align to Selection With the Artboard tool chosen and Align to Selection, two selected artboards are the first and the last of the distribution, so the Align panel's and the Control bar's Distribute buttons are off until three are selected. With Align to Artboard the spacing places the second artboard from the active one, and two are enough. The Distribute Spacing field takes negative values with the Artboard tool chosen, as artboard.distributeSpacing overlaps the artboards with a negative spacing. With other tools its lowest value stays 0. Art inside two overlapping artboards now goes with the one first in artboard order when the artboard Align and Distribute commands move them, and stays when that artboard stays, as in the other artboard edits. --- crates/engine/src/cmd/artboardalign.rs | 17 ++++-- crates/engine/src/cmd/artboardalign/tests.rs | 33 ++++++++++++ crates/ui-egui/src/chrome/control_bar.rs | 7 +-- crates/ui-egui/src/chrome/tests.rs | 8 ++- crates/ui-egui/src/panels/align.rs | 21 ++++++-- crates/ui-egui/src/panels/align/tests.rs | 57 ++++++++++++++++++++ docs/mcp.md | 8 +-- 7 files changed, 136 insertions(+), 15 deletions(-) diff --git a/crates/engine/src/cmd/artboardalign.rs b/crates/engine/src/cmd/artboardalign.rs index 9832133729..541ec94a4e 100644 --- a/crates/engine/src/cmd/artboardalign.rs +++ b/crates/engine/src/cmd/artboardalign.rs @@ -17,7 +17,7 @@ pub fn specs() -> Vec { "Align", [], None, - "{index? | indices?: [n…], selectedArtboards?: [n…] (as artboard.duplicate; default: the artboards the Artboard tool has selected, else its active one), horizontal?: \"left\"|\"center\"|\"right\", vertical?: \"top\"|\"center\"|\"bottom\" (one of the two is needed), to?: \"selection\"|\"artboard\" (default \"selection\": the bounds of the artboards together; \"artboard\": artboard `artboard`, which stays where it is), artboard?: n (0-based; the artboard to align to with to: \"artboard\"; default: the Artboard tool's active one; it need not be one of the artboards aligned), activeArtboard?: n (the journal records that default here, for a replay; `artboard` goes ahead of it), moveArt?: bool (the art fully inside each artboard moves with it; default: the Artboard tool's Move Artwork with Artboard option), patterns?: bool, lockedAndHidden?: bool (as artboard.move)} (Align panel › Align Objects with the Artboard tool chosen) each artboard moves until its edge or center is on that edge or center of what it aligns to, with its guides, in one undo step; a locked artboard stays where it is and still counts in the bounds, and the call fails with `the artboard is locked` when every artboard it names is locked; when no artboard moves, no undo step is recorded → {moved: [index…]}", + "{index? | indices?: [n…], selectedArtboards?: [n…] (as artboard.duplicate; default: the artboards the Artboard tool has selected, else its active one), horizontal?: \"left\"|\"center\"|\"right\", vertical?: \"top\"|\"center\"|\"bottom\" (one of the two is needed), to?: \"selection\"|\"artboard\" (default \"selection\": the bounds of the artboards together; \"artboard\": artboard `artboard`, which stays where it is), artboard?: n (0-based; the artboard to align to with to: \"artboard\"; default: the Artboard tool's active one; it need not be one of the artboards aligned), activeArtboard?: n (the journal records that default here, for a replay; `artboard` goes ahead of it), moveArt?: bool (the art fully inside each artboard moves with it, art inside two of them with the first by index, which may stay; default: the Artboard tool's Move Artwork with Artboard option), patterns?: bool, lockedAndHidden?: bool (as artboard.move)} (Align panel › Align Objects with the Artboard tool chosen) each artboard moves until its edge or center is on that edge or center of what it aligns to, with its guides, in one undo step; a locked artboard stays where it is and still counts in the bounds, and the call fails with `the artboard is locked` when every artboard it names is locked; when no artboard moves, no undo step is recorded → {moved: [index…]}", has_doc, align ), @@ -114,18 +114,27 @@ fn kept(b: &Boards, items: &[(usize, Rect)], gap: Option) -> Result Result { let d = &s.doc()?.doc; - let moves: Vec<(usize, Vec2)> = + let mut moves: Vec<(usize, Vec2)> = moves.iter().copied().filter(|(i, dv)| (dv.x.abs() > 1e-9 || dv.y.abs() > 1e-9) && d.artboards.get(*i).is_some_and(|a| !a.locked)).collect(); + // In artboard order, as the other artboard edits take them, whatever order the Distribute + // commands spaced them in. + moves.sort_by_key(|(i, _)| *i); let moved: Vec = moves.iter().map(|(i, _)| *i).collect(); if moves.is_empty() { return Ok(json!({ "moved": moved })); } - let arts = artboards_art(s, &moved, b.move_art, b.locked_art, true)?; + // The art of every artboard named, those that stay included, so that art on overlapping + // artboards goes with the first by index; then that of the artboards that move. + let named: Vec = b.items.iter().map(|(i, _)| *i).collect(); + let arts: Vec<(usize, Vec)> = + artboards_art(s, &named, b.move_art, b.locked_art, true)?.into_iter().filter(|(i, _)| moved.contains(i)).collect(); let ids: Vec = arts.iter().flat_map(|(_, a)| a.iter().copied()).collect(); let sc = Scaling { patterns: super::object::transform_patterns(s, p, &ids)?, ..Scaling::default() }; s.edit(label, |d, _| { diff --git a/crates/engine/src/cmd/artboardalign/tests.rs b/crates/engine/src/cmd/artboardalign/tests.rs index 94733b099e..526a50db31 100644 --- a/crates/engine/src/cmd/artboardalign/tests.rs +++ b/crates/engine/src/cmd/artboardalign/tests.rs @@ -265,6 +265,39 @@ fn bad_params_are_errors() { assert_eq!((undo_steps(&s), corners(&s)), (steps, before)); } +/// Art inside two overlapping artboards moves with the one first in artboard order, as with the +/// other artboard edits, even when Distribute spaces the other one first: artboard 2 at x 140 is +/// left of artboard 1 at x 200, and the square inside both goes with artboard 1. +#[test] +fn art_on_overlapping_artboards_moves_with_the_first_by_index() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 100, "height": 100})).unwrap(); + s.execute("artboard.new", &json!({"x": 200, "y": 0, "width": 100, "height": 100})).unwrap(); + s.execute("artboard.new", &json!({"x": 140, "y": 0, "width": 100, "height": 100})).unwrap(); + let sq = s.execute("shape.rectangle", &json!({"x": 210, "y": 10, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let p = json!({"indices": ALL, "to": "artboard", "artboard": 0, "spacing": 10}); + assert_eq!(s.execute("artboard.distributeSpacing", &p).unwrap(), json!({"moved": [1, 2]})); + assert_eq!(corners(&s), [(0.0, 0.0), (220.0, 0.0), (110.0, 0.0)]); + assert_eq!(corner(&s, sq), (230.0, 10.0), "with artboard 1, 20 pt to the right"); +} + +/// Art inside an artboard that stays and a later one that moves stays with the first: artboard 2 +/// overlaps artboard 0, and aligning it to artboard 0 leaves the square inside both in place. +#[test] +fn art_shared_with_an_artboard_that_stays_stays() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 100, "height": 100})).unwrap(); + s.execute("artboard.new", &json!({"x": 200, "y": 0, "width": 100, "height": 100})).unwrap(); + s.execute("artboard.new", &json!({"x": 60, "y": 0, "width": 100, "height": 100})).unwrap(); + let sq = s.execute("shape.rectangle", &json!({"x": 70, "y": 10, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let p = json!({"indices": [0, 2], "horizontal": "left", "to": "artboard", "artboard": 0}); + assert_eq!(s.execute("artboard.align", &p).unwrap(), json!({"moved": [2]})); + assert_eq!(corners(&s)[2], (0.0, 0.0)); + assert_eq!(corner(&s, sq), (70.0, 10.0), "with artboard 0, which stays"); +} + /// An artboard's own guides move with it. #[test] fn an_artboards_guides_move_with_it() { diff --git a/crates/ui-egui/src/chrome/control_bar.rs b/crates/ui-egui/src/chrome/control_bar.rs index e7c4145397..3315387d4f 100644 --- a/crates/ui-egui/src/chrome/control_bar.rs +++ b/crates/ui-egui/src/chrome/control_bar.rs @@ -283,8 +283,9 @@ fn groups_before_transform(app: &mut VectorcraftApp, ui: &mut Ui, objects: usize } /// Draws the Control bar's Align group after the artboard controls, with the Artboard tool in use: -/// the Align buttons, the Align To menu and, for two or more selected artboards, the Distribute -/// buttons. They align and distribute the selected artboards +/// the Align buttons, the Align To menu and, while they can space the selected artboards +/// ([`crate::panels::align::artboards_distribute`]), the Distribute buttons. They align and +/// distribute the selected artboards /// ([`crate::panels::align::run_button`]). Each shows only while the bar has room for it, and none /// while the panel menu has the group off. fn artboard_align_group(app: &mut VectorcraftApp, ui: &mut Ui) { @@ -295,7 +296,7 @@ fn artboard_align_group(app: &mut VectorcraftApp, ui: &mut Ui) { crate::panels::align::align_buttons(app, ui, BUTTON); if ui.available_width() >= crate::panels::align::align_to_menu_width(BUTTON) + ui.spacing().item_spacing.x { crate::panels::align::align_to_menu(app, ui, BUTTON); - if crate::panels::align::artboards_selected(app) > 1 && ui.available_width() >= GROUP_GAP + buttons_width(ui, 6) { + if crate::panels::align::artboards_distribute(app) && ui.available_width() >= GROUP_GAP + buttons_width(ui, 6) { ui.add_space(GROUP_GAP); crate::panels::align::distribute_buttons(app, ui, BUTTON); } diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index 9350180586..bc06c8687e 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -2670,7 +2670,8 @@ fn menus_stop_above_a_control_bar_docked_at_the_bottom() { } /// With the Artboard tool in use, the Control bar shows the Align buttons after the artboard -/// controls while it has room, and the Distribute buttons for two or more selected artboards. A +/// controls while it has room, and the Distribute buttons for two or more selected artboards with +/// Align to Artboard and three or more with Align to Selection. A /// click aligns the selected artboards as the Align panel's button does. The group is left out /// while the panel menu has it off. #[test] @@ -2699,7 +2700,10 @@ fn the_control_bar_aligns_the_selected_artboards_with_the_artboard_tool() { assert!(button(&mut app, "Vertical Align Top").is_some(), "one artboard: the Align buttons"); assert!(button(&mut app, "Horizontal Distribute Left").is_none(), "one artboard: no Distribute buttons"); app.session.set_tool_option("selected", &json!([1, 0])); - assert!(button(&mut app, "Horizontal Distribute Left").is_some(), "two artboards: the Distribute buttons"); + assert!(button(&mut app, "Horizontal Distribute Left").is_none(), "two artboards, Align to Selection: no Distribute buttons"); + app.ui.align_to = crate::panels::align::AlignTo::Artboard; + assert!(button(&mut app, "Horizontal Distribute Left").is_some(), "two artboards, Align to Artboard: the Distribute buttons"); + app.ui.align_to = crate::panels::align::AlignTo::Selection; let r = button(&mut app, "Vertical Align Top").expect("Vertical Align Top"); let press = |pressed| egui::Event::PointerButton { pos: r.center(), button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; diff --git a/crates/ui-egui/src/panels/align.rs b/crates/ui-egui/src/panels/align.rs index 1888ea177f..417468f642 100644 --- a/crates/ui-egui/src/panels/align.rs +++ b/crates/ui-egui/src/panels/align.rs @@ -142,6 +142,14 @@ pub(crate) fn artboards_selected(app: &VectorcraftApp) -> usize { if n == 0 { 0 } else { super::artboards::picked(app, n).len() } } +/// With the Artboard tool chosen, whether the Distribute buttons of the Align panel and the Control +/// bar can space the selected artboards: two or more with Align to Artboard, whose spacing places +/// the second from the active one (the Artboard tool's selection always holds its active artboard), +/// else three or more, since the first and the last stay where they are. +pub(crate) fn artboards_distribute(app: &VectorcraftApp) -> bool { + artboards_selected(app) >= if app.ui.align_to == AlignTo::Artboard { 2 } else { 3 } +} + /// Runs what a click on button `b` runs with the Artboard tool chosen: the artboard command on /// the artboards the tool has selected. With Align to Artboard chosen, it sends `to: "artboard"`, /// which keeps the tool's active artboard in place, and the Distribute buttons send the @@ -219,6 +227,12 @@ fn spacing_sent(app: &VectorcraftApp) -> Option { sent.then_some(app.ui.align_spacing) } +/// The lowest Distribute Spacing value the Align panel's field takes: none with the Artboard tool +/// chosen, since `artboard.distributeSpacing` overlaps the artboards with a negative spacing, else 0. +fn spacing_min(app: &VectorcraftApp) -> f64 { + if on_artboards(app) { f64::NEG_INFINITY } else { 0.0 } +} + /// The six align buttons of the Control bar and the Properties panel, `size` points square. /// They align to what the Align panel's Align To says (the key object while there is one), as /// its own buttons do (#789), and the selected artboards with the Artboard tool chosen. @@ -405,8 +419,9 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let spacing = app.ui.align_spacing; let key = spacing_sent(app).is_some(); // Two or more objects and ruler guides (#1597), or anchor points, which may all be on one - // path; or two or more artboards. - let distributes = boards.map_or(n + selected_guides(app) >= 2 || has_anchors(app), |b| b >= 2); + // path; or the artboards [`artboards_distribute`] asks for. + let distributes = boards.map_or(n + selected_guides(app) >= 2 || has_anchors(app), |_| artboards_distribute(app)); + let (unit, min_spacing) = (app.session.general_unit(), spacing_min(app)); widgets::subheader(ui, tl!("Align Objects:")); ui.horizontal(|ui| { ui.spacing_mut().item_spacing.x = 5.0; @@ -452,7 +467,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { run_button(app, Button::Spacing("horizontal")).ok(); } ui.add_enabled_ui(key, |ui| { - if let Some(v) = widgets::spin_field(ui, "align-spacing", Some(spacing), app.session.general_unit(), 70.0, 1.0, 0.0, &[]) { + if let Some(v) = widgets::spin_field(ui, "align-spacing", Some(spacing), unit, 70.0, 1.0, min_spacing, &[]) { app.ui.align_spacing = v; } }); diff --git a/crates/ui-egui/src/panels/align/tests.rs b/crates/ui-egui/src/panels/align/tests.rs index abb5b9f195..385fd25fae 100644 --- a/crates/ui-egui/src/panels/align/tests.rs +++ b/crates/ui-egui/src/panels/align/tests.rs @@ -800,6 +800,63 @@ fn the_distribute_buttons_space_the_selected_artboards() { assert_eq!(app.session.journal.len(), ran, "one artboard: the Distribute buttons are off"); } +/// Whether the widget at `rect` in the last frame takes clicks (an enabled button). +fn clickable(ctx: &egui::Context, rect: egui::Rect) -> bool { + ctx.viewport(|vp| vp.prev_pass.widgets.layers().flat_map(|(_, w)| w.iter()).any(|w| w.rect == rect && w.sense.senses_click())) +} + +/// With Align to Selection chosen, two selected artboards are the ends of the distribution +/// already, so the Distribute buttons are off; with Align to Artboard and the active artboard +/// selected, the spacing places the second from it, and they are on. +#[test] +fn the_distribute_buttons_need_three_artboards_without_a_spacing() { + let mut app = selected_artboards(); + // Making an artboard active selects it alone, so the selection is set after. + crate::panels::artboards::select(&mut app, 1); + app.session.set_tool_option("selected", &json!([1, 2])); + let ctx = egui::Context::default(); + let (left, space) = distribute_buttons(&mut app, &ctx); + assert!(!clickable(&ctx, left) && !clickable(&ctx, space), "Align to Selection: off for two artboards"); + app.ui.align_to = AlignTo::Artboard; + let (left, space) = distribute_buttons(&mut app, &ctx); + assert!(clickable(&ctx, left) && clickable(&ctx, space), "Align to Artboard: on for two artboards"); + app.ui.align_spacing = 20.0; + click(&ctx, &mut app, space.center(), show); + assert_eq!(artboard_corners(&app), [(0.0, 0.0), (150.0, 40.0), (230.0, 10.0)], "a gap of 20: {}", app.ui.status); +} + +/// With Align to Artboard chosen, the spacing is measured from the active artboard, which is +/// always one of the selected ones: selecting artboards 0 and 2 makes artboard 0 active, and +/// Horizontal Distribute Space with 20 keeps it in place. +#[test] +fn the_artboard_spacing_is_measured_from_a_selected_artboard() { + let mut app = selected_artboards(); + app.session.set_tool_option("selected", &json!([0, 2])); + assert_eq!((app.session.tool_options()["active"].clone(), artboards_selected(&app)), (json!(0), 2)); + app.ui.align_to = AlignTo::Artboard; + app.ui.align_spacing = 20.0; + let ctx = egui::Context::default(); + let (_, space) = distribute_buttons(&mut app, &ctx); + click(&ctx, &mut app, space.center(), show); + assert_eq!(last_sent(&app), ("artboard.distributeSpacing".to_string(), json!("artboard"), Some(json!(20.0)))); + assert_eq!(artboard_corners(&app), [(0.0, 0.0), (150.0, 40.0), (120.0, 10.0)], "a gap of 20 after artboard 0: {}", app.ui.status); +} + +/// With the Artboard tool chosen, the Distribute Spacing value can be negative, as +/// `artboard.distributeSpacing` takes it: the artboards then overlap. With another tool its +/// lowest value is 0. +#[test] +fn the_artboard_spacing_can_be_negative() { + let mut app = selected_artboards(); + assert_eq!(spacing_min(&app), f64::NEG_INFINITY); + app.ui.align_to = AlignTo::Artboard; + app.ui.align_spacing = -10.0; + run_button(&mut app, Button::Spacing("horizontal")).unwrap(); + assert_eq!(artboard_corners(&app), [(60.0, 0.0), (150.0, 40.0), (200.0, 10.0)], "10 pt overlaps: {}", app.ui.status); + app.select_tool("selection"); + assert_eq!(spacing_min(&app), 0.0); +} + /// A button's shortcut entry is enabled by, and runs, the artboard command with the Artboard tool /// chosen and the object command with another tool. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 0a6d0cf4b9..e73ed45b8b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5036,8 +5036,9 @@ the Align To choice, and while there is a key object or a key guide they send th With the Artboard tool chosen, the same buttons and UI commands, and the Control bar's Align and Distribute buttons, run `artboard.align`, `artboard.distribute` and `artboard.distributeSpacing` on the artboards the tool has selected. Align To then offers Align to Selection and Align to Artboard. Align to Artboard sends `to: "artboard"`, which keeps the -tool's active artboard in place, and the Distribute buttons then send the Distribute Spacing value as `spacing`. Align -to Selection sends `to: "selection"`. The Distribute buttons need two or more selected artboards. +tool's active artboard in place, and the Distribute buttons then send the Distribute Spacing value as `spacing`, which +can then be negative. Align to Selection sends `to: "selection"`. The Distribute buttons need two or more selected +artboards with Align to Artboard, and three or more with Align to Selection. Edit › Keyboard Shortcuts and `shortcuts.list` leave out a command with no default shortcut when a key press cannot run it: no item of the menu bar runs it, it opens no dialog when run without params, and it is one of these: @@ -6004,7 +6005,8 @@ artboard it names is locked. When no artboard changes, the command records no un Align and distribute artboards ([Align and distribute artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/align-and-distribute-artboards.html)): three commands move whole artboards, by default those the Artboard tool has selected, else its active one. Each takes `index? | indices?`, `to?: "selection"|"artboard"`, `artboard?: n`, `moveArt?`, `patterns?` and `lockedAndHidden?`, and -returns `{moved: [index…]}`. +returns `{moved: [index…]}`. With `moveArt`, art inside two of the artboards goes with the one first in artboard order, and stays when that one +stays. - `artboard.align {horizontal?: "left"|"center"|"right", vertical?: "top"|"center"|"bottom"}` moves each artboard until the named edge or center is on that edge or center of the bounds of all the artboards named. One of the two From e3f16091951717d940d06400c1149032e9e2fcf2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 15:53:31 -0800 Subject: [PATCH 08/15] Tests: Intertwine keeps a third member in front of a raised overlap's margin A red, blue and green rectangle are made into an Intertwine group, and red is brought over blue where they overlap. The green sliver meets that overlap's edge over red only. The test checks that green still draws in front of red within the 2 pt margin, that red's raised area takes in the margin where only red paints, and that it leaves out the part where green paints too. --- crates/engine/src/tests/intertwine.rs | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/crates/engine/src/tests/intertwine.rs b/crates/engine/src/tests/intertwine.rs index ecb9742a30..a7fbf93ea2 100644 --- a/crates/engine/src/tests/intertwine.rs +++ b/crates/engine/src/tests/intertwine.rs @@ -104,6 +104,45 @@ fn the_object_brought_over_shows_no_seam_of_the_one_below() { assert!(worst < 8, "blue shows through ring A at the top crossing (blue {worst})"); } +fn green(r: &Rendered, x: u32, y: u32) -> bool { + let p = r.pixel(x, y); + p[3] > 200 && p[1] > 200 && p[0] < 60 && p[2] < 60 +} + +/// The margin an object brought over another is raised in past their overlap reaches only where +/// that object alone paints: a third member that meets the overlap's edge stays in front of it +/// there. Red A (20..80 × 20..60) and blue B (40..60 × 30..70) overlap in 40..60 × 30..60; the +/// green sliver C (38..40 × 40..50), in front of both, meets that overlap at x = 40 over A only. +#[test] +fn raising_one_overlap_keeps_an_adjacent_third_member_above_its_seam() { + let mut s = session(); + let rect = |s: &mut Session, x: f64, y: f64, w: f64, h: f64, color: &str| { + let id = id_of(&s.execute("shape.rectangle", &json!({"x": x, "y": y, "width": w, "height": h})).unwrap()); + s.execute("paint.setFill", &json!({"ids": [id.0], "color": color})).unwrap(); + s.execute("paint.setStroke", &json!({"ids": [id.0], "none": true})).unwrap(); + id + }; + let a = rect(&mut s, 20.0, 20.0, 60.0, 40.0, "#ff0000"); + let b = rect(&mut s, 40.0, 30.0, 20.0, 40.0, "#0000ff"); + let c = rect(&mut s, 38.0, 40.0, 2.0, 10.0, "#00ff00"); + select(&mut s, &[a, b, c]); + let g = id_of(&s.execute("object.intertwine.make", &json!({})).unwrap()); + let r = render(&s); + assert!(green(&r, 39, 45) && blue(&r, 50, 45) && red(&r, 39, 55)); + let v = arrange(&mut s, json!({"at": [50, 45], "order": "front", "member": a.0})); + assert_eq!((&v["count"], &v["top"]), (&json!(1), &json!([a.0]))); + assert_eq!(order_at(&s.doc().unwrap().doc, g, 50.0, 45.0), [b, a]); + let r = render(&s); + assert!(red(&r, 50, 45), "A is brought over B"); + assert!(green(&r, 39, 45), "C stays in front of A within the margin"); + assert!(red(&r, 39, 55)); + let raised = area(&s, a).unwrap(); + let inside = |x, y| vectorcraft_tools::intertwine::contains(&raised, vectorcraft_geom::Point::new(x, y)); + assert!(inside(50.5, 45.5), "the overlap"); + assert!(inside(39.5, 55.5), "the margin where only A paints"); + assert!(!inside(39.5, 45.5), "the margin leaves out where C paints too"); +} + #[test] fn clicking_the_same_overlap_again_swaps_back() { let mut s = session(); From 3031fcf96dfceb77e73d884c584751fbb1210306 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 16:01:28 -0800 Subject: [PATCH 09/15] Cutting Tools: the weed params text keeps the spacing range in one key The comma in "more than 0, at most 100000" split the `spacing` entry in the params text of `addon.cutting.weed`, so the params check read "at most 100000 (...)" as a key and every_description_parses failed. The range now reads "more than 0 and at most 100000". --- crates/engine/src/cmd/addons/cutting/weed.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/addons/cutting/weed.rs b/crates/engine/src/cmd/addons/cutting/weed.rs index e5873d08d6..8a6375a595 100644 --- a/crates/engine/src/cmd/addons/cutting/weed.rs +++ b/crates/engine/src/cmd/addons/cutting/weed.rs @@ -40,7 +40,7 @@ pub fn specs() -> Vec { "Weed Box and Lines…", ["Object", "Plug-ins", "Cutting Tools"], None, - "{margin?: pt 0..100000 (9: from the art to the weed box), box?: true (false: the weeding lines only), direction?: \"horizontal\" | \"vertical\" | \"both\" (\"both\"), count?: whole number 0..1000 of lines each way (1), spacing?: pt more than 0, at most 100000 (instead of count, never with it: as few lines as keep them at most this far apart, up to 1000 each way), gap?: pt 0..100000 (0: the lines stop at the art's outlines), weight?: pt 0.01..1000 (0.3), swatch?: a color swatch the lines are stroked in (\"[Registration]\")} add a weed box around the selected art and weeding lines across it that divide it evenly, each running from one side of the box to the other and left out over the art and within `gap` of its outlines, so the waste lifts off in pieces. The art is measured by the outlines a cutter cuts: closed paths enclose their area by their fill rule and open paths are lines, compound paths by all their subpaths, type by its glyph outlines, a clip group by what shows inside its clipping path, images by their frames, placed files by the art they show (by their boxes when the file can't be read), symbol instances by their art and live objects by the art they draw; strokes, effects and hidden objects are left out. One group named Weeding, stroked with no fill, on top of the current layer (outside the clip groups around a group edited in isolation), selected, as one undo step → {id: the group, box: its weed box or null, lines (pieces of weeding line)}", + "{margin?: pt 0..100000 (9: from the art to the weed box), box?: true (false: the weeding lines only), direction?: \"horizontal\" | \"vertical\" | \"both\" (\"both\"), count?: whole number 0..1000 of lines each way (1), spacing?: pt more than 0 and at most 100000 (instead of count, never with it: as few lines as keep them at most this far apart, up to 1000 each way), gap?: pt 0..100000 (0: the lines stop at the art's outlines), weight?: pt 0.01..1000 (0.3), swatch?: a color swatch the lines are stroked in (\"[Registration]\")} add a weed box around the selected art and weeding lines across it that divide it evenly, each running from one side of the box to the other and left out over the art and within `gap` of its outlines, so the waste lifts off in pieces. The art is measured by the outlines a cutter cuts: closed paths enclose their area by their fill rule and open paths are lines, compound paths by all their subpaths, type by its glyph outlines, a clip group by what shows inside its clipping path, images by their frames, placed files by the art they show (by their boxes when the file can't be read), symbol instances by their art and live objects by the art they draw; strokes, effects and hidden objects are left out. One group named Weeding, stroked with no fill, on top of the current layer (outside the clip groups around a group edited in isolation), selected, as one undo step → {id: the group, box: its weed box or null, lines (pieces of weeding line)}", has_selection, weed )] From d3375c165602e27593fe2376e3c9b4ee470ad6bb Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 16:04:30 -0800 Subject: [PATCH 10/15] Color: Toggle RGB Percent switches the RGB units from the keyboard The double-click right of an RGB field was the only way to switch R, G and B between percent and 0 to 255 from the UI. ui.colorRgbPercent (Toggle RGB Percent) is listed in the command palette and in Keyboard Shortcuts without a default key, and switches the same setting. A parameter answers an error and changes nothing. The label has a row in every complete catalog. --- crates/mcp/src/ui_catalog.rs | 6 +++++ crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + crates/ui-egui/src/menus/run.rs | 1 + crates/ui-egui/src/menus/ui_commands.rs | 6 +++++ crates/ui-egui/src/panels/color.rs | 27 ++++++++++++++++++--- crates/ui-egui/src/panels/color/tests.rs | 31 ++++++++++++++++++++++++ docs/control-protocol.md | 4 ++- docs/mcp.md | 2 ++ docs/target-app-parity.md | 2 +- 35 files changed, 101 insertions(+), 5 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 044d4b0098..5c137347c0 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1244,6 +1244,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{mode?: grayscale|rgb|hsb|cmyk|websafe, options?: bool, recentColors?: bool, rgbPercent?: bool} pick the Color panel's mode as its panel menu does (the active color converts to the mode's model as one undo step), Show Options (true) or Hide Options (false), check (true) or uncheck (false) Show Recent Colors, which shows or hides the panel's Recent Colors row (applied colors still join the list while it is hidden; the Swatches panel keeps its row), and show the RGB mode's R, G and B in percent (true) or from 0 to 255 (false), as a double-click right of an RGB field switches them (the color does not change; Web Safe RGB and the hex field stay in 0 to 255); all four are kept with the preferences; RGB, HSB, Web Safe RGB and hex values use the working RGB space (ui.inspect: ui.color_mode, ui.color_hide_options, ui.color_show_recent_colors, ui.color_rgb_percent) → {mode (null: none picked yet), options, recentColors, rgbPercent, shown: the mode the panel shows the color in, or tint for a tint of a global or spot swatch}", ), + ( + "ui.colorRgbPercent", + "Toggle RGB Percent", + "", + "{} switch the Color panel's R, G and B between percent and 0 to 255, as a double-click right of an RGB field does (ui.colorPanel {rgbPercent}); the color does not change, and the choice is kept with the preferences; a parameter is an error and changes nothing → true when they show in percent", + ), ( "ui.savePdfDialog", "Save PDF Dialog", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 582a927f09..59a90fb3eb 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3209,6 +3209,7 @@ digits Malayalam Малаялам Show Note Показване на бележка Show Options Показване на опциите Show Recent Colors Показване на скорошните цветове + Toggle RGB Percent Превключване на RGB в проценти Show Original Path Показване на оригиналния път Open this dialog with these settings next time Отваряне на този прозорец с тези настройки следващия път Auto-Simplify Автоматично опростяване diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index d92da7ae40..12b0b4296f 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -1577,6 +1577,7 @@ digits Malayalam Malajalam Select a text object to edit its character attributes. Odaberite tekstualni objekat da uredite njegove atribute znakova. Show Options Prikaži opcije Show Recent Colors Prikaži nedavne boje + Toggle RGB Percent Uključi/isključi RGB u postocima Color Panel Options Opcije panela boja Small Caps Mala velika slova Small Caps (on the roadmap) Mala velika slova (u planu) diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 283dae1800..ec47856891 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4172,6 +4172,7 @@ digits Malayalam Malaiàlam Show Note Mostra la nota Show Options Mostra les opcions Show Recent Colors Mostra els colors recents + Toggle RGB Percent Commuta RGB en percentatge Show Original Path Mostra el traçat original Show Package Mostra el paquet Show Panel Mostra el panell diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 519963c4eb..66a150193f 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -1606,6 +1606,7 @@ digits Malayalam Malajálamské Select a text object to edit its character attributes. Vyberte textový objekt, abyste mohli upravit atributy jeho znaků. Show Options Zobrazit možnosti Show Recent Colors Zobrazit nedávné barvy + Toggle RGB Percent Přepnout RGB v procentech Color Panel Options Možnosti panelu Barva Small Caps Kapitálky Small Caps (on the roadmap) Kapitálky (v plánu) diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 3269755003..ba3d8db4ee 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -1513,6 +1513,7 @@ digits Malayalam Malayalam Select a text object to edit its character attributes. Markér et tekstobjekt for at redigere dets tegnattributter. Show Options Vis indstillinger Show Recent Colors Vis seneste farver + Toggle RGB Percent Skift RGB i procent Small Caps Kapitæler Small Caps (on the roadmap) Kapitæler (på vejkortet) Standard Vertical Roman Alignment Standard lodret romersk justering diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index f3858abc1f..fc86077d41 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3269,6 +3269,7 @@ digits Malayalam Malayalam Show Note Notiz einblenden Show Options Optionen einblenden Show Recent Colors Zuletzt verwendete Farben einblenden + Toggle RGB Percent RGB in Prozent umschalten Show Original Path Originalpfad einblenden Open this dialog with these settings next time Dieses Dialogfeld nächstes Mal mit diesen Einstellungen öffnen Auto-Simplify Automatisch vereinfachen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 52a12276f7..22a8fee2e8 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3763,6 +3763,7 @@ digits Malayalam Μαλαγιάλαμ Show Note Εμφάνιση σημείωσης Show Options Εμφάνιση επιλογών Show Recent Colors Εμφάνιση πρόσφατων χρωμάτων + Toggle RGB Percent Εναλλαγή RGB σε ποσοστό Show Original Path Εμφάνιση αρχικής διαδρομής Open this dialog with these settings next time Άνοιγμα αυτού του παραθύρου με αυτές τις ρυθμίσεις την επόμενη φορά Auto-Simplify Αυτόματη απλοποίηση diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index e6f77cd908..393d090f77 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3300,6 +3300,7 @@ digits Malayalam Malayálam Show Note Mostrar nota Show Options Mostrar opciones Show Recent Colors Mostrar colores recientes + Toggle RGB Percent Alternar RGB en porcentaje Show Original Path Mostrar trazado original Open this dialog with these settings next time Abrir este cuadro de diálogo con estos ajustes la próxima vez Auto-Simplify Simplificar automáticamente diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index dc0e432264..ffb8a912e1 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -1580,6 +1580,7 @@ digits Malayalam Malajalam Select a text object to edit its character attributes. Valitse tekstiobjekti, jonka merkkimääritteitä haluat muokata. Show Options Näytä asetukset Show Recent Colors Näytä viimeisimmät värit + Toggle RGB Percent Vaihda RGB prosentteina Small Caps Kapiteelit Small Caps (on the roadmap) Kapiteelit (suunnitteilla) Standard Vertical Roman Alignment Tavallinen pystysuuntainen latinalainen tasaus diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3c74586ef0..477b697621 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3292,6 +3292,7 @@ digits Malayalam Malayalam Show Note Afficher la note Show Options Afficher les options Show Recent Colors Afficher les couleurs récentes + Toggle RGB Percent Basculer RVB en pourcentage Show Original Path Afficher le tracé d’origine Open this dialog with these settings next time Ouvrir cette boîte de dialogue avec ces réglages la prochaine fois Auto-Simplify Simplifier automatiquement diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 8e1ce7cc2a..f526921203 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4504,6 +4504,7 @@ antiAlias Sharp शार्प Show Note नोट दिखाएं Show Options ऑप्शन्स दिखाएँ Show Recent Colors हाल के रंग दिखाएँ + Toggle RGB Percent RGB प्रतिशत में बदलें Show Original Path मूल पाथ दिखाएं Show Package पैकेज करें दिखाएँ Show Panel शो पैनल diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 15ce573c11..170c552a88 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3934,6 +3934,7 @@ mark-style Japanese Japán Show Note Megjegyzés megjelenítése Show Options Beállítások megjelenítése Show Recent Colors Legutóbbi színek megjelenítése + Toggle RGB Percent RGB százalékos megjelenítésének váltása Show Original Path Eredeti útvonal megjelenítése Open this dialog with these settings next time Legközelebb ez a párbeszédablak nyíljon meg ezekkel a beállításokkal Auto-Simplify Automatikus egyszerűsítés diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index f68fad0c1c..7a5d653f38 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -1513,6 +1513,7 @@ digits Malayalam Malayalam Select a text object to edit its character attributes. Pilih objek teks untuk mengedit atribut karakternya. Show Options Tampilkan opsi Show Recent Colors Tampilkan warna terbaru + Toggle RGB Percent Alihkan RGB dalam persen Small Caps Kapital kecil Small Caps (on the roadmap) Kapital kecil (masih dalam roadmap) Standard Vertical Roman Alignment Perataan Romawi vertikal standar diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 480115859b..634db2ff80 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3345,6 +3345,7 @@ digits Malayalam Malayalam Show Note Mostra nota Show Options Mostra opzioni Show Recent Colors Mostra colori recenti + Toggle RGB Percent Alterna RGB in percentuale Show Original Path Mostra tracciato originale Open this dialog with these settings next time Apri questa finestra di dialogo con queste impostazioni la prossima volta Auto-Simplify Semplifica automaticamente diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index ba3105aec0..2460a2d98d 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3165,6 +3165,7 @@ mark-style Japanese 日本式 Show Note メモを表示 Show Options オプションを表示 Show Recent Colors 最近使用したカラーを表示 + Toggle RGB Percent RGB のパーセント表示を切り替え Show Original Path 元のパスを表示 Open this dialog with these settings next time 次回はこの設定でこのダイアログを開く Auto-Simplify 自動単純化 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 83fadf726a..cd2f49a73b 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -1451,6 +1451,7 @@ digits Malayalam მალაიალამური Select a text object to edit its character attributes. სიმბოლოების ატრიბუტების რედაქტირებისთვის მონიშნეთ ტექსტური ობიექტი. Show Options პარამეტრების ჩვენება Show Recent Colors ბოლოდროინდელი ფერების ჩვენება + Toggle RGB Percent RGB-ის პროცენტებში ჩვენების გადართვა Small Caps პატარა მთავრული Small Caps (on the roadmap) პატარა მთავრული (სამომავლო გეგმაშია) Standard Vertical Roman Alignment სტანდარტული ვერტიკალური ლათინური სწორება diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index e6f7478bf3..6bf24cea1d 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3154,6 +3154,7 @@ mark-style Japanese 일본식 Show Note 메모 표시 Show Options 옵션 표시 Show Recent Colors 최근 색상 표시 + Toggle RGB Percent RGB 백분율 표시 전환 Show Original Path 원래 패스 표시 Open this dialog with these settings next time 다음에 이 설정으로 이 대화상자 열기 Auto-Simplify 자동 단순화 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 26baaa8dc5..371158cd66 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1527,6 +1527,7 @@ digits Malayalam Malayalam Select a text object to edit its character attributes. Selecteer een tekstobject om de tekenkenmerken ervan te bewerken. Show Options Opties tonen Show Recent Colors Recente kleuren tonen + Toggle RGB Percent RGB in procenten wisselen Small Caps Kleine kapitalen Small Caps (on the roadmap) Kleine kapitalen (op de roadmap) Standard Vertical Roman Alignment Standaard verticale Romeinse uitlijning diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 3637bb6f94..50d23b5cf4 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -1518,6 +1518,7 @@ digits Malayalam Malajalam Select a text object to edit its character attributes. Zaznacz obiekt tekstowy, aby edytować atrybuty znaków. Show Options Pokaż opcje Show Recent Colors Pokaż ostatnie kolory + Toggle RGB Percent Przełącz RGB w procentach Color Panel Options Opcje panelu Kolor Small Caps Kapitaliki Small Caps (on the roadmap) Kapitaliki (w planach) diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 15aa70e244..db371671a4 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2777,6 +2777,7 @@ digits Malayalam Malaiala Show Note Mostrar Nota Show Options Mostrar Opções Show Recent Colors Mostrar Cores Recentes + Toggle RGB Percent Alternar RGB em Porcentagem Show Original Path Mostrar Caminho Original Open this dialog with these settings next time Abrir este diálogo com estas configurações na próxima vez Auto-Simplify Simplificar Automaticamente diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 21f270a0fb..1e92af19e3 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3332,6 +3332,7 @@ digits Malayalam Малаялам Show Note Показать примечание Show Options Показать параметры Show Recent Colors Показать последние цвета + Toggle RGB Percent Переключить RGB в процентах Show Original Path Показать исходный контур Open this dialog with these settings next time Открывать это диалоговое окно с этими параметрами в следующий раз Auto-Simplify Автоматическое упрощение diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 7969960880..edde9f6325 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3224,6 +3224,7 @@ digits Malayalam Malayalam Show Note Visa anteckning Show Options Visa alternativ Show Recent Colors Visa senaste färger + Toggle RGB Percent Växla RGB i procent Show Original Path Visa ursprunglig bana Open this dialog with these settings next time Öppna den här dialogrutan med de här inställningarna nästa gång Auto-Simplify Förenkla automatiskt diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 639bf692a8..b3a2847d32 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3127,6 +3127,7 @@ digits Malayalam Malayalam Show Note Notu Göster Show Options Seçenekleri Göster Show Recent Colors Son Renkleri Göster + Toggle RGB Percent RGB Yüzde Gösterimini Değiştir Show Original Path Orijinal Yolu Göster Color Panel Options Renk Paneli Seçenekleri Show Package Paketi Göster diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 2889757941..ccc02fece9 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3337,6 +3337,7 @@ digits Malayalam Малаялам Show Note Показати примітку Show Options Показати параметри Show Recent Colors Показати останні кольори + Toggle RGB Percent Переключити RGB у відсотках Show Original Path Показати початковий контур Open this dialog with these settings next time Наступного разу відкривати це діалогове вікно з цими параметрами Auto-Simplify Автоматичне спрощення diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index ca39a2cd16..fd13ef2c19 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3684,6 +3684,7 @@ mark-style Japanese Kiểu Nhật Show Note Hiện ghi chú Show Options Hiện tùy chọn Show Recent Colors Hiện màu gần đây + Toggle RGB Percent Chuyển đổi RGB theo phần trăm Show Original Path Hiện đường dẫn gốc Open this dialog with these settings next time Lần sau mở hộp thoại này với các cài đặt này Auto-Simplify Tự động đơn giản hóa diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index d4fe4ce4f3..e86d636b7f 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3165,6 +3165,7 @@ digits Malayalam 马拉雅拉姆数字 Show Note 显示注解 Show Options 显示选项 Show Recent Colors 显示最近使用的颜色 + Toggle RGB Percent 切换 RGB 百分比显示 Show Original Path 显示原始路径 Open this dialog with these settings next time 下次以这些设置打开此对话框 Auto-Simplify 自动简化 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1a81d6d01c..b2cd4f4ab4 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4312,6 +4312,7 @@ digits Malayalam 馬來亞拉姆數字 Show Note 顯示註解 Show Options 顯示選項 Show Recent Colors 顯示最近使用的顏色 + Toggle RGB Percent 切換 RGB 百分比顯示 Show Original Path 顯示原始路徑 Open this dialog with these settings next time 下次以這些設定開啟此對話方塊 Auto-Simplify 自動簡化 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 72e6c25acb..bf5490e4d8 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -929,6 +929,7 @@ fn run_ui_part10(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option crate::dialogs::tate_chu_yoko::open(app), "ui.colorGuideLimit" => crate::panels::color_guide::set_limit(app, p), "ui.colorPanel" => crate::panels::color::command(app, p), + "ui.colorRgbPercent" => crate::panels::color::rgb_percent_command(app, p), "ui.savePdfDialog" => crate::dialogs::open_save_pdf(app, p), "file.exportAs" if s("path").is_none() => { crate::dialogs::open_export_as(app, s("format").as_deref(), p); diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 824990d0a8..64ef022334 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1245,6 +1245,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{mode?: grayscale|rgb|hsb|cmyk|websafe, options?: bool, recentColors?: bool, rgbPercent?: bool} pick the Color panel's mode as its panel menu does (the active color converts to the mode's model as one undo step), Show Options (true) or Hide Options (false), check (true) or uncheck (false) Show Recent Colors, which shows or hides the panel's Recent Colors row (applied colors still join the list while it is hidden; the Swatches panel keeps its row), and show the RGB mode's R, G and B in percent (true) or from 0 to 255 (false), as a double-click right of an RGB field switches them (the color does not change; Web Safe RGB and the hex field stay in 0 to 255); all four are kept with the preferences; RGB, HSB, Web Safe RGB and hex values use the working RGB space (ui.inspect: ui.color_mode, ui.color_hide_options, ui.color_show_recent_colors, ui.color_rgb_percent) → {mode (null: none picked yet), options, recentColors, rgbPercent, shown: the mode the panel shows the color in, or tint for a tint of a global or spot swatch}", ), + ( + "ui.colorRgbPercent", + "Toggle RGB Percent", + "", + "{} switch the Color panel's R, G and B between percent and 0 to 255, as a double-click right of an RGB field does (ui.colorPanel {rgbPercent}); the color does not change, and the choice is kept with the preferences; a parameter is an error and changes nothing → true when they show in percent", + ), ( "ui.savePdfDialog", "Save PDF Dialog", diff --git a/crates/ui-egui/src/panels/color.rs b/crates/ui-egui/src/panels/color.rs index 4aee419bd1..a28fba02e5 100644 --- a/crates/ui-egui/src/panels/color.rs +++ b/crates/ui-egui/src/panels/color.rs @@ -17,7 +17,8 @@ //! A double-click right of an RGB field switches R, G and B between 0 to 255 and percent (the app //! keeps it between sessions too); Web Safe RGB and the hex field stay in 0 to 255. //! `ui.colorPanel` picks a mode, shows or hides the options and checks or unchecks Show Recent -//! Colors as the panel menu does, and switches RGB to percent and back. +//! Colors as the panel menu does, and switches RGB to percent and back. `ui.colorRgbPercent` +//! switches RGB between percent and 0 to 255 from the command palette or a keyboard shortcut. use egui::{Color32, Rect, Sense, Stroke, StrokeKind, Ui, vec2}; use serde_json::{Value, json}; @@ -584,6 +585,27 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result Result { + match p { + Value::Null => {} + Value::Object(o) => { + if let Some(key) = o.keys().next() { + return Err(format!("unknown parameter `{key}`; the command takes no parameters")); + } + } + got => return Err(format!("the params must be an object, not {got}")), + } + Ok(json!(switch_rgb_units(app))) +} + +/// Switch the RGB mode's R, G and B between percent and 0 to 255, as a double-click right of an +/// RGB field does. → whether they now show in percent. +fn switch_rgb_units(app: &mut VectorcraftApp) -> bool { + app.ui.color_rgb_percent = !app.ui.color_rgb_percent; + app.ui.color_rgb_percent +} + /// Tint mode's rows: the swatch's chip and name, and the T slider and field. Returns a new tint /// (0..1) and its phase. fn tint_rows(ui: &mut Ui, tint: &Tint, slider_w: f32, field_w: f32) -> Option<(f32, Live)> { @@ -783,8 +805,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { }); }); if switch_units { - let percent = app.ui.color_rgb_percent; - command(app, &json!({ "rgbPercent": !percent })).ok(); + switch_rgb_units(app); } ui.add_space(4.0); // A clicked chip or spectrum colour: the active colour, or with Alt the inactive proxy's. diff --git a/crates/ui-egui/src/panels/color/tests.rs b/crates/ui-egui/src/panels/color/tests.rs index 4cdd50f7fc..4538a8e5ce 100644 --- a/crates/ui-egui/src/panels/color/tests.rs +++ b/crates/ui-egui/src/panels/color/tests.rs @@ -849,6 +849,37 @@ fn rgb_percent_comes_back_after_a_restart() { assert_eq!(app.run("ui.colorPanel", json!({"rgbPercent": false})).unwrap()["rgbPercent"], false); } +/// Toggle RGB Percent switches the units from the keyboard: the command palette lists it, Keyboard +/// Shortcuts takes a key for it, and each run switches R, G and B between percent and 0 to 255 as +/// the double-click does, without changing the color. +#[test] +fn toggle_rgb_percent_switches_the_units_from_the_keyboard() { + let mut app = app(); + let ctx = egui::Context::default(); + app.run("paint.setFill", json!({"color": "#336699"})).unwrap(); + app.run("ui.colorPanel", json!({"mode": "rgb"})).unwrap(); + let listed = crate::palette::items().into_iter().any(|(label, id, _)| id == "ui.colorRgbPercent" && label == "Toggle RGB Percent"); + assert!(listed, "the command palette lists it"); + let e = crate::shortcut_editor::entry("ui.colorRgbPercent").expect("listed in Keyboard Shortcuts"); + assert_eq!(e.label, "Toggle RGB Percent"); + assert_eq!(crate::shortcut_editor::default_of("ui.colorRgbPercent"), None, "no default key"); + assert_eq!(app.run("ui.colorRgbPercent", json!({})).unwrap(), json!(true)); + assert!(app.ui.color_rgb_percent); + frame(&mut app, &ctx, vec![], egui::Modifiers::NONE); + assert_eq!(app.run("ui.colorPanel", json!({})).unwrap()["rgbPercent"], true); + for p in [json!({"rgbPercent": true}), json!({"on": false})] { + let e = app.run("ui.colorRgbPercent", p.clone()).unwrap_err(); + assert!(e.ends_with("; the command takes no parameters"), "{p}: {e}"); + } + for p in [json!(false), json!([]), json!("on")] { + assert_eq!(app.run("ui.colorRgbPercent", p.clone()).unwrap_err(), format!("the params must be an object, not {p}")); + } + assert!(app.ui.color_rgb_percent, "a parameter changes nothing"); + assert_eq!(app.run("ui.colorRgbPercent", json!({})).unwrap(), json!(false)); + assert!(!app.ui.color_rgb_percent); + assert_eq!(paints_hex(&app).0, "#336699", "the color does not change"); +} + /// `ui.colorPanel {mode}` picks a mode as the panel menu does: HSB shows an RGB fill as H, S and /// B, and CMYK converts it as one undo step. #[test] diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 2288a160bd..10c8f5ab47 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -251,7 +251,9 @@ shown}`: `mode` is null until a mode is picked, and `shown` is the mode the pane tint of a global or spot swatch. Another mode, `lab` included, answers an error, as does an `options`, `recentColors` or `rgbPercent` value that is not true or false. The desktop app keeps the four settings with its preferences, and `ui.inspect` reports them as `ui.color_mode`, `ui.color_hide_options`, `ui.color_show_recent_colors` and -`ui.color_rgb_percent`. +`ui.color_rgb_percent`. `ui.colorRgbPercent {}` (Toggle RGB Percent in the command palette and Keyboard Shortcuts) +switches R, G and B between percent and 0 to 255 and answers true when they show in percent; a parameter answers an +error and changes nothing. Color Themes panel (`window.panel {panel: "colorThemes"}`): its Create tab makes a theme on a harmony wheel and its My Themes tab lists the saved themes; every action runs a command (`colorTheme.save`, `colorTheme.delete`, diff --git a/docs/mcp.md b/docs/mcp.md index 1baefe0ea3..c94732b99e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -591,6 +591,8 @@ opens the picker through `run_command` with the remote backend. `ui.colorPanel { the panel menu's Show Recent Colors, which hides the Color panel's Recent Colors row, and `true` shows it again; applied colors still join the list while it is hidden. `ui.colorPanel {"rgbPercent": true}` shows the Color panel's RGB fields in percent, as a double-click right of an RGB field does, and `false` shows them from 0 to 255 again. +`ui.colorRgbPercent` (Toggle RGB Percent in the command palette and Keyboard Shortcuts) switches between the two +and answers true when the fields show in percent. In remote desktop mode, `invoke_menu` with `{"command":"ui.sampleScreenColor","params":{}}` shows the system's screen color sampler and returns `null` before a color is picked: the system's sampler on macOS, the XDG desktop diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 3ef2425203..56c28edcb8 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1353,7 +1353,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Unchecking Show Recent Colors in the Color panel's menu hides its Recent Colors row, and checking it shows the row again ([Select colors using the Color panel](https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/select-colors-using-the-color-panel.html)). In VectorCraft the item is checked by default and kept between sessions, applied colors still join the list while the row is hidden, Hide Options hides the row either way, and the Swatches panel keeps its row (`ui.colorPanel {recentColors}`). Tests: `show_recent_colors_hides_and_shows_the_row` in `crates/ui-egui/src/panels/color/tests.rs`. A Recent Colors chip in the Color or Swatches panel drags into the Swatches panel's list to become a swatch of its color, in its color model, as one undo step ([Select colors using the Color panel](https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/select-colors-using-the-color-panel.html)). In VectorCraft a chip dropped on a color group or one of its swatches joins that group, anywhere else in the list it joins the ungrouped swatches at the end, a color that is already a swatch is added again under another name, and dragging a chip does not paint the selected art (`swatch.new`). Tests: `a_recent_color_dragged_onto_the_list_becomes_a_swatch` and `a_recent_color_dragged_from_the_color_panel_becomes_a_swatch` in `crates/ui-egui/src/panels/swatches/tests.rs`. A Cmd/Ctrl-click on the Color panel's spectrum applies Complement and a Cmd/Ctrl+Shift-click applies Invert to the active Fill or Stroke (`paint.complement`, `paint.invert`); with Alt also held, the click recolors the inactive one, as the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) list them. - A double-click right of an RGB field switches the Color panel's R, G and B between percent and 0 to 255 ([Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html), Color panel). In VectorCraft the color does not change, Web Safe RGB and the hex field stay in 0 to 255, and the panel keeps the choice between sessions (`ui.colorPanel {rgbPercent}`); the color mixer of the Fill and Stroke chips and the gradient stop dialog follow the same setting. Tests: `rgb_percent_switches_the_rgb_fields_between_percent_and_0_to_255`, `rgb_percent_does_not_switch_while_the_rows_are_disabled` and `rgb_percent_comes_back_after_a_restart` in `crates/ui-egui/src/panels/color/tests.rs`. + A double-click right of an RGB field switches the Color panel's R, G and B between percent and 0 to 255 ([Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html), Color panel). In VectorCraft the color does not change, Web Safe RGB and the hex field stay in 0 to 255, and the panel keeps the choice between sessions (`ui.colorPanel {rgbPercent}`); the color mixer of the Fill and Stroke chips and the gradient stop dialog follow the same setting. Toggle RGB Percent (`ui.colorRgbPercent`) in the command palette and Keyboard Shortcuts switches the units from the keyboard. Tests: `rgb_percent_switches_the_rgb_fields_between_percent_and_0_to_255`, `rgb_percent_does_not_switch_while_the_rows_are_disabled`, `rgb_percent_comes_back_after_a_restart` and `toggle_rgb_percent_switches_the_units_from_the_keyboard` in `crates/ui-egui/src/panels/color/tests.rs`. View › Proof Setup › Color blindness – Tritanopia-type turns Proof Colors on and proofs the canvas with the tritanopia simulation of Brettel, Viénot and Mollon (1997). The Separations Preview panel's Proof Setup list offers the same target (`view.proofSetup {target: "tritanopia"}`). Grays keep their value. The Separations Preview panel's Gamut Check button reports one color outside the CMYK gamut in the singular and more in the plural, in English and in each language's plural forms (`gamut_check_status_takes_the_plural_form` in `crates/ui-egui/src/i18n/tests.rs`). - **Document Color Mode outside the layers:** File › Document Color Mode (in one undo step) and `document.open {colorMode}` also convert the colors of graph designs, graphic styles, opacity-mask art, the tile that pattern editing's Cancel puts back and the art of brushes (with a Hue Shift brush's key color); a tint of a global swatch there becomes the converted swatch's color at its tint, as in the art. From 4bb1df492964a505f1ca54a6329ec6972acf4adc Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 16:04:43 -0800 Subject: [PATCH 11/15] Plug-ins: a filter's gradient stop plates are clamped into range like its other colors A filter's or importer's output clamps each gradient stop's offset, opacity, midpoint, tint and color, but kept its four process plates as given, so a plate below 0, above 1 or infinite was stored in the document. Each plate is now clamped to 0-1: a value that is not a number becomes 0, and an infinite one becomes 0 or 1 by its sign. Painted live effects still refuse such a stop. Docs: docs/plugins.md, docs/target-app-parity.md. --- crates/plugins/src/objects.rs | 12 ++++++++++-- crates/plugins/src/objects/tests.rs | 27 +++++++++++++++++++++++++++ docs/plugins.md | 5 +++-- docs/target-app-parity.md | 1 + 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/crates/plugins/src/objects.rs b/crates/plugins/src/objects.rs index 26ba5b668b..3e844415a7 100644 --- a/crates/plugins/src/objects.rs +++ b/crates/plugins/src/objects.rs @@ -579,6 +579,11 @@ fn unit(v: f32) -> f32 { v.clamp(0.0, 1.0) } +/// Process plate `v` in 0..1: NaN is 0, infinities go to the nearest end. +fn plate(v: f32) -> f32 { + if v.is_nan() { 0.0 } else { unit(v) } +} + /// `c` with its components in range. pub(crate) fn clamp_color(c: Color) -> Color { match c { @@ -589,8 +594,8 @@ pub(crate) fn clamp_color(c: Color) -> Color { } } -/// A paint from plug-in output (`null`: none), with colours, opacities and offsets clamped and -/// gradient and pattern placements checked. +/// A paint from plug-in output (`null`: none), with colors, process plates, opacities and +/// offsets clamped and gradient and pattern placements checked. fn decode_paint(v: &Value, at: &str) -> Result { if v.is_null() { return Ok(Paint::None); @@ -613,6 +618,9 @@ fn decode_paint(v: &Value, at: &str) -> Result { s.midpoint = s.midpoint.clamp(0.13, 0.87); s.tint = unit(s.tint); s.color = clamp_color(s.color); + if let Some(plates) = &mut s.plates { + *plates = plates.map(plate); + } } stops.sort_by(|a, b| a.offset.total_cmp(&b.offset)); g.angle = g.angle.rem_euclid(360.0); diff --git a/crates/plugins/src/objects/tests.rs b/crates/plugins/src/objects/tests.rs index a6f3c63f30..3483971355 100644 --- a/crates/plugins/src/objects/tests.rs +++ b/crates/plugins/src/objects/tests.rs @@ -109,6 +109,33 @@ fn only_a_radial_keeps_a_focal_point_through_a_plug_in() { } } +/// A gradient stop's process plates handed back out of range are clamped to 0..1, each in its +/// place, in a fill and in a stroke (a JSON number too large for `f32` is infinite); plates in range +/// and a stop without plates are kept. +#[test] +fn gradient_stop_plates_are_clamped_through_a_plug_in() { + use vectorcraft_color::{Gradient, GradientKind, GradientPaint, GradientStop}; + let (mut d, ids, _) = doc(); + let stops = vec![GradientStop::new(0.0, Color::WHITE), GradientStop::new(0.5, Color::gray(0.5)), GradientStop::new(1.0, Color::BLACK)]; + let mut p = serde_json::to_value(Paint::Gradient(Box::new(GradientPaint::new(Gradient::new(GradientKind::Linear, stops))))).unwrap(); + p["gradient"]["stops"][0]["plates"] = json!([-0.5, 1.5, -1e300, 1e300]); + p["gradient"]["stops"][1]["plates"] = json!([0.25, 2.0, 0.75, -3.0]); + let out = json!({"objects": [{"id": ids[0].0, "fills": [p.clone()], "strokes": [{"paint": p}]}]}); + apply_output(&mut d, &ids, decode_json(out).unwrap(), None, &keep).unwrap(); + let ap = &d.node(ids[0]).unwrap().appearance; + for (what, paint) in [("fill", ap.fill_paint()), ("stroke", ap.stroke_paint())] { + let Paint::Gradient(g) = paint else { panic!("a gradient {what}") }; + let plates: Vec<_> = g.gradient.stops.iter().map(|s| s.plates).collect(); + assert_eq!(plates, [Some([0.0, 1.0, 0.0, 1.0]), Some([0.25, 1.0, 0.75, 0.0]), None], "{what}"); + } +} + +/// A plate that is not a number is 0; infinities go to the nearest end of 0..1. +#[test] +fn plates_that_are_not_finite_are_in_range() { + assert_eq!([f32::NAN, f32::INFINITY, f32::NEG_INFINITY, 0.5].map(plate), [0.0, 1.0, 0.0, 0.5]); +} + /// A path handed back as it was stays the live shape it was (a rectangle keeps its corner /// widgets); a path that changed is a plain path. #[test] diff --git a/docs/plugins.md b/docs/plugins.md index f616479167..124cc76174 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -734,8 +734,9 @@ For an **object filter**, the output is the new state of the input objects: The host validates everything before the document changes: coordinates must be finite and within ±4,000,000 pt, at most 100,000 objects and 4,000,000 anchors, 256 fills, strokes or gradient stops; colours, opacities and offsets are clamped into range, stroke weights to 0–1,000 pt and miter limits to 1–500; a pattern must exist in the document. A -paint returned unchanged keeps its swatch link; any other paint is unlinked. One refused effect record refuses the -whole output. +gradient stop's four process `plates` are clamped to 0–1 as well: a value that is not a number becomes 0, and an +infinite one becomes 0 or 1 by its sign. A paint returned unchanged keeps its swatch link; any other paint is +unlinked. One refused effect record refuses the whole output. A filter's output may also hold `documentData`: any JSON of at most 1 MiB, which replaces what the plug-in keeps with the document (`null` removes it), in the same undo step as its objects. Settings that belong to the whole document diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 68b93ac4d8..2273b1e16f 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1753,6 +1753,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Plug-in parameters as their manifest presents them (G17):** each parameter may have a `label`, a `unit` shown after its value, `help` on its label and a `helpUrl` page opened from a button, a `group` (sections that fold, after the parameters outside any group) and a `visibleWhen` that shows it only while the checkboxes and choices it names have one of the listed values (a hidden parameter still goes to the plug-in). `string` and `numberList` parameters join number, int, bool and choice, and a plug-in declares up to 256 parameters, at most 64 outside groups. The filter, live-effect and exporter dialogs use these keys, and the Appearance panel's effect editor the labels, units, help and conditions; hosts from before them ignore them. Regressions: `crates/plugins/src/dialog.rs`, `crates/plugins/src/manifest.rs`, `crates/ui-egui/src/dialogs/tests_plugin_fields.rs`, `crates/ui-egui/src/panels/appearance.rs`. Scores and hours unchanged. - **Live-effect plug-ins read their object's paints (G17):** a live effect is given the object's `fills` and `strokes` as a filter gets them, read only, and `_context.item` (`"object"`, or the fill or stroke whose own effects hold it); the result is cached by paint too, so a change of paint runs it again. Regressions: `crates/engine/src/tests/plugins.rs`, `crates/plugins/src/effect.rs`. Scores and hours unchanged. - **Filter plug-ins set effects and stroke styles (G17):** a filter is given each object's effect records and its strokes' `join`, `cap` and `miterLimit`, and may return them; the records are admitted as `effect.apply` admits them (a known effect or installed live-effect plug-in, parameters it takes, one 3D effect that fits, no texture read from a file), and one refused refuses the output. Regressions: `crates/engine/src/tests/plugins.rs`, `crates/plugins/src/objects/tests.rs`. Scores and hours unchanged. +- **Gradient stop plates from filter plug-ins are clamped (G17):** the four process `plates` of a gradient stop in a filter's or importer's output are clamped to 0–1, as its other colors are; a value that is not a number becomes 0, and an infinite one becomes 0 or 1 by its sign. Painted live effects still refuse such a stop. Regressions: `crates/plugins/src/objects/tests.rs`. Scores and hours unchanged. - **Plug-in data kept with the document (G17):** a filter writes JSON of at most 1 MiB with `documentData` (one undo step with its objects; `null` removes it) and reads it back in `_context.documentData`, which no other filter is given. It is the document's foreign data (`unknown.pluginData`, by plug-in id), as the perspective grid is, so the native file keeps it with no section of its own; an exporter is given the whole document, so it can read every plug-in's. Regressions: `crates/engine/src/tests/plugins.rs`, `crates/engine/tests/plugin_export.rs` (the exporter), `crates/doc/src/plugin_data.rs`, `crates/plugins/src/objects/tests.rs`. Scores and hours unchanged. - **Heavy filter plug-ins (G17):** a filter's manifest may ask for `"budget": "heavy"`: 1 G instructions (20 times a light run's) and 300 s a run, for routing, packing or simulation. Install Plug-in… and File › Open ask the user first, `plugin.install` needs `allowHeavy: true` (`plugin.inspect` tells beforehand), the Additional Plug-ins Folder skips such filters, and the plug-in store keeps the answer. Its dialog has no Preview; the app runs it on a thread of its own with a progress window (Cancel, Continue in Background) and applies the result as `plugin.run` with the same parameters, one undo step, unless the document or the plug-in changed meanwhile. Regressions: `crates/plugins/tests/abi.rs`, `crates/plugins/src/manifest.rs`, `crates/engine/src/tests/plugins.rs`, `crates/ui-egui/src/tests/plugin_runs.rs`. Scores and hours unchanged. - **Safe Mode for plug-ins (G17):** `vectorcraft --safe-mode` and `vectorcraft-cli --safe-mode ` start without plug-ins. When a launch stopped while a plug-in was loading or drawing its first live effect, the next launch names that plug-in, without saying it caused the stop, and offers Disable and Continue, Start Normally or Start in Safe Mode. Help › Safe Mode lists the disabled plug-ins with Enable on Re-launch, which takes effect at the next launch, and the app bar and the window title show Safe Mode. The help page (https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf, pages 65 to 69) describes the same choice between diagnosing and starting normally, a Safe Mode with the problem item off and the rest of the app working, and turning the item back on at the next launch. In Safe Mode no plug-in loads or runs, and a live-effect plug-in draws its object's geometry unchanged while the object keeps the effect, which the Appearance panel marks "(Safe Mode)" with the plug-in's id in its tooltip and `effect.list` marks `skipped`; Expand Appearance refuses such an object. The web build keeps no plug-ins between page loads and has no marker. Each desktop launch with preferences keeps a marker in the `Launch` folder next to them; `vectorcraft-cli` and a desktop launch without preferences keep none, so a stop there leads to no choice at the next launch. Disabled plug-ins are listed in `Plug-ins/disabled.json`. `plugin.safeMode` reports Safe Mode and the disabled plug-ins, and `plugin.setEnabled` changes the list. Regressions: `crates/plugins/src/safe_mode.rs`, `crates/plugins/tests/safe_mode.rs`, `crates/engine/tests/plugin_safe_mode.rs`, `crates/ui-egui/tests/safe_mode.rs`. Scores and hours unchanged. From a14236eca88bc16e3c0d6674b198fd88fc054f35 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 16:13:33 -0800 Subject: [PATCH 12/15] i18n: script errors and failed-run lines are translated in every complete-message catalog The status bar shows a failed script run as one line: the script's name, the line and column (and the included file), the error and the kind of failure, with any files the run left written. No catalog had a row for that line, so the whole line stayed in English. The errors of File, Folder, vc.run, $.evalFile, a script's $ object, its alert, confirm and prompt dialogs, vc.document, vc.log, the limits a run can pass and Drop Script Engine had no row in any complete catalog either, and several were not listed by the untranslated-strings report. - Every complete-message catalog has rows for these errors and for the failed-run line at each place and for each kind (syntax, thrown, limit, stopped, internal). The script's name, paths, numbers, code names ($.flags, File, answers, true, null, UTF-8), command ids and the text a script throws itself are kept. - A failure with no line and column, such as an error in code eval compiled, is shown with one colon after the script's name ("t.js: TypeError: no (thrown)" instead of "t.js:: TypeError: no (thrown)"). - A placeholder that occurs twice in a message template matches only the same text both times. Before, "{name}: the next answer in `answers` is for {_1}, not {name}" matched a whole failed-run line and dropped its line, column and kind. - The message scan reads the script host's fail(, value( and .over( helpers and the script interpreter's errors (the js crate), skips *_tests.rs files and cfg(all(test, ...)) modules, and reads a constant's text from the file or crate that declares it, so the Scripts menu's headers are no longer listed as messages. Tests: i18n::tests::script_errors_are_translated, script_host_errors_are_translated, a_repeated_placeholder_matches_the_same_text, message_scan_reads_constants_of_the_file_and_its_crate, message_scan_reads_script_interpreter_errors, message_scan_skips_test_modules_with_any_test_cfg, tests::script_run::an_error_without_a_place_names_the_script_and_kind. --- crates/engine/src/script/mod.rs | 6 +- crates/engine/src/tests/script_run.rs | 10 + crates/ui-egui/src/i18n/ca.tsv | 79 +++++ crates/ui-egui/src/i18n/catalog.rs | 6 +- crates/ui-egui/src/i18n/cs.tsv | 79 +++++ crates/ui-egui/src/i18n/de.tsv | 79 +++++ crates/ui-egui/src/i18n/el.tsv | 79 +++++ crates/ui-egui/src/i18n/es.tsv | 79 +++++ crates/ui-egui/src/i18n/fi.tsv | 79 +++++ crates/ui-egui/src/i18n/fr.tsv | 79 +++++ crates/ui-egui/src/i18n/hi.tsv | 79 +++++ crates/ui-egui/src/i18n/hu.tsv | 79 +++++ crates/ui-egui/src/i18n/it.tsv | 79 +++++ crates/ui-egui/src/i18n/ja.tsv | 79 +++++ crates/ui-egui/src/i18n/ka.tsv | 79 +++++ crates/ui-egui/src/i18n/ko.tsv | 79 +++++ crates/ui-egui/src/i18n/pl.tsv | 79 +++++ crates/ui-egui/src/i18n/pt-br.tsv | 79 +++++ crates/ui-egui/src/i18n/ru.tsv | 79 +++++ crates/ui-egui/src/i18n/sv.tsv | 79 +++++ crates/ui-egui/src/i18n/tests.rs | 415 ++++++++++++++++++++++++-- crates/ui-egui/src/i18n/tr.tsv | 79 +++++ crates/ui-egui/src/i18n/uk.tsv | 79 +++++ crates/ui-egui/src/i18n/vi.tsv | 79 +++++ crates/ui-egui/src/i18n/zh-hans.tsv | 79 +++++ crates/ui-egui/src/i18n/zh-hant.tsv | 79 +++++ docs/target-app-parity.md | 1 + 27 files changed, 2154 insertions(+), 22 deletions(-) diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index d1265172ae..53f6e18f75 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -2179,8 +2179,8 @@ fn failure_text(report: &Value) -> String { let s = |k: &str| report[k].as_str().unwrap_or_default(); let (line, column) = (report["line"].as_u64().unwrap_or(0), report["column"].as_u64().unwrap_or(0)); let at = match report["file"].as_str() { - Some(file) if line > 0 => format!(" line {line}, column {column} of {file}"), - _ if line > 0 => format!(" line {line}, column {column}"), + Some(file) if line > 0 => format!(": line {line}, column {column} of {file}"), + _ if line > 0 => format!(": line {line}, column {column}"), _ => String::new(), }; let written = report["written"].as_array().map_or(0, Vec::len); @@ -2190,7 +2190,7 @@ fn failure_text(report: &Value) -> String { } else { String::new() }; - format!("{}:{at}: {} ({}){kept}", s("name"), s("message"), s("kind")) + format!("{}{at}: {} ({}){kept}", s("name"), s("message"), s("kind")) } /// A run's slice: the working copy in, the real session lent to the host functions, one measured diff --git a/crates/engine/src/tests/script_run.rs b/crates/engine/src/tests/script_run.rs index 417798a862..d272fea167 100644 --- a/crates/engine/src/tests/script_run.rs +++ b/crates/engine/src/tests/script_run.rs @@ -170,6 +170,16 @@ fn an_error_names_the_script_its_place_and_kind() { assert_eq!(s.script_report().unwrap()["line"], 1); } +/// An error raised where the run has no place for it, such as in code `eval` compiled, is named +/// with the script and its kind alone, with one colon after the script's name. +#[test] +fn an_error_without_a_place_names_the_script_and_kind() { + let mut s = two_docs(); + let e = run(&mut s, "eval(\"throw new TypeError('no')\");").unwrap_err().to_string(); + assert_eq!(s.script_report().unwrap()["line"], 0); + assert_eq!(e, "t.js: TypeError: no (thrown)"); +} + #[test] fn bad_parameters_are_refused_before_anything_runs() { let mut s = two_docs(); diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 95b2615ec3..a477bcfdc4 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -5373,6 +5373,85 @@ digits Malayalam Malaiàlam @msg the script's run is no longer available l'execució de l'script ja no està disponible @msg a failed command changed undo steps that could not be put back, so the script was stopped una ordre fallida ha canviat passos de desfer que no s'han pogut restaurar, així que l'script s'ha aturat @msg a recovery copy could not be written, so the script was not run no s'ha pogut escriure una còpia de recuperació, per tant l'script no s'ha executat +@msg Script file access denied S'ha denegat l'accés al fitxer de l'script +@msg Script file exceeds 8 MiB El fitxer de l'script supera els 8 MiB +@msg Script file is not open El fitxer de l'script no està obert +@msg Script file cannot be decoded No es pot descodificar el fitxer de l'script +@msg Script file is not a regular file El fitxer de l'script no és un fitxer normal +@msg Script file does not exist El fitxer de l'script no existeix +@msg Script file could not be read No s'ha pogut llegir el fitxer de l'script +@msg Script folder has more than 2,048 entries La carpeta de l'script té més de 2.048 entrades +@msg Script file open mode must be r, w, e or a El mode d'obertura del fitxer de l'script ha de ser r, w, e o a +@msg Script file writing is not available L'escriptura de fitxers de l'script no està disponible +@msg Script file dialogs are not available Els quadres de diàleg de fitxers de l'script no estan disponibles +@msg Script files cannot be opened in another application Els fitxers de l'script no es poden obrir en una altra aplicació +@msg Script file access is unavailable on the web L'accés als fitxers de l'script no està disponible al web +@msg Script has 256 files open L'script té 256 fitxers oberts +@msg Script file path exceeds 32,767 characters El camí del fitxer de l'script supera els 32.767 caràcters +@msg Script folder mask takes too many steps to match La màscara de carpeta de l'script requereix massa passos per coincidir +@msg the script opened more file data than one run may open (32 MiB) l'script ha obert més dades de fitxer de les que pot obrir una execució (32 MiB) +@msg File.seek: takes a position and a mode File.seek: rep una posició i un mode +@msg vc.run: give a command id, as a string vc.run: indiqueu un id d'ordre, com a cadena +@msg vc.run: takes a command id and an object of parameters vc.run: rep un id d'ordre i un objecte de paràmetres +@msg vc.run: the parameters must be an object vc.run: els paràmetres han de ser un objecte +@msg vc.run: the result{place} is too large for a script vc.run: el resultat{place} és massa gran per a un script +@msg $.evalFile requires a file path $.evalFile requereix un camí de fitxer +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: el temps d'espera ha de ser un nombre finit de mil·lisegons, 0 o més +@msg $.evalFile: takes a file path and a timeout $.evalFile: rep un camí de fitxer i un temps d'espera +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: línia {line}, columna {column} de {file}: {e} (llançat) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: línia {line}, columna {column}: {e} (llançat) +@msg {name}: {e} (thrown) {name}: {e} (llançat) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: línia {line}, columna {column} de {file}: {e} (límit) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: línia {line}, columna {column}: {e} (límit) +@msg {name}: {e} (limit) {name}: {e} (límit) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: línia {line}, columna {column} de {file}: {e} (error de sintaxi) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: línia {line}, columna {column}: {e} (error de sintaxi) +@msg {name}: {e} (syntax) {name}: {e} (error de sintaxi) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: línia {line}, columna {column} de {file}: {e} (aturat) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: línia {line}, columna {column}: {e} (aturat) +@msg {name}: {e} (stopped) {name}: {e} (aturat) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: línia {line}, columna {column} de {file}: {e} (error intern) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: línia {line}, columna {column}: {e} (error intern) +@msg {name}: {e} (internal) {name}: {e} (error intern) +@msg {e} (these files stay written: {paths}) {e} (aquests fitxers continuen escrits: {paths}) +@msg $.{name}: give a name, as a string $.{name}: indiqueu un nom, com a cadena +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: indiqueu una configuració regional com "en" o "de_DE", o null per a la de la interfície +@msg $.localize: give true or false $.localize: indiqueu true o false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: només es pot establir 512, que activa la localització, o 0 +@msg $.flags: give a number $.flags: indiqueu un nombre +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: aquí els scripts només llegeixen i escriuen UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: indiqueu el nom d'una codificació, com a cadena +@msg $.memCache: the memory cache size cannot be set $.memCache: no es pot establir la mida de la memòria cau +@msg $.setenv: give a value, as a string $.setenv: indiqueu un valor, com a cadena +@msg $.setenv: only {_1} can be set $.setenv: només es poden establir {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: un valor té com a màxim {MAX_ENV_BYTES} lletres, xifres i _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: indiqueu un nombre de mil·lisegons de 0 a {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: indiqueu un nombre de mil·lisegons +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: una execució no pot esperar dins d'una crida de retorn d'una funció integrada, un getter, una conversió o un fitxer que executa $.evalFile; crideu-la des del codi propi de l'script +@msg $.bp: scripts here have no debugger $.bp: aquí els scripts no tenen depurador +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: els scripts encara no poden mostrar un quadre de diàleg +@msg {name}: give a message {name}: indiqueu un missatge +@msg {name}: give the text the field starts with {name}: indiqueu el text amb què comença el camp +@msg {name}: the message is longer than 16 KiB {name}: el missatge ocupa més de 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: el títol ocupa més de 256 bytes +@msg {name}: the text the field starts with is longer than 16 KiB {name}: el text amb què comença el camp ocupa més de 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: un quadre de diàleg no es pot obrir dins d'una crida de retorn d'una funció integrada, un getter, una conversió o un fitxer que executa $.evalFile; crideu-lo des del codi propi de l'script +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: la resposta següent d'`answers` és per a {_1}, no per a {name} +@msg {name}: `answers` has no answer left for this dialog {name}: a `answers` no queden respostes per a aquest quadre de diàleg +@msg vc.document{place} is too large for a script vc.document{place} és massa gran per a un script +@msg vc.log: the log of this run is full vc.log: el registre d'aquesta execució és ple +@msg this function's script run has ended l'execució de l'script d'aquesta funció ha acabat +@msg the script made more host calls than one run may make l'script ha fet més crides a l'amfitrió de les que pot fer una execució +@msg the script passed more data to and from commands than one run may pass l'script ha passat més dades a les ordres i des de les ordres de les que pot passar una execució +@msg the script added more objects and data to the documents than one run may add l'script ha afegit als documents més objectes i dades dels que pot afegir una execució +@msg {what}: the object is not a File or a Folder {what}: l'objecte no és un File ni un Folder +@msg {what}: the count must be a finite number, 0 or more {what}: el recompte ha de ser un nombre finit, 0 o més +@msg File.seek: the position must be a finite number File.seek: la posició ha de ser un nombre finit +@msg File.seek: the mode must be 0, 1 or 2 File.seek: el mode ha de ser 0, 1 o 2 +@msg script file is compiled: {value} el fitxer de l'script està compilat: {value} +@msg `name` must be the name of a script engine `name` ha de ser el nom d'un motor d'scripts +@msg the main script engine is new for each run and is never kept, so it cannot be dropped el motor d'scripts principal és nou a cada execució i no es conserva mai, per tant no es pot descartar +@msg there is no script engine named {name} no hi ha cap motor d'scripts anomenat {name} @msg Running a script S'està executant un script @msg Copied the script report S’ha copiat l’informe de l’script @msg Corners edits the corners of a path Cantonades edita les cantonades d’un traçat diff --git a/crates/ui-egui/src/i18n/catalog.rs b/crates/ui-egui/src/i18n/catalog.rs index 51259cb3d4..138299643d 100644 --- a/crates/ui-egui/src/i18n/catalog.rs +++ b/crates/ui-egui/src/i18n/catalog.rs @@ -77,13 +77,15 @@ impl Template { } /// Match `s` against `pieces`, a placeholder taking the shortest non-empty text that lets the -/// rest match (the last one takes what remains). With `counted`, `{n}` takes only a count. +/// rest match (the last one takes what remains). With `counted`, `{n}` takes only a count. A +/// placeholder that occurs twice takes the same text both times. fn match_pieces<'p, 'a>(pieces: &'p [Piece], s: &'a str, counted: bool, out: &mut Vec<(&'p str, &'a str)>) -> bool { let Some((first, rest)) = pieces.split_first() else { return s.is_empty() }; match first { Piece::Text(t) => s.strip_prefix(t.as_str()).is_some_and(|tail| match_pieces(rest, tail, counted, out)), Piece::Hole(name) => { - let fits = |value: &str| !(counted && name == "n") || value.parse::().is_ok(); + let earlier = out.iter().find(|(n, _)| *n == name.as_str()).map(|&(_, v)| v); + let fits = |value: &str| (!(counted && name == "n") || value.parse::().is_ok()) && earlier.is_none_or(|e| e == value); let Some((next, after)) = rest.split_first() else { if s.is_empty() || !fits(s) { return false; diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index f27fad5417..e925b5bdcf 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4521,6 +4521,85 @@ imageTrace Outline Obrys @msg the script's run is no longer available běh skriptu již není k dispozici @msg a failed command changed undo steps that could not be put back, so the script was stopped neúspěšný příkaz změnil kroky zpět, které nebylo možné obnovit, proto byl skript zastaven @msg a recovery copy could not be written, so the script was not run záložní kopii se nepodařilo zapsat, proto skript nebyl spuštěn +@msg Script file access denied Přístup k souboru skriptu byl odepřen +@msg Script file exceeds 8 MiB Soubor skriptu je větší než 8 MiB +@msg Script file is not open Soubor skriptu není otevřen +@msg Script file cannot be decoded Soubor skriptu nelze dekódovat +@msg Script file is not a regular file Soubor skriptu není běžný soubor +@msg Script file does not exist Soubor skriptu neexistuje +@msg Script file could not be read Soubor skriptu se nepodařilo přečíst +@msg Script folder has more than 2,048 entries Složka skriptu má více než 2 048 položek +@msg Script file open mode must be r, w, e or a Režim otevření souboru skriptu musí být r, w, e nebo a +@msg Script file writing is not available Zápis souborů skriptu není k dispozici +@msg Script file dialogs are not available Dialogy souborů skriptu nejsou k dispozici +@msg Script files cannot be opened in another application Soubory skriptu nelze otevřít v jiné aplikaci +@msg Script file access is unavailable on the web Přístup k souborům skriptu není na webu k dispozici +@msg Script has 256 files open Skript má otevřeno 256 souborů +@msg Script file path exceeds 32,767 characters Cesta k souboru skriptu je delší než 32 767 znaků +@msg Script folder mask takes too many steps to match Porovnání masky složky skriptu vyžaduje příliš mnoho kroků +@msg the script opened more file data than one run may open (32 MiB) skript otevřel více dat ze souborů, než smí otevřít jeden běh (32 MiB) +@msg File.seek: takes a position and a mode File.seek: přijímá pozici a režim +@msg vc.run: give a command id, as a string vc.run: zadejte ID příkazu jako řetězec +@msg vc.run: takes a command id and an object of parameters vc.run: přijímá ID příkazu a objekt s parametry +@msg vc.run: the parameters must be an object vc.run: parametry musí být objekt +@msg vc.run: the result{place} is too large for a script vc.run: výsledek{place} je pro skript příliš velký +@msg $.evalFile requires a file path $.evalFile vyžaduje cestu k souboru +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: časový limit musí být konečný počet milisekund, 0 nebo více +@msg $.evalFile: takes a file path and a timeout $.evalFile: přijímá cestu k souboru a časový limit +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: řádek {line}, sloupec {column} v {file}: {e} (vyvolána výjimka) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: řádek {line}, sloupec {column}: {e} (vyvolána výjimka) +@msg {name}: {e} (thrown) {name}: {e} (vyvolána výjimka) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: řádek {line}, sloupec {column} v {file}: {e} (omezení) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: řádek {line}, sloupec {column}: {e} (omezení) +@msg {name}: {e} (limit) {name}: {e} (omezení) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: řádek {line}, sloupec {column} v {file}: {e} (syntaktická chyba) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: řádek {line}, sloupec {column}: {e} (syntaktická chyba) +@msg {name}: {e} (syntax) {name}: {e} (syntaktická chyba) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: řádek {line}, sloupec {column} v {file}: {e} (zastaveno) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: řádek {line}, sloupec {column}: {e} (zastaveno) +@msg {name}: {e} (stopped) {name}: {e} (zastaveno) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: řádek {line}, sloupec {column} v {file}: {e} (interní chyba) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: řádek {line}, sloupec {column}: {e} (interní chyba) +@msg {name}: {e} (internal) {name}: {e} (interní chyba) +@msg {e} (these files stay written: {paths}) {e} (tyto soubory zůstávají zapsané: {paths}) +@msg $.{name}: give a name, as a string $.{name}: zadejte název jako řetězec +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: zadejte národní prostředí, například "en" nebo "de_DE", nebo null pro prostředí rozhraní +@msg $.localize: give true or false $.localize: zadejte true nebo false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: lze nastavit jen 512, které zapíná lokalizaci, nebo 0 +@msg $.flags: give a number $.flags: zadejte číslo +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: skripty zde čtou a zapisují pouze UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: zadejte název kódování jako řetězec +@msg $.memCache: the memory cache size cannot be set $.memCache: velikost mezipaměti nelze nastavit +@msg $.setenv: give a value, as a string $.setenv: zadejte hodnotu jako řetězec +@msg $.setenv: only {_1} can be set $.setenv: lze nastavit pouze {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: hodnota má nejvýše {MAX_ENV_BYTES} písmen, číslic a znaků _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: zadejte počet milisekund od 0 do {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: zadejte počet milisekund +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: běh nemůže čekat uvnitř zpětného volání vestavěné funkce, getteru, převodu ani souboru, který spouští $.evalFile; zavolejte jej z vlastního kódu skriptu +@msg $.bp: scripts here have no debugger $.bp: skripty zde nemají ladicí program +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: skripty zatím nemohou zobrazit dialog +@msg {name}: give a message {name}: zadejte zprávu +@msg {name}: give the text the field starts with {name}: zadejte text, kterým pole začíná +@msg {name}: the message is longer than 16 KiB {name}: zpráva je delší než 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: titulek je delší než 256 bajtů +@msg {name}: the text the field starts with is longer than 16 KiB {name}: text, kterým pole začíná, je delší než 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: dialog se nemůže otevřít uvnitř zpětného volání vestavěné funkce, getteru, převodu ani souboru, který spouští $.evalFile; zavolejte jej z vlastního kódu skriptu +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: další odpověď v `answers` je pro {_1}, ne pro {name} +@msg {name}: `answers` has no answer left for this dialog {name}: `answers` už nemá pro tento dialog žádnou odpověď +@msg vc.document{place} is too large for a script vc.document{place} je pro skript příliš velký +@msg vc.log: the log of this run is full vc.log: protokol tohoto běhu je plný +@msg this function's script run has ended běh skriptu této funkce skončil +@msg the script made more host calls than one run may make skript provedl více volání hostitele, než smí provést jeden běh +@msg the script passed more data to and from commands than one run may pass skript předal příkazům a z příkazů více dat, než smí předat jeden běh +@msg the script added more objects and data to the documents than one run may add skript přidal do dokumentů více objektů a dat, než smí přidat jeden běh +@msg {what}: the object is not a File or a Folder {what}: objekt není File ani Folder +@msg {what}: the count must be a finite number, 0 or more {what}: počet musí být konečné číslo, 0 nebo více +@msg File.seek: the position must be a finite number File.seek: pozice musí být konečné číslo +@msg File.seek: the mode must be 0, 1 or 2 File.seek: režim musí být 0, 1 nebo 2 +@msg script file is compiled: {value} soubor skriptu je zkompilovaný: {value} +@msg `name` must be the name of a script engine `name` musí být název skriptovacího jádra +@msg the main script engine is new for each run and is never kept, so it cannot be dropped hlavní skriptovací jádro je pro každý běh nové a nikdy se neuchovává, proto je nelze zahodit +@msg there is no script engine named {name} skriptovací jádro s názvem {name} neexistuje @msg Running a script Běží skript @msg Copied the script report Zpráva o skriptu zkopírována @msg Corners edits the corners of a path Rohy upravuje rohy cesty diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index d9434741c0..8a7b9f6b4b 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -4135,6 +4135,85 @@ theme Appearance Erscheinungsbild @msg the script's run is no longer available der Lauf des Skripts ist nicht mehr verfügbar @msg a failed command changed undo steps that could not be put back, so the script was stopped ein fehlgeschlagener Befehl hat Rückgängig-Schritte geändert, die nicht wiederhergestellt werden konnten, daher wurde das Skript angehalten @msg a recovery copy could not be written, so the script was not run eine Wiederherstellungskopie konnte nicht geschrieben werden, daher wurde das Skript nicht ausgeführt +@msg Script file access denied Zugriff auf die Skriptdatei verweigert +@msg Script file exceeds 8 MiB Die Skriptdatei ist größer als 8 MiB +@msg Script file is not open Die Skriptdatei ist nicht geöffnet +@msg Script file cannot be decoded Die Skriptdatei kann nicht dekodiert werden +@msg Script file is not a regular file Die Skriptdatei ist keine reguläre Datei +@msg Script file does not exist Die Skriptdatei existiert nicht +@msg Script file could not be read Die Skriptdatei konnte nicht gelesen werden +@msg Script folder has more than 2,048 entries Der Skriptordner hat mehr als 2.048 Einträge +@msg Script file open mode must be r, w, e or a Der Öffnungsmodus der Skriptdatei muss r, w, e oder a sein +@msg Script file writing is not available Das Schreiben von Skriptdateien ist nicht verfügbar +@msg Script file dialogs are not available Dateidialoge für Skripte sind nicht verfügbar +@msg Script files cannot be opened in another application Skriptdateien können nicht in einer anderen Anwendung geöffnet werden +@msg Script file access is unavailable on the web Der Zugriff auf Skriptdateien ist im Web nicht verfügbar +@msg Script has 256 files open Das Skript hat 256 Dateien geöffnet +@msg Script file path exceeds 32,767 characters Der Pfad der Skriptdatei ist länger als 32.767 Zeichen +@msg Script folder mask takes too many steps to match Der Abgleich der Maske des Skriptordners braucht zu viele Schritte +@msg the script opened more file data than one run may open (32 MiB) das Skript hat mehr Dateidaten geöffnet, als ein Lauf öffnen darf (32 MiB) +@msg File.seek: takes a position and a mode File.seek: nimmt eine Position und einen Modus +@msg vc.run: give a command id, as a string vc.run: Geben Sie eine Befehls-ID als Zeichenfolge an +@msg vc.run: takes a command id and an object of parameters vc.run: nimmt eine Befehls-ID und ein Objekt mit Parametern +@msg vc.run: the parameters must be an object vc.run: Die Parameter müssen ein Objekt sein +@msg vc.run: the result{place} is too large for a script vc.run: Das Ergebnis{place} ist zu groß für ein Skript +@msg $.evalFile requires a file path $.evalFile erfordert einen Dateipfad +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: Die Zeitüberschreitung muss eine endliche Anzahl von Millisekunden sein, 0 oder mehr +@msg $.evalFile: takes a file path and a timeout $.evalFile: nimmt einen Dateipfad und eine Zeitüberschreitung +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: Zeile {line}, Spalte {column} in {file}: {e} (ausgelöst) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: Zeile {line}, Spalte {column}: {e} (ausgelöst) +@msg {name}: {e} (thrown) {name}: {e} (ausgelöst) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: Zeile {line}, Spalte {column} in {file}: {e} (Grenze) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: Zeile {line}, Spalte {column}: {e} (Grenze) +@msg {name}: {e} (limit) {name}: {e} (Grenze) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: Zeile {line}, Spalte {column} in {file}: {e} (Syntaxfehler) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: Zeile {line}, Spalte {column}: {e} (Syntaxfehler) +@msg {name}: {e} (syntax) {name}: {e} (Syntaxfehler) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: Zeile {line}, Spalte {column} in {file}: {e} (gestoppt) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: Zeile {line}, Spalte {column}: {e} (gestoppt) +@msg {name}: {e} (stopped) {name}: {e} (gestoppt) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: Zeile {line}, Spalte {column} in {file}: {e} (interner Fehler) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: Zeile {line}, Spalte {column}: {e} (interner Fehler) +@msg {name}: {e} (internal) {name}: {e} (interner Fehler) +@msg {e} (these files stay written: {paths}) {e} (diese Dateien bleiben geschrieben: {paths}) +@msg $.{name}: give a name, as a string $.{name}: Geben Sie einen Namen als Zeichenfolge an +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: Geben Sie ein Gebietsschema wie "en" oder "de_DE" an, oder null für das der Oberfläche +@msg $.localize: give true or false $.localize: Geben Sie true oder false an +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: Nur 512, das die Lokalisierung einschaltet, oder 0 kann gesetzt werden +@msg $.flags: give a number $.flags: Geben Sie eine Zahl an +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: Skripte lesen und schreiben hier nur UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: Geben Sie den Namen einer Kodierung als Zeichenfolge an +@msg $.memCache: the memory cache size cannot be set $.memCache: Die Größe des Speichercaches kann nicht gesetzt werden +@msg $.setenv: give a value, as a string $.setenv: Geben Sie einen Wert als Zeichenfolge an +@msg $.setenv: only {_1} can be set $.setenv: Nur {_1} können gesetzt werden +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: Ein Wert hat höchstens {MAX_ENV_BYTES} Buchstaben, Ziffern und _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: Geben Sie eine Anzahl von Millisekunden von 0 bis {MAX_SLEEP_MS} an +@msg $.sleep: give a number of milliseconds $.sleep: Geben Sie eine Anzahl von Millisekunden an +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: Ein Lauf kann nicht in einem Callback einer integrierten Funktion, einem Getter, einer Umwandlung oder einer Datei warten, die $.evalFile ausführt; rufen Sie es aus dem eigenen Code des Skripts auf +@msg $.bp: scripts here have no debugger $.bp: Skripte haben hier keinen Debugger +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: Skripte können noch keinen Dialog anzeigen +@msg {name}: give a message {name}: Geben Sie eine Meldung an +@msg {name}: give the text the field starts with {name}: Geben Sie den Text an, mit dem das Feld beginnt +@msg {name}: the message is longer than 16 KiB {name}: Die Meldung ist länger als 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: Der Titel ist länger als 256 Byte +@msg {name}: the text the field starts with is longer than 16 KiB {name}: Der Text, mit dem das Feld beginnt, ist länger als 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: Ein Dialog kann sich nicht in einem Callback einer integrierten Funktion, einem Getter, einer Umwandlung oder einer Datei öffnen, die $.evalFile ausführt; rufen Sie ihn aus dem eigenen Code des Skripts auf +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: Die nächste Antwort in `answers` ist für {_1}, nicht für {name} +@msg {name}: `answers` has no answer left for this dialog {name}: `answers` hat keine Antwort mehr für diesen Dialog +@msg vc.document{place} is too large for a script vc.document{place} ist zu groß für ein Skript +@msg vc.log: the log of this run is full vc.log: Das Protokoll dieses Laufs ist voll +@msg this function's script run has ended der Skriptlauf dieser Funktion ist beendet +@msg the script made more host calls than one run may make das Skript hat mehr Host-Aufrufe ausgeführt, als ein Lauf ausführen darf +@msg the script passed more data to and from commands than one run may pass das Skript hat mehr Daten an Befehle und von Befehlen übergeben, als ein Lauf übergeben darf +@msg the script added more objects and data to the documents than one run may add das Skript hat den Dokumenten mehr Objekte und Daten hinzugefügt, als ein Lauf hinzufügen darf +@msg {what}: the object is not a File or a Folder {what}: Das Objekt ist weder ein File noch ein Folder +@msg {what}: the count must be a finite number, 0 or more {what}: Die Anzahl muss eine endliche Zahl sein, 0 oder mehr +@msg File.seek: the position must be a finite number File.seek: Die Position muss eine endliche Zahl sein +@msg File.seek: the mode must be 0, 1 or 2 File.seek: Der Modus muss 0, 1 oder 2 sein +@msg script file is compiled: {value} die Skriptdatei ist kompiliert: {value} +@msg `name` must be the name of a script engine `name` muss der Name einer Skript-Engine sein +@msg the main script engine is new for each run and is never kept, so it cannot be dropped die Hauptskript-Engine ist für jeden Lauf neu und wird nie behalten, daher kann sie nicht verworfen werden +@msg there is no script engine named {name} es gibt keine Skript-Engine namens {name} @msg Running a script Skript wird ausgeführt @msg Copied the script report Skriptbericht kopiert @msg Corners edits the corners of a path „Ecken“ bearbeitet die Ecken eines Pfads diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 1ceb93c669..cc1ba7c1f3 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -2320,6 +2320,85 @@ axis Both Και τα δύο @msg the script's run is no longer available η εκτέλεση του σεναρίου δεν είναι πλέον διαθέσιμη @msg a failed command changed undo steps that could not be put back, so the script was stopped μια εντολή που απέτυχε άλλαξε βήματα αναίρεσης που δεν ήταν δυνατό να επαναφερθούν, οπότε το σενάριο σταμάτησε @msg a recovery copy could not be written, so the script was not run δεν ήταν δυνατή η εγγραφή αντιγράφου ανάκτησης, οπότε το σενάριο δεν εκτελέστηκε +@msg Script file access denied Η πρόσβαση στο αρχείο σεναρίου απορρίφθηκε +@msg Script file exceeds 8 MiB Το αρχείο σεναρίου υπερβαίνει τα 8 MiB +@msg Script file is not open Το αρχείο σεναρίου δεν είναι ανοιχτό +@msg Script file cannot be decoded Δεν είναι δυνατή η αποκωδικοποίηση του αρχείου σεναρίου +@msg Script file is not a regular file Το αρχείο σεναρίου δεν είναι κανονικό αρχείο +@msg Script file does not exist Το αρχείο σεναρίου δεν υπάρχει +@msg Script file could not be read Δεν ήταν δυνατή η ανάγνωση του αρχείου σεναρίου +@msg Script folder has more than 2,048 entries Ο φάκελος σεναρίου έχει περισσότερες από 2.048 καταχωρίσεις +@msg Script file open mode must be r, w, e or a Ο τρόπος ανοίγματος του αρχείου σεναρίου πρέπει να είναι r, w, e ή a +@msg Script file writing is not available Η εγγραφή αρχείων σεναρίου δεν είναι διαθέσιμη +@msg Script file dialogs are not available Τα παράθυρα διαλόγου αρχείων σεναρίου δεν είναι διαθέσιμα +@msg Script files cannot be opened in another application Τα αρχεία σεναρίου δεν μπορούν να ανοίξουν σε άλλη εφαρμογή +@msg Script file access is unavailable on the web Η πρόσβαση σε αρχεία σεναρίου δεν είναι διαθέσιμη στο web +@msg Script has 256 files open Το σενάριο έχει 256 ανοιχτά αρχεία +@msg Script file path exceeds 32,767 characters Η διαδρομή του αρχείου σεναρίου υπερβαίνει τους 32.767 χαρακτήρες +@msg Script folder mask takes too many steps to match Η αντιστοίχιση της μάσκας φακέλου σεναρίου χρειάζεται πάρα πολλά βήματα +@msg the script opened more file data than one run may open (32 MiB) το σενάριο άνοιξε περισσότερα δεδομένα αρχείων από όσα επιτρέπεται να ανοίξει μία εκτέλεση (32 MiB) +@msg File.seek: takes a position and a mode File.seek: δέχεται μια θέση και έναν τρόπο +@msg vc.run: give a command id, as a string vc.run: δώστε ένα αναγνωριστικό εντολής, ως συμβολοσειρά +@msg vc.run: takes a command id and an object of parameters vc.run: δέχεται ένα αναγνωριστικό εντολής και ένα αντικείμενο παραμέτρων +@msg vc.run: the parameters must be an object vc.run: οι παράμετροι πρέπει να είναι αντικείμενο +@msg vc.run: the result{place} is too large for a script vc.run: το αποτέλεσμα{place} είναι πολύ μεγάλο για σενάριο +@msg $.evalFile requires a file path Το $.evalFile απαιτεί διαδρομή αρχείου +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: το χρονικό όριο πρέπει να είναι πεπερασμένος αριθμός χιλιοστών του δευτερολέπτου, 0 ή περισσότερο +@msg $.evalFile: takes a file path and a timeout $.evalFile: δέχεται μια διαδρομή αρχείου και ένα χρονικό όριο +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: γραμμή {line}, στήλη {column} στο {file}: {e} (εξαίρεση) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: γραμμή {line}, στήλη {column}: {e} (εξαίρεση) +@msg {name}: {e} (thrown) {name}: {e} (εξαίρεση) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: γραμμή {line}, στήλη {column} στο {file}: {e} (όριο) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: γραμμή {line}, στήλη {column}: {e} (όριο) +@msg {name}: {e} (limit) {name}: {e} (όριο) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: γραμμή {line}, στήλη {column} στο {file}: {e} (συντακτικό σφάλμα) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: γραμμή {line}, στήλη {column}: {e} (συντακτικό σφάλμα) +@msg {name}: {e} (syntax) {name}: {e} (συντακτικό σφάλμα) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: γραμμή {line}, στήλη {column} στο {file}: {e} (διακόπηκε) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: γραμμή {line}, στήλη {column}: {e} (διακόπηκε) +@msg {name}: {e} (stopped) {name}: {e} (διακόπηκε) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: γραμμή {line}, στήλη {column} στο {file}: {e} (εσωτερικό σφάλμα) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: γραμμή {line}, στήλη {column}: {e} (εσωτερικό σφάλμα) +@msg {name}: {e} (internal) {name}: {e} (εσωτερικό σφάλμα) +@msg {e} (these files stay written: {paths}) {e} (αυτά τα αρχεία παραμένουν γραμμένα: {paths}) +@msg $.{name}: give a name, as a string $.{name}: δώστε ένα όνομα, ως συμβολοσειρά +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: δώστε μια τοπική ρύθμιση όπως "en" ή "de_DE", ή null για αυτή της διεπαφής +@msg $.localize: give true or false $.localize: δώστε true ή false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: μπορεί να οριστεί μόνο το 512, που ενεργοποιεί την τοπικοποίηση, ή το 0 +@msg $.flags: give a number $.flags: δώστε έναν αριθμό +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: τα σενάρια εδώ διαβάζουν και γράφουν μόνο UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: δώστε το όνομα μιας κωδικοποίησης, ως συμβολοσειρά +@msg $.memCache: the memory cache size cannot be set $.memCache: το μέγεθος της κρυφής μνήμης δεν μπορεί να οριστεί +@msg $.setenv: give a value, as a string $.setenv: δώστε μια τιμή, ως συμβολοσειρά +@msg $.setenv: only {_1} can be set $.setenv: μπορούν να οριστούν μόνο τα {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: μια τιμή έχει το πολύ {MAX_ENV_BYTES} γράμματα, ψηφία και _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: δώστε έναν αριθμό χιλιοστών του δευτερολέπτου από 0 έως {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: δώστε έναν αριθμό χιλιοστών του δευτερολέπτου +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: μια εκτέλεση δεν μπορεί να περιμένει μέσα σε επανάκληση ενσωματωμένης συνάρτησης, getter, μετατροπή ή αρχείο που εκτελεί το $.evalFile· καλέστε το από τον κώδικα του ίδιου του σεναρίου +@msg $.bp: scripts here have no debugger $.bp: τα σενάρια εδώ δεν έχουν πρόγραμμα εντοπισμού σφαλμάτων +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: τα σενάρια δεν μπορούν ακόμη να εμφανίσουν παράθυρο διαλόγου +@msg {name}: give a message {name}: δώστε ένα μήνυμα +@msg {name}: give the text the field starts with {name}: δώστε το κείμενο με το οποίο ξεκινά το πεδίο +@msg {name}: the message is longer than 16 KiB {name}: το μήνυμα είναι μεγαλύτερο από 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: ο τίτλος είναι μεγαλύτερος από 256 byte +@msg {name}: the text the field starts with is longer than 16 KiB {name}: το κείμενο με το οποίο ξεκινά το πεδίο είναι μεγαλύτερο από 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: ένα παράθυρο διαλόγου δεν μπορεί να ανοίξει μέσα σε επανάκληση ενσωματωμένης συνάρτησης, getter, μετατροπή ή αρχείο που εκτελεί το $.evalFile· καλέστε το από τον κώδικα του ίδιου του σεναρίου +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: η επόμενη απάντηση στο `answers` είναι για το {_1}, όχι για το {name} +@msg {name}: `answers` has no answer left for this dialog {name}: το `answers` δεν έχει άλλη απάντηση για αυτό το παράθυρο διαλόγου +@msg vc.document{place} is too large for a script το vc.document{place} είναι πολύ μεγάλο για σενάριο +@msg vc.log: the log of this run is full vc.log: το αρχείο καταγραφής αυτής της εκτέλεσης είναι γεμάτο +@msg this function's script run has ended η εκτέλεση σεναρίου αυτής της συνάρτησης έχει τελειώσει +@msg the script made more host calls than one run may make το σενάριο έκανε περισσότερες κλήσεις στον κεντρικό υπολογιστή από όσες επιτρέπονται σε μία εκτέλεση +@msg the script passed more data to and from commands than one run may pass το σενάριο μετέφερε περισσότερα δεδομένα προς και από εντολές από όσα επιτρέπονται σε μία εκτέλεση +@msg the script added more objects and data to the documents than one run may add το σενάριο πρόσθεσε στα έγγραφα περισσότερα αντικείμενα και δεδομένα από όσα επιτρέπονται σε μία εκτέλεση +@msg {what}: the object is not a File or a Folder {what}: το αντικείμενο δεν είναι File ούτε Folder +@msg {what}: the count must be a finite number, 0 or more {what}: το πλήθος πρέπει να είναι πεπερασμένος αριθμός, 0 ή περισσότερο +@msg File.seek: the position must be a finite number File.seek: η θέση πρέπει να είναι πεπερασμένος αριθμός +@msg File.seek: the mode must be 0, 1 or 2 File.seek: ο τρόπος πρέπει να είναι 0, 1 ή 2 +@msg script file is compiled: {value} το αρχείο σεναρίου είναι μεταγλωττισμένο: {value} +@msg `name` must be the name of a script engine το `name` πρέπει να είναι το όνομα μιας μηχανής σεναρίων +@msg the main script engine is new for each run and is never kept, so it cannot be dropped η κύρια μηχανή σεναρίων είναι νέα σε κάθε εκτέλεση και δεν διατηρείται ποτέ, οπότε δεν μπορεί να απορριφθεί +@msg there is no script engine named {name} δεν υπάρχει μηχανή σεναρίων με όνομα {name} @msg Running a script Εκτελείται σενάριο @msg Copied the script report Η αναφορά του σεναρίου αντιγράφηκε @msg Corners edits the corners of a path Η εντολή Γωνίες επεξεργάζεται τις γωνίες μιας διαδρομής diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 7708e930bb..37a3471ca0 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -4211,6 +4211,85 @@ axis Both Ambos @msg the script's run is no longer available la ejecución del script ya no está disponible @msg a failed command changed undo steps that could not be put back, so the script was stopped un comando fallido cambió pasos de deshacer que no se pudieron restaurar, así que el script se detuvo @msg a recovery copy could not be written, so the script was not run no se pudo escribir una copia de recuperación, así que el script no se ejecutó +@msg Script file access denied Acceso denegado al archivo de script +@msg Script file exceeds 8 MiB El archivo de script supera los 8 MiB +@msg Script file is not open El archivo de script no está abierto +@msg Script file cannot be decoded No se puede descodificar el archivo de script +@msg Script file is not a regular file El archivo de script no es un archivo normal +@msg Script file does not exist El archivo de script no existe +@msg Script file could not be read No se pudo leer el archivo de script +@msg Script folder has more than 2,048 entries La carpeta de script tiene más de 2048 entradas +@msg Script file open mode must be r, w, e or a El modo de apertura del archivo de script debe ser r, w, e o a +@msg Script file writing is not available La escritura de archivos de script no está disponible +@msg Script file dialogs are not available Los cuadros de diálogo de archivos de script no están disponibles +@msg Script files cannot be opened in another application Los archivos de script no se pueden abrir en otra aplicación +@msg Script file access is unavailable on the web El acceso a archivos de script no está disponible en la web +@msg Script has 256 files open El script tiene 256 archivos abiertos +@msg Script file path exceeds 32,767 characters La ruta del archivo de script supera los 32 767 caracteres +@msg Script folder mask takes too many steps to match La máscara de carpeta de script requiere demasiados pasos para coincidir +@msg the script opened more file data than one run may open (32 MiB) el script abrió más datos de archivo de los que puede abrir una ejecución (32 MiB) +@msg File.seek: takes a position and a mode File.seek: recibe una posición y un modo +@msg vc.run: give a command id, as a string vc.run: indique un id de comando, como cadena +@msg vc.run: takes a command id and an object of parameters vc.run: recibe un id de comando y un objeto de parámetros +@msg vc.run: the parameters must be an object vc.run: los parámetros deben ser un objeto +@msg vc.run: the result{place} is too large for a script vc.run: el resultado{place} es demasiado grande para un script +@msg $.evalFile requires a file path $.evalFile requiere una ruta de archivo +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: el tiempo de espera debe ser un número finito de milisegundos, 0 o más +@msg $.evalFile: takes a file path and a timeout $.evalFile: recibe una ruta de archivo y un tiempo de espera +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: línea {line}, columna {column} de {file}: {e} (lanzado) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: línea {line}, columna {column}: {e} (lanzado) +@msg {name}: {e} (thrown) {name}: {e} (lanzado) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: línea {line}, columna {column} de {file}: {e} (límite) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: línea {line}, columna {column}: {e} (límite) +@msg {name}: {e} (limit) {name}: {e} (límite) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: línea {line}, columna {column} de {file}: {e} (error de sintaxis) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: línea {line}, columna {column}: {e} (error de sintaxis) +@msg {name}: {e} (syntax) {name}: {e} (error de sintaxis) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: línea {line}, columna {column} de {file}: {e} (detenido) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: línea {line}, columna {column}: {e} (detenido) +@msg {name}: {e} (stopped) {name}: {e} (detenido) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: línea {line}, columna {column} de {file}: {e} (error interno) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: línea {line}, columna {column}: {e} (error interno) +@msg {name}: {e} (internal) {name}: {e} (error interno) +@msg {e} (these files stay written: {paths}) {e} (estos archivos quedan escritos: {paths}) +@msg $.{name}: give a name, as a string $.{name}: indique un nombre, como cadena +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: indique una configuración regional como "en" o "de_DE", o null para la de la interfaz +@msg $.localize: give true or false $.localize: indique true o false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: solo se puede establecer 512, que activa la localización, o 0 +@msg $.flags: give a number $.flags: indique un número +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: aquí los scripts solo leen y escriben UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: indique el nombre de una codificación, como cadena +@msg $.memCache: the memory cache size cannot be set $.memCache: no se puede establecer el tamaño de la caché de memoria +@msg $.setenv: give a value, as a string $.setenv: indique un valor, como cadena +@msg $.setenv: only {_1} can be set $.setenv: solo se pueden establecer {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: un valor tiene como máximo {MAX_ENV_BYTES} letras, dígitos y _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: indique un número de milisegundos de 0 a {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: indique un número de milisegundos +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: una ejecución no puede esperar dentro de una devolución de llamada de una función integrada, un getter, una conversión o un archivo que ejecuta $.evalFile; llámelo desde el propio código del script +@msg $.bp: scripts here have no debugger $.bp: aquí los scripts no tienen depurador +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: los scripts aún no pueden mostrar un cuadro de diálogo +@msg {name}: give a message {name}: indique un mensaje +@msg {name}: give the text the field starts with {name}: indique el texto con el que empieza el campo +@msg {name}: the message is longer than 16 KiB {name}: el mensaje ocupa más de 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: el título ocupa más de 256 bytes +@msg {name}: the text the field starts with is longer than 16 KiB {name}: el texto con el que empieza el campo ocupa más de 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: un cuadro de diálogo no puede abrirse dentro de una devolución de llamada de una función integrada, un getter, una conversión o un archivo que ejecuta $.evalFile; llámelo desde el propio código del script +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: la siguiente respuesta de `answers` es para {_1}, no para {name} +@msg {name}: `answers` has no answer left for this dialog {name}: a `answers` no le quedan respuestas para este cuadro de diálogo +@msg vc.document{place} is too large for a script vc.document{place} es demasiado grande para un script +@msg vc.log: the log of this run is full vc.log: el registro de esta ejecución está lleno +@msg this function's script run has ended la ejecución del script de esta función ha terminado +@msg the script made more host calls than one run may make el script hizo más llamadas al anfitrión de las que puede hacer una ejecución +@msg the script passed more data to and from commands than one run may pass el script pasó más datos a los comandos y desde ellos de los que puede pasar una ejecución +@msg the script added more objects and data to the documents than one run may add el script añadió a los documentos más objetos y datos de los que puede añadir una ejecución +@msg {what}: the object is not a File or a Folder {what}: el objeto no es un File ni un Folder +@msg {what}: the count must be a finite number, 0 or more {what}: la cantidad debe ser un número finito, 0 o más +@msg File.seek: the position must be a finite number File.seek: la posición debe ser un número finito +@msg File.seek: the mode must be 0, 1 or 2 File.seek: el modo debe ser 0, 1 o 2 +@msg script file is compiled: {value} el archivo de script está compilado: {value} +@msg `name` must be the name of a script engine `name` debe ser el nombre de un motor de scripts +@msg the main script engine is new for each run and is never kept, so it cannot be dropped el motor de scripts principal es nuevo en cada ejecución y nunca se conserva, por lo que no se puede descartar +@msg there is no script engine named {name} no hay ningún motor de scripts llamado {name} @msg Running a script Ejecutando un script @msg Copied the script report Se copió el informe del script @msg Corners edits the corners of a path Esquinas edita las esquinas de un trazado diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 765400c5a6..e47472cf2a 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4435,6 +4435,85 @@ imageTrace Outline Ääriviiva @msg the script's run is no longer available komentosarjan suoritus ei ole enää käytettävissä @msg a failed command changed undo steps that could not be put back, so the script was stopped epäonnistunut komento muutti kumoamisvaiheita, joita ei voitu palauttaa, joten komentosarja pysäytettiin @msg a recovery copy could not be written, so the script was not run palautuskopiota ei voitu kirjoittaa, joten komentosarjaa ei suoritettu +@msg Script file access denied Pääsy komentosarjatiedostoon estettiin +@msg Script file exceeds 8 MiB Komentosarjatiedosto on suurempi kuin 8 MiB +@msg Script file is not open Komentosarjatiedosto ei ole auki +@msg Script file cannot be decoded Komentosarjatiedostoa ei voi purkaa +@msg Script file is not a regular file Komentosarjatiedosto ei ole tavallinen tiedosto +@msg Script file does not exist Komentosarjatiedostoa ei ole olemassa +@msg Script file could not be read Komentosarjatiedostoa ei voitu lukea +@msg Script folder has more than 2,048 entries Komentosarjakansiossa on yli 2 048 kohdetta +@msg Script file open mode must be r, w, e or a Komentosarjatiedoston avaustilan on oltava r, w, e tai a +@msg Script file writing is not available Komentosarjatiedostojen kirjoittaminen ei ole käytettävissä +@msg Script file dialogs are not available Komentosarjojen tiedostovalintaikkunat eivät ole käytettävissä +@msg Script files cannot be opened in another application Komentosarjatiedostoja ei voi avata toisessa sovelluksessa +@msg Script file access is unavailable on the web Komentosarjatiedostojen käyttö ei ole mahdollista verkossa +@msg Script has 256 files open Komentosarjalla on 256 tiedostoa auki +@msg Script file path exceeds 32,767 characters Komentosarjatiedoston polku on yli 32 767 merkkiä +@msg Script folder mask takes too many steps to match Komentosarjakansion maskin täsmäytys vaatii liian monta vaihetta +@msg the script opened more file data than one run may open (32 MiB) komentosarja avasi enemmän tiedostodataa kuin yksi suoritus saa avata (32 MiB) +@msg File.seek: takes a position and a mode File.seek: ottaa sijainnin ja tilan +@msg vc.run: give a command id, as a string vc.run: anna komennon tunnus merkkijonona +@msg vc.run: takes a command id and an object of parameters vc.run: ottaa komennon tunnuksen ja parametriobjektin +@msg vc.run: the parameters must be an object vc.run: parametrien on oltava objekti +@msg vc.run: the result{place} is too large for a script vc.run: tulos{place} on liian suuri komentosarjalle +@msg $.evalFile requires a file path $.evalFile vaatii tiedostopolun +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: aikakatkaisun on oltava äärellinen määrä millisekunteja, 0 tai enemmän +@msg $.evalFile: takes a file path and a timeout $.evalFile: ottaa tiedostopolun ja aikakatkaisun +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: {file}, rivi {line}, sarake {column}: {e} (heitetty) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: rivi {line}, sarake {column}: {e} (heitetty) +@msg {name}: {e} (thrown) {name}: {e} (heitetty) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: {file}, rivi {line}, sarake {column}: {e} (raja) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: rivi {line}, sarake {column}: {e} (raja) +@msg {name}: {e} (limit) {name}: {e} (raja) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: {file}, rivi {line}, sarake {column}: {e} (syntaksivirhe) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: rivi {line}, sarake {column}: {e} (syntaksivirhe) +@msg {name}: {e} (syntax) {name}: {e} (syntaksivirhe) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: {file}, rivi {line}, sarake {column}: {e} (pysäytetty) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: rivi {line}, sarake {column}: {e} (pysäytetty) +@msg {name}: {e} (stopped) {name}: {e} (pysäytetty) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: {file}, rivi {line}, sarake {column}: {e} (sisäinen virhe) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: rivi {line}, sarake {column}: {e} (sisäinen virhe) +@msg {name}: {e} (internal) {name}: {e} (sisäinen virhe) +@msg {e} (these files stay written: {paths}) {e} (nämä tiedostot jäävät kirjoitetuiksi: {paths}) +@msg $.{name}: give a name, as a string $.{name}: anna nimi merkkijonona +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: anna kieliasetus, kuten "en" tai "de_DE", tai null käyttöliittymän kieliasetukselle +@msg $.localize: give true or false $.localize: anna true tai false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: vain 512, joka ottaa lokalisoinnin käyttöön, tai 0 voidaan asettaa +@msg $.flags: give a number $.flags: anna luku +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: skriptit lukevat ja kirjoittavat täällä vain UTF-8:aa +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: anna merkistökoodauksen nimi merkkijonona +@msg $.memCache: the memory cache size cannot be set $.memCache: muistivälimuistin kokoa ei voi asettaa +@msg $.setenv: give a value, as a string $.setenv: anna arvo merkkijonona +@msg $.setenv: only {_1} can be set $.setenv: vain {_1} voidaan asettaa +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: arvossa on enintään {MAX_ENV_BYTES} kirjainta, numeroa ja merkkiä _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: anna millisekuntimäärä väliltä 0–{MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: anna millisekuntimäärä +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: ajo ei voi odottaa sisäänrakennetun funktion takaisinkutsussa, getterissä, muunnoksessa tai tiedostossa, jonka $.evalFile ajaa; kutsu sitä skriptin omasta koodista +@msg $.bp: scripts here have no debugger $.bp: skripteillä ei ole täällä virheenjäljitintä +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: skriptit eivät vielä voi näyttää valintaikkunaa +@msg {name}: give a message {name}: anna viesti +@msg {name}: give the text the field starts with {name}: anna teksti, jolla kenttä alkaa +@msg {name}: the message is longer than 16 KiB {name}: viesti on pidempi kuin 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: otsikko on pidempi kuin 256 tavua +@msg {name}: the text the field starts with is longer than 16 KiB {name}: teksti, jolla kenttä alkaa, on pidempi kuin 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: valintaikkuna ei voi avautua sisäänrakennetun funktion takaisinkutsussa, getterissä, muunnoksessa tai tiedostossa, jonka $.evalFile ajaa; kutsu sitä skriptin omasta koodista +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: seuraava vastaus kohteessa `answers` on kohteelle {_1}, ei kohteelle {name} +@msg {name}: `answers` has no answer left for this dialog {name}: kohteessa `answers` ei ole enää vastausta tälle valintaikkunalle +@msg vc.document{place} is too large for a script vc.document{place} on liian suuri skriptille +@msg vc.log: the log of this run is full vc.log: tämän ajon loki on täynnä +@msg this function's script run has ended tämän funktion skriptiajo on päättynyt +@msg the script made more host calls than one run may make skripti teki enemmän isäntäkutsuja kuin yksi ajo saa tehdä +@msg the script passed more data to and from commands than one run may pass skripti välitti komennoille ja komennoilta enemmän tietoa kuin yksi ajo saa välittää +@msg the script added more objects and data to the documents than one run may add skripti lisäsi asiakirjoihin enemmän objekteja ja tietoja kuin yksi ajo saa lisätä +@msg {what}: the object is not a File or a Folder {what}: objekti ei ole File eikä Folder +@msg {what}: the count must be a finite number, 0 or more {what}: määrän on oltava äärellinen luku, 0 tai enemmän +@msg File.seek: the position must be a finite number File.seek: sijainnin on oltava äärellinen luku +@msg File.seek: the mode must be 0, 1 or 2 File.seek: tilan on oltava 0, 1 tai 2 +@msg script file is compiled: {value} skriptitiedosto on käännetty: {value} +@msg `name` must be the name of a script engine `name` on oltava skriptimoottorin nimi +@msg the main script engine is new for each run and is never kept, so it cannot be dropped pääskriptimoottori on uusi jokaisella ajolla eikä sitä koskaan säilytetä, joten sitä ei voi poistaa +@msg there is no script engine named {name} skriptimoottoria nimeltä {name} ei ole @msg Running a script Suoritetaan komentosarjaa @msg Copied the script report Komentosarjan raportti kopioitiin @msg Corners edits the corners of a path Kulmat-toiminto muokkaa polun kulmia diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index f7eb341e39..e2650e4e18 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -4200,6 +4200,85 @@ axis Both Les deux @msg the script's run is no longer available l’exécution du script n’est plus disponible @msg a failed command changed undo steps that could not be put back, so the script was stopped une commande en échec a modifié des étapes d’annulation qui n’ont pas pu être rétablies, le script a donc été arrêté @msg a recovery copy could not be written, so the script was not run une copie de récupération n’a pas pu être écrite, le script n’a donc pas été exécuté +@msg Script file access denied Accès au fichier de script refusé +@msg Script file exceeds 8 MiB Le fichier de script dépasse 8 Mio +@msg Script file is not open Le fichier de script n’est pas ouvert +@msg Script file cannot be decoded Le fichier de script ne peut pas être décodé +@msg Script file is not a regular file Le fichier de script n’est pas un fichier ordinaire +@msg Script file does not exist Le fichier de script n’existe pas +@msg Script file could not be read Le fichier de script n’a pas pu être lu +@msg Script folder has more than 2,048 entries Le dossier de script contient plus de 2 048 entrées +@msg Script file open mode must be r, w, e or a Le mode d’ouverture du fichier de script doit être r, w, e ou a +@msg Script file writing is not available L’écriture de fichiers de script n’est pas disponible +@msg Script file dialogs are not available Les boîtes de dialogue de fichiers de script ne sont pas disponibles +@msg Script files cannot be opened in another application Les fichiers de script ne peuvent pas être ouverts dans une autre application +@msg Script file access is unavailable on the web L’accès aux fichiers de script n’est pas disponible sur le web +@msg Script has 256 files open Le script a 256 fichiers ouverts +@msg Script file path exceeds 32,767 characters Le chemin du fichier de script dépasse 32 767 caractères +@msg Script folder mask takes too many steps to match Le masque de dossier de script demande trop d’étapes de correspondance +@msg the script opened more file data than one run may open (32 MiB) le script a ouvert plus de données de fichier qu’une exécution ne peut en ouvrir (32 Mio) +@msg File.seek: takes a position and a mode File.seek : prend une position et un mode +@msg vc.run: give a command id, as a string vc.run : indiquez un identifiant de commande, sous forme de chaîne +@msg vc.run: takes a command id and an object of parameters vc.run : prend un identifiant de commande et un objet de paramètres +@msg vc.run: the parameters must be an object vc.run : les paramètres doivent être un objet +@msg vc.run: the result{place} is too large for a script vc.run : le résultat{place} est trop volumineux pour un script +@msg $.evalFile requires a file path $.evalFile nécessite un chemin de fichier +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile : le délai doit être un nombre fini de millisecondes, 0 ou plus +@msg $.evalFile: takes a file path and a timeout $.evalFile : prend un chemin de fichier et un délai +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name} : ligne {line}, colonne {column} de {file} : {e} (levée) +@msg {name}: line {line}, column {column}: {e} (thrown) {name} : ligne {line}, colonne {column} : {e} (levée) +@msg {name}: {e} (thrown) {name} : {e} (levée) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name} : ligne {line}, colonne {column} de {file} : {e} (limite) +@msg {name}: line {line}, column {column}: {e} (limit) {name} : ligne {line}, colonne {column} : {e} (limite) +@msg {name}: {e} (limit) {name} : {e} (limite) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name} : ligne {line}, colonne {column} de {file} : {e} (erreur de syntaxe) +@msg {name}: line {line}, column {column}: {e} (syntax) {name} : ligne {line}, colonne {column} : {e} (erreur de syntaxe) +@msg {name}: {e} (syntax) {name} : {e} (erreur de syntaxe) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name} : ligne {line}, colonne {column} de {file} : {e} (arrêté) +@msg {name}: line {line}, column {column}: {e} (stopped) {name} : ligne {line}, colonne {column} : {e} (arrêté) +@msg {name}: {e} (stopped) {name} : {e} (arrêté) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name} : ligne {line}, colonne {column} de {file} : {e} (erreur interne) +@msg {name}: line {line}, column {column}: {e} (internal) {name} : ligne {line}, colonne {column} : {e} (erreur interne) +@msg {name}: {e} (internal) {name} : {e} (erreur interne) +@msg {e} (these files stay written: {paths}) {e} (ces fichiers restent écrits : {paths}) +@msg $.{name}: give a name, as a string $.{name} : indiquez un nom, sous forme de chaîne +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale : indiquez des paramètres régionaux tels que "en" ou "de_DE", ou null pour ceux de l'interface +@msg $.localize: give true or false $.localize : indiquez true ou false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags : seules les valeurs 512, qui active la localisation, ou 0 peuvent être définies +@msg $.flags: give a number $.flags : indiquez un nombre +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding : ici, les scripts lisent et écrivent uniquement en UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding : indiquez le nom d'un encodage, sous forme de chaîne +@msg $.memCache: the memory cache size cannot be set $.memCache : la taille du cache mémoire ne peut pas être définie +@msg $.setenv: give a value, as a string $.setenv : indiquez une valeur, sous forme de chaîne +@msg $.setenv: only {_1} can be set $.setenv : seules {_1} peuvent être définies +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv : une valeur comporte au plus {MAX_ENV_BYTES} lettres, chiffres et _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep : indiquez un nombre de millisecondes de 0 à {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep : indiquez un nombre de millisecondes +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep : une exécution ne peut pas attendre dans un rappel d'une fonction intégrée, un accesseur, une conversion ou un fichier que $.evalFile exécute ; appelez-la depuis le code du script lui-même +@msg $.bp: scripts here have no debugger $.bp : ici, les scripts n'ont pas de débogueur +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker : les scripts ne peuvent pas encore afficher de boîte de dialogue +@msg {name}: give a message {name} : indiquez un message +@msg {name}: give the text the field starts with {name} : indiquez le texte par lequel le champ commence +@msg {name}: the message is longer than 16 KiB {name} : le message dépasse 16 Kio +@msg {name}: the title is longer than 256 bytes {name} : le titre dépasse 256 octets +@msg {name}: the text the field starts with is longer than 16 KiB {name} : le texte par lequel le champ commence dépasse 16 Kio +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name} : une boîte de dialogue ne peut pas s'ouvrir dans un rappel d'une fonction intégrée, un accesseur, une conversion ou un fichier que $.evalFile exécute ; appelez-la depuis le code du script lui-même +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name} : la réponse suivante de `answers` est pour {_1}, pas pour {name} +@msg {name}: `answers` has no answer left for this dialog {name} : `answers` n'a plus de réponse pour cette boîte de dialogue +@msg vc.document{place} is too large for a script vc.document{place} est trop volumineux pour un script +@msg vc.log: the log of this run is full vc.log : le journal de cette exécution est plein +@msg this function's script run has ended l'exécution du script de cette fonction est terminée +@msg the script made more host calls than one run may make le script a fait plus d'appels à l'hôte qu'une exécution ne peut en faire +@msg the script passed more data to and from commands than one run may pass le script a transmis plus de données vers et depuis les commandes qu'une exécution ne peut en transmettre +@msg the script added more objects and data to the documents than one run may add le script a ajouté aux documents plus d'objets et de données qu'une exécution ne peut en ajouter +@msg {what}: the object is not a File or a Folder {what} : l'objet n'est ni un File ni un Folder +@msg {what}: the count must be a finite number, 0 or more {what} : le nombre doit être un nombre fini, 0 ou plus +@msg File.seek: the position must be a finite number File.seek : la position doit être un nombre fini +@msg File.seek: the mode must be 0, 1 or 2 File.seek : le mode doit être 0, 1 ou 2 +@msg script file is compiled: {value} le fichier de script est compilé : {value} +@msg `name` must be the name of a script engine `name` doit être le nom d'un moteur de script +@msg the main script engine is new for each run and is never kept, so it cannot be dropped le moteur de script principal est nouveau à chaque exécution et n'est jamais conservé, il ne peut donc pas être supprimé +@msg there is no script engine named {name} il n'y a aucun moteur de script nommé {name} @msg Running a script Exécution d’un script @msg Copied the script report Rapport du script copié @msg Corners edits the corners of a path Angles modifie les angles d’un tracé diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 978b6811fd..6ce8b2fc43 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -6448,6 +6448,85 @@ antiAlias Sharp शार्प @msg the script's run is no longer available स्क्रिप्ट का रन अब उपलब्ध नहीं है @msg a failed command changed undo steps that could not be put back, so the script was stopped एक विफल कमांड ने पूर्ववत चरण बदल दिए जिन्हें वापस नहीं रखा जा सका, इसलिए स्क्रिप्ट रोक दी गई @msg a recovery copy could not be written, so the script was not run रिकवरी प्रति नहीं लिखी जा सकी, इसलिए स्क्रिप्ट नहीं चलाई गई +@msg Script file access denied स्क्रिप्ट फ़ाइल तक पहुँच अस्वीकृत +@msg Script file exceeds 8 MiB स्क्रिप्ट फ़ाइल 8 MiB से बड़ी है +@msg Script file is not open स्क्रिप्ट फ़ाइल खुली नहीं है +@msg Script file cannot be decoded स्क्रिप्ट फ़ाइल को डिकोड नहीं किया जा सकता +@msg Script file is not a regular file स्क्रिप्ट फ़ाइल सामान्य फ़ाइल नहीं है +@msg Script file does not exist स्क्रिप्ट फ़ाइल मौजूद नहीं है +@msg Script file could not be read स्क्रिप्ट फ़ाइल पढ़ी नहीं जा सकी +@msg Script folder has more than 2,048 entries स्क्रिप्ट फ़ोल्डर में 2,048 से अधिक प्रविष्टियाँ हैं +@msg Script file open mode must be r, w, e or a स्क्रिप्ट फ़ाइल खोलने का मोड r, w, e या a होना चाहिए +@msg Script file writing is not available स्क्रिप्ट फ़ाइल लिखना उपलब्ध नहीं है +@msg Script file dialogs are not available स्क्रिप्ट फ़ाइल संवाद उपलब्ध नहीं हैं +@msg Script files cannot be opened in another application स्क्रिप्ट फ़ाइलें किसी अन्य ऐप्लिकेशन में नहीं खोली जा सकतीं +@msg Script file access is unavailable on the web वेब पर स्क्रिप्ट फ़ाइल पहुँच उपलब्ध नहीं है +@msg Script has 256 files open स्क्रिप्ट ने 256 फ़ाइलें खोल रखी हैं +@msg Script file path exceeds 32,767 characters स्क्रिप्ट फ़ाइल का पथ 32,767 वर्णों से अधिक है +@msg Script folder mask takes too many steps to match स्क्रिप्ट फ़ोल्डर मास्क के मिलान में बहुत अधिक चरण लगते हैं +@msg the script opened more file data than one run may open (32 MiB) स्क्रिप्ट ने एक रन में खोले जा सकने वाले फ़ाइल डेटा से अधिक डेटा खोला (32 MiB) +@msg File.seek: takes a position and a mode File.seek: एक स्थिति और एक मोड लेता है +@msg vc.run: give a command id, as a string vc.run: कमांड id स्ट्रिंग के रूप में दें +@msg vc.run: takes a command id and an object of parameters vc.run: एक कमांड id और पैरामीटर का एक ऑब्जेक्ट लेता है +@msg vc.run: the parameters must be an object vc.run: पैरामीटर एक ऑब्जेक्ट होने चाहिए +@msg vc.run: the result{place} is too large for a script vc.run: परिणाम{place} स्क्रिप्ट के लिए बहुत बड़ा है +@msg $.evalFile requires a file path $.evalFile के लिए फ़ाइल पथ आवश्यक है +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: टाइमआउट मिलीसेकंड की एक सीमित संख्या होनी चाहिए, 0 या अधिक +@msg $.evalFile: takes a file path and a timeout $.evalFile: एक फ़ाइल पथ और एक टाइमआउट लेता है +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: {file} की लाइन {line}, कॉलम {column}: {e} (थ्रो किया गया) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: लाइन {line}, कॉलम {column}: {e} (थ्रो किया गया) +@msg {name}: {e} (thrown) {name}: {e} (थ्रो किया गया) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: {file} की लाइन {line}, कॉलम {column}: {e} (सीमा) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: लाइन {line}, कॉलम {column}: {e} (सीमा) +@msg {name}: {e} (limit) {name}: {e} (सीमा) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: {file} की लाइन {line}, कॉलम {column}: {e} (सिंटैक्स त्रुटि) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: लाइन {line}, कॉलम {column}: {e} (सिंटैक्स त्रुटि) +@msg {name}: {e} (syntax) {name}: {e} (सिंटैक्स त्रुटि) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: {file} की लाइन {line}, कॉलम {column}: {e} (रोका गया) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: लाइन {line}, कॉलम {column}: {e} (रोका गया) +@msg {name}: {e} (stopped) {name}: {e} (रोका गया) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: {file} की लाइन {line}, कॉलम {column}: {e} (आंतरिक त्रुटि) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: लाइन {line}, कॉलम {column}: {e} (आंतरिक त्रुटि) +@msg {name}: {e} (internal) {name}: {e} (आंतरिक त्रुटि) +@msg {e} (these files stay written: {paths}) {e} (ये फ़ाइलें लिखी हुई रहती हैं: {paths}) +@msg $.{name}: give a name, as a string $.{name}: एक नाम स्ट्रिंग के रूप में दें +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: "en" या "de_DE" जैसी कोई लोकेल दें, या इंटरफ़ेस की लोकेल के लिए null दें +@msg $.localize: give true or false $.localize: true या false दें +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: केवल 512, जो स्थानीयकरण चालू करता है, या 0 सेट किया जा सकता है +@msg $.flags: give a number $.flags: एक संख्या दें +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: यहाँ स्क्रिप्ट केवल UTF-8 पढ़ती और लिखती हैं +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: किसी एन्कोडिंग का नाम स्ट्रिंग के रूप में दें +@msg $.memCache: the memory cache size cannot be set $.memCache: मेमोरी कैश का आकार सेट नहीं किया जा सकता +@msg $.setenv: give a value, as a string $.setenv: एक मान स्ट्रिंग के रूप में दें +@msg $.setenv: only {_1} can be set $.setenv: केवल {_1} सेट किए जा सकते हैं +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: किसी मान में अधिकतम {MAX_ENV_BYTES} अक्षर, अंक और _ . - @ होते हैं +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: 0 से {MAX_SLEEP_MS} तक मिलीसेकंड की संख्या दें +@msg $.sleep: give a number of milliseconds $.sleep: मिलीसेकंड की संख्या दें +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: कोई रन किसी बिल्ट-इन फ़ंक्शन के कॉलबैक, getter, रूपांतरण या $.evalFile द्वारा चलाई गई फ़ाइल के भीतर प्रतीक्षा नहीं कर सकता; इसे स्क्रिप्ट के अपने कोड से कॉल करें +@msg $.bp: scripts here have no debugger $.bp: यहाँ स्क्रिप्ट के लिए कोई डीबगर नहीं है +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: स्क्रिप्ट अभी डायलॉग नहीं दिखा सकतीं +@msg {name}: give a message {name}: एक संदेश दें +@msg {name}: give the text the field starts with {name}: वह टेक्स्ट दें जिससे फ़ील्ड शुरू होता है +@msg {name}: the message is longer than 16 KiB {name}: संदेश 16 KiB से लंबा है +@msg {name}: the title is longer than 256 bytes {name}: शीर्षक 256 बाइट से लंबा है +@msg {name}: the text the field starts with is longer than 16 KiB {name}: जिस टेक्स्ट से फ़ील्ड शुरू होता है वह 16 KiB से लंबा है +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: कोई डायलॉग किसी बिल्ट-इन फ़ंक्शन के कॉलबैक, getter, रूपांतरण या $.evalFile द्वारा चलाई गई फ़ाइल के भीतर नहीं खुल सकता; इसे स्क्रिप्ट के अपने कोड से कॉल करें +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: `answers` में अगला उत्तर {_1} के लिए है, {name} के लिए नहीं +@msg {name}: `answers` has no answer left for this dialog {name}: `answers` में इस डायलॉग के लिए कोई उत्तर नहीं बचा है +@msg vc.document{place} is too large for a script vc.document{place} स्क्रिप्ट के लिए बहुत बड़ा है +@msg vc.log: the log of this run is full vc.log: इस रन का लॉग भर गया है +@msg this function's script run has ended इस फ़ंक्शन का स्क्रिप्ट रन समाप्त हो गया है +@msg the script made more host calls than one run may make स्क्रिप्ट ने एक रन में अनुमत से अधिक होस्ट कॉल किए +@msg the script passed more data to and from commands than one run may pass स्क्रिप्ट ने कमांड को और कमांड से एक रन में अनुमत से अधिक डेटा भेजा +@msg the script added more objects and data to the documents than one run may add स्क्रिप्ट ने दस्तावेज़ों में एक रन में अनुमत से अधिक ऑब्जेक्ट और डेटा जोड़े +@msg {what}: the object is not a File or a Folder {what}: ऑब्जेक्ट न File है न Folder +@msg {what}: the count must be a finite number, 0 or more {what}: गिनती एक सीमित संख्या होनी चाहिए, 0 या अधिक +@msg File.seek: the position must be a finite number File.seek: स्थिति एक सीमित संख्या होनी चाहिए +@msg File.seek: the mode must be 0, 1 or 2 File.seek: मोड 0, 1 या 2 होना चाहिए +@msg script file is compiled: {value} स्क्रिप्ट फ़ाइल कंपाइल की हुई है: {value} +@msg `name` must be the name of a script engine `name` किसी स्क्रिप्ट इंजन का नाम होना चाहिए +@msg the main script engine is new for each run and is never kept, so it cannot be dropped मुख्य स्क्रिप्ट इंजन हर रन के लिए नया होता है और कभी रखा नहीं जाता, इसलिए इसे हटाया नहीं जा सकता +@msg there is no script engine named {name} {name} नाम का कोई स्क्रिप्ट इंजन नहीं है @msg Running a script स्क्रिप्ट चल रही है @msg Copied the script report Copied स्क्रिप्ट रिपोर्ट @msg copy needs path: the file to copy into the document's folder copy: प्रतिलिपि की जरूरत है पाथ: फ़ाइल को डॉक्यूमेंट के फ़ोल्डर में कॉपी करने के लिए diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 7bfe5b5682..da490086b7 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5015,6 +5015,85 @@ imageTrace Outline Körvonal @msg the script's run is no longer available a parancsfájl futása már nem érhető el @msg a failed command changed undo steps that could not be put back, so the script was stopped egy sikertelen parancs olyan visszavonási lépéseket módosított, amelyeket nem lehetett visszaállítani, ezért a parancsfájl leállt @msg a recovery copy could not be written, so the script was not run a helyreállítási másolatot nem sikerült kiírni, ezért a parancsfájl nem futott le +@msg Script file access denied A parancsfájl elérése megtagadva +@msg Script file exceeds 8 MiB A parancsfájl nagyobb 8 MiB-nál +@msg Script file is not open A parancsfájl nincs megnyitva +@msg Script file cannot be decoded A parancsfájl nem dekódolható +@msg Script file is not a regular file A parancsfájl nem normál fájl +@msg Script file does not exist A parancsfájl nem létezik +@msg Script file could not be read A parancsfájlt nem sikerült beolvasni +@msg Script folder has more than 2,048 entries A parancsfájlmappában 2048-nál több bejegyzés van +@msg Script file open mode must be r, w, e or a A parancsfájl megnyitási módja r, w, e vagy a lehet +@msg Script file writing is not available A parancsfájlok írása nem érhető el +@msg Script file dialogs are not available A parancsfájlok fájlpárbeszédpanelei nem érhetők el +@msg Script files cannot be opened in another application A parancsfájlok nem nyithatók meg másik alkalmazásban +@msg Script file access is unavailable on the web A parancsfájlok elérése a weben nem érhető el +@msg Script has 256 files open A parancsfájlnak 256 megnyitott fájlja van +@msg Script file path exceeds 32,767 characters A parancsfájl elérési útja hosszabb 32 767 karakternél +@msg Script folder mask takes too many steps to match A parancsfájlmappa maszkjának illesztése túl sok lépést igényel +@msg the script opened more file data than one run may open (32 MiB) a parancsfájl több fájladatot nyitott meg, mint amennyit egy futás megnyithat (32 MiB) +@msg File.seek: takes a position and a mode File.seek: egy pozíciót és egy módot vár +@msg vc.run: give a command id, as a string vc.run: adjon meg egy parancsazonosítót karakterláncként +@msg vc.run: takes a command id and an object of parameters vc.run: egy parancsazonosítót és egy paraméterobjektumot vár +@msg vc.run: the parameters must be an object vc.run: a paramétereknek objektumnak kell lenniük +@msg vc.run: the result{place} is too large for a script vc.run: az eredmény{place} túl nagy egy parancsfájlhoz +@msg $.evalFile requires a file path A $.evalFile fájlútvonalat igényel +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: az időkorlátnak véges számú ezredmásodpercnek kell lennie, 0 vagy több +@msg $.evalFile: takes a file path and a timeout $.evalFile: egy fájlútvonalat és egy időkorlátot vár +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: {file}, {line}. sor, {column}. oszlop: {e} (kivétel) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: {line}. sor, {column}. oszlop: {e} (kivétel) +@msg {name}: {e} (thrown) {name}: {e} (kivétel) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: {file}, {line}. sor, {column}. oszlop: {e} (korlát) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: {line}. sor, {column}. oszlop: {e} (korlát) +@msg {name}: {e} (limit) {name}: {e} (korlát) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: {file}, {line}. sor, {column}. oszlop: {e} (szintaktikai hiba) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: {line}. sor, {column}. oszlop: {e} (szintaktikai hiba) +@msg {name}: {e} (syntax) {name}: {e} (szintaktikai hiba) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: {file}, {line}. sor, {column}. oszlop: {e} (leállítva) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: {line}. sor, {column}. oszlop: {e} (leállítva) +@msg {name}: {e} (stopped) {name}: {e} (leállítva) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: {file}, {line}. sor, {column}. oszlop: {e} (belső hiba) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: {line}. sor, {column}. oszlop: {e} (belső hiba) +@msg {name}: {e} (internal) {name}: {e} (belső hiba) +@msg {e} (these files stay written: {paths}) {e} (ezek a fájlok írva maradnak: {paths}) +@msg $.{name}: give a name, as a string $.{name}: adjon meg egy nevet karakterláncként +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: adjon meg egy területi beállítást, például "en" vagy "de_DE", vagy null értéket a felületéhez +@msg $.localize: give true or false $.localize: adjon meg true vagy false értéket +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: csak a 512, amely bekapcsolja a honosítást, vagy a 0 állítható be +@msg $.flags: give a number $.flags: adjon meg egy számot +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: a parancsfájlok itt csak UTF-8 kódolást olvasnak és írnak +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: adja meg egy kódolás nevét karakterláncként +@msg $.memCache: the memory cache size cannot be set $.memCache: a memória-gyorsítótár mérete nem állítható be +@msg $.setenv: give a value, as a string $.setenv: adjon meg egy értéket karakterláncként +@msg $.setenv: only {_1} can be set $.setenv: csak ezek állíthatók be: {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: egy érték legfeljebb {MAX_ENV_BYTES} betűből, számjegyből és _ . - @ jelből áll +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: adjon meg 0 és {MAX_SLEEP_MS} közötti ezredmásodperc-számot +@msg $.sleep: give a number of milliseconds $.sleep: adjon meg egy ezredmásodperc-számot +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: egy futás nem várakozhat beépített függvény visszahívásában, getterben, átalakításban vagy a $.evalFile által futtatott fájlban; hívja a parancsfájl saját kódjából +@msg $.bp: scripts here have no debugger $.bp: a parancsfájlokhoz itt nincs hibakereső +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: a parancsfájlok még nem tudnak párbeszédpanelt megjeleníteni +@msg {name}: give a message {name}: adjon meg egy üzenetet +@msg {name}: give the text the field starts with {name}: adja meg a szöveget, amellyel a mező kezdődik +@msg {name}: the message is longer than 16 KiB {name}: az üzenet hosszabb 16 KiB-nál +@msg {name}: the title is longer than 256 bytes {name}: a cím hosszabb 256 bájtnál +@msg {name}: the text the field starts with is longer than 16 KiB {name}: a szöveg, amellyel a mező kezdődik, hosszabb 16 KiB-nál +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: párbeszédpanel nem nyílhat meg beépített függvény visszahívásában, getterben, átalakításban vagy a $.evalFile által futtatott fájlban; hívja a parancsfájl saját kódjából +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: a következő válasz az `answers` listában ehhez tartozik: {_1}, nem ehhez: {name} +@msg {name}: `answers` has no answer left for this dialog {name}: az `answers` listában nem maradt válasz ehhez a párbeszédpanelhez +@msg vc.document{place} is too large for a script a vc.document{place} túl nagy egy parancsfájlhoz +@msg vc.log: the log of this run is full vc.log: ennek a futásnak a naplója megtelt +@msg this function's script run has ended ennek a függvénynek a parancsfájl-futása véget ért +@msg the script made more host calls than one run may make a parancsfájl több gazdahívást végzett, mint amennyit egy futás végezhet +@msg the script passed more data to and from commands than one run may pass a parancsfájl több adatot adott át a parancsoknak és a parancsoktól, mint amennyit egy futás átadhat +@msg the script added more objects and data to the documents than one run may add a parancsfájl több objektumot és adatot adott a dokumentumokhoz, mint amennyit egy futás hozzáadhat +@msg {what}: the object is not a File or a Folder {what}: az objektum nem File és nem Folder +@msg {what}: the count must be a finite number, 0 or more {what}: a darabszámnak véges számnak kell lennie, 0 vagy több +@msg File.seek: the position must be a finite number File.seek: a pozíciónak véges számnak kell lennie +@msg File.seek: the mode must be 0, 1 or 2 File.seek: a mód csak 0, 1 vagy 2 lehet +@msg script file is compiled: {value} a parancsfájl le van fordítva: {value} +@msg `name` must be the name of a script engine a `name` értékének egy parancsfájlmotor nevének kell lennie +@msg the main script engine is new for each run and is never kept, so it cannot be dropped a fő parancsfájlmotor minden futáshoz új, és sosem marad meg, ezért nem dobható el +@msg there is no script engine named {name} nincs {name} nevű parancsfájlmotor @msg Running a script Parancsfájl futtatása @msg Copied the script report Szkriptjelentés másolva @msg Corners edits the corners of a path a Sarkok parancs egy útvonal sarkait szerkeszti diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index d9aa6ea3c8..09f70a62fe 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -4262,6 +4262,85 @@ axis Both Entrambi @msg the script's run is no longer available l'esecuzione dello script non è più disponibile @msg a failed command changed undo steps that could not be put back, so the script was stopped un comando non riuscito ha modificato passaggi di annullamento che non è stato possibile ripristinare, quindi lo script è stato interrotto @msg a recovery copy could not be written, so the script was not run non è stato possibile scrivere una copia di recupero, quindi lo script non è stato eseguito +@msg Script file access denied Accesso al file di script negato +@msg Script file exceeds 8 MiB Il file di script supera 8 MiB +@msg Script file is not open Il file di script non è aperto +@msg Script file cannot be decoded Impossibile decodificare il file di script +@msg Script file is not a regular file Il file di script non è un file normale +@msg Script file does not exist Il file di script non esiste +@msg Script file could not be read Impossibile leggere il file di script +@msg Script folder has more than 2,048 entries La cartella di script contiene più di 2.048 voci +@msg Script file open mode must be r, w, e or a La modalità di apertura del file di script deve essere r, w, e oppure a +@msg Script file writing is not available La scrittura dei file di script non è disponibile +@msg Script file dialogs are not available Le finestre di dialogo dei file di script non sono disponibili +@msg Script files cannot be opened in another application I file di script non possono essere aperti in un'altra applicazione +@msg Script file access is unavailable on the web L'accesso ai file di script non è disponibile sul web +@msg Script has 256 files open Lo script ha 256 file aperti +@msg Script file path exceeds 32,767 characters Il percorso del file di script supera 32.767 caratteri +@msg Script folder mask takes too many steps to match La maschera della cartella di script richiede troppi passaggi per la corrispondenza +@msg the script opened more file data than one run may open (32 MiB) lo script ha aperto più dati di file di quanti ne possa aprire un'esecuzione (32 MiB) +@msg File.seek: takes a position and a mode File.seek: accetta una posizione e una modalità +@msg vc.run: give a command id, as a string vc.run: indica un id di comando, come stringa +@msg vc.run: takes a command id and an object of parameters vc.run: accetta un id di comando e un oggetto di parametri +@msg vc.run: the parameters must be an object vc.run: i parametri devono essere un oggetto +@msg vc.run: the result{place} is too large for a script vc.run: il risultato{place} è troppo grande per uno script +@msg $.evalFile requires a file path $.evalFile richiede un percorso di file +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: il timeout deve essere un numero finito di millisecondi, 0 o più +@msg $.evalFile: takes a file path and a timeout $.evalFile: accetta un percorso di file e un timeout +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: riga {line}, colonna {column} di {file}: {e} (generato) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: riga {line}, colonna {column}: {e} (generato) +@msg {name}: {e} (thrown) {name}: {e} (generato) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: riga {line}, colonna {column} di {file}: {e} (limite) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: riga {line}, colonna {column}: {e} (limite) +@msg {name}: {e} (limit) {name}: {e} (limite) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: riga {line}, colonna {column} di {file}: {e} (errore di sintassi) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: riga {line}, colonna {column}: {e} (errore di sintassi) +@msg {name}: {e} (syntax) {name}: {e} (errore di sintassi) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: riga {line}, colonna {column} di {file}: {e} (interrotto) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: riga {line}, colonna {column}: {e} (interrotto) +@msg {name}: {e} (stopped) {name}: {e} (interrotto) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: riga {line}, colonna {column} di {file}: {e} (errore interno) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: riga {line}, colonna {column}: {e} (errore interno) +@msg {name}: {e} (internal) {name}: {e} (errore interno) +@msg {e} (these files stay written: {paths}) {e} (questi file restano scritti: {paths}) +@msg $.{name}: give a name, as a string $.{name}: indica un nome, come stringa +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: indica una impostazione locale come "en" o "de_DE", oppure null per quella dell'interfaccia +@msg $.localize: give true or false $.localize: indica true o false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: si può impostare solo 512, che attiva la localizzazione, oppure 0 +@msg $.flags: give a number $.flags: indica un numero +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: qui gli script leggono e scrivono solo UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: indica il nome di una codifica, come stringa +@msg $.memCache: the memory cache size cannot be set $.memCache: la dimensione della cache di memoria non può essere impostata +@msg $.setenv: give a value, as a string $.setenv: indica un valore, come stringa +@msg $.setenv: only {_1} can be set $.setenv: si possono impostare solo {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: un valore ha al massimo {MAX_ENV_BYTES} lettere, cifre e _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: indica un numero di millisecondi da 0 a {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: indica un numero di millisecondi +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: un'esecuzione non può attendere dentro un callback di una funzione integrata, un getter, una conversione o un file eseguito da $.evalFile; chiamala dal codice dello script stesso +@msg $.bp: scripts here have no debugger $.bp: qui gli script non hanno un debugger +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: gli script non possono ancora mostrare una finestra di dialogo +@msg {name}: give a message {name}: indica un messaggio +@msg {name}: give the text the field starts with {name}: indica il testo con cui inizia il campo +@msg {name}: the message is longer than 16 KiB {name}: il messaggio supera 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: il titolo supera 256 byte +@msg {name}: the text the field starts with is longer than 16 KiB {name}: il testo con cui inizia il campo supera 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: una finestra di dialogo non può aprirsi dentro un callback di una funzione integrata, un getter, una conversione o un file eseguito da $.evalFile; chiamala dal codice dello script stesso +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: la prossima risposta in `answers` è per {_1}, non per {name} +@msg {name}: `answers` has no answer left for this dialog {name}: in `answers` non rimangono risposte per questa finestra di dialogo +@msg vc.document{place} is too large for a script vc.document{place} è troppo grande per uno script +@msg vc.log: the log of this run is full vc.log: il registro di questa esecuzione è pieno +@msg this function's script run has ended l'esecuzione dello script di questa funzione è terminata +@msg the script made more host calls than one run may make lo script ha fatto più chiamate all'host di quante ne possa fare un'esecuzione +@msg the script passed more data to and from commands than one run may pass lo script ha passato ai comandi e dai comandi più dati di quanti ne possa passare un'esecuzione +@msg the script added more objects and data to the documents than one run may add lo script ha aggiunto ai documenti più oggetti e dati di quanti ne possa aggiungere un'esecuzione +@msg {what}: the object is not a File or a Folder {what}: l'oggetto non è un File né un Folder +@msg {what}: the count must be a finite number, 0 or more {what}: il conteggio deve essere un numero finito, 0 o più +@msg File.seek: the position must be a finite number File.seek: la posizione deve essere un numero finito +@msg File.seek: the mode must be 0, 1 or 2 File.seek: la modalità deve essere 0, 1 o 2 +@msg script file is compiled: {value} il file di script è compilato: {value} +@msg `name` must be the name of a script engine `name` deve essere il nome di un motore di script +@msg the main script engine is new for each run and is never kept, so it cannot be dropped il motore di script principale è nuovo a ogni esecuzione e non viene mai conservato, quindi non può essere eliminato +@msg there is no script engine named {name} non esiste un motore di script chiamato {name} @msg Running a script Esecuzione di uno script @msg Copied the script report Rapporto dello script copiato @msg Corners edits the corners of a path Angoli modifica gli angoli di un tracciato diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 5e337a9bc4..eac1acd61d 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -5011,6 +5011,85 @@ swatch Bright Violet ビビッドバイオレット @msg the script's run is no longer available スクリプトの実行は利用できなくなりました @msg a failed command changed undo steps that could not be put back, so the script was stopped 失敗したコマンドが元に戻せない取り消し手順を変更したため、スクリプトを停止しました @msg a recovery copy could not be written, so the script was not run 復元用のコピーを書き込めなかったため、スクリプトは実行されませんでした +@msg Script file access denied スクリプトファイルへのアクセスが拒否されました +@msg Script file exceeds 8 MiB スクリプトファイルが 8 MiB を超えています +@msg Script file is not open スクリプトファイルが開かれていません +@msg Script file cannot be decoded スクリプトファイルをデコードできません +@msg Script file is not a regular file スクリプトファイルが通常のファイルではありません +@msg Script file does not exist スクリプトファイルが存在しません +@msg Script file could not be read スクリプトファイルを読み込めませんでした +@msg Script folder has more than 2,048 entries スクリプトフォルダーの項目が 2,048 を超えています +@msg Script file open mode must be r, w, e or a スクリプトファイルを開くモードは r、w、e、a のいずれかにしてください +@msg Script file writing is not available スクリプトファイルの書き込みは利用できません +@msg Script file dialogs are not available スクリプトファイルのダイアログは利用できません +@msg Script files cannot be opened in another application スクリプトファイルを別のアプリケーションで開くことはできません +@msg Script file access is unavailable on the web Web ではスクリプトファイルにアクセスできません +@msg Script has 256 files open スクリプトが 256 個のファイルを開いています +@msg Script file path exceeds 32,767 characters スクリプトファイルのパスが 32,767 文字を超えています +@msg Script folder mask takes too many steps to match スクリプトフォルダーのマスクの照合に必要な手順が多すぎます +@msg the script opened more file data than one run may open (32 MiB) スクリプトが 1 回の実行で開ける量 (32 MiB) を超えるファイルデータを開きました +@msg File.seek: takes a position and a mode File.seek: 位置とモードを指定します +@msg vc.run: give a command id, as a string vc.run: コマンド ID を文字列で指定してください +@msg vc.run: takes a command id and an object of parameters vc.run: コマンド ID とパラメーターのオブジェクトを指定します +@msg vc.run: the parameters must be an object vc.run: パラメーターはオブジェクトにしてください +@msg vc.run: the result{place} is too large for a script vc.run: 結果 {place} がスクリプトには大きすぎます +@msg $.evalFile requires a file path $.evalFile にはファイルパスが必要です +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: タイムアウトは 0 以上の有限のミリ秒数にしてください +@msg $.evalFile: takes a file path and a timeout $.evalFile: ファイルパスとタイムアウトを指定します +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: {file} の {line} 行目、{column} 列目: {e} (スロー) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: {line} 行目、{column} 列目: {e} (スロー) +@msg {name}: {e} (thrown) {name}: {e} (スロー) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: {file} の {line} 行目、{column} 列目: {e} (上限) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: {line} 行目、{column} 列目: {e} (上限) +@msg {name}: {e} (limit) {name}: {e} (上限) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: {file} の {line} 行目、{column} 列目: {e} (構文エラー) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: {line} 行目、{column} 列目: {e} (構文エラー) +@msg {name}: {e} (syntax) {name}: {e} (構文エラー) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: {file} の {line} 行目、{column} 列目: {e} (停止) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: {line} 行目、{column} 列目: {e} (停止) +@msg {name}: {e} (stopped) {name}: {e} (停止) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: {file} の {line} 行目、{column} 列目: {e} (内部エラー) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: {line} 行目、{column} 列目: {e} (内部エラー) +@msg {name}: {e} (internal) {name}: {e} (内部エラー) +@msg {e} (these files stay written: {paths}) {e} (これらのファイルは書き込まれたままです: {paths}) +@msg $.{name}: give a name, as a string $.{name}: 名前を文字列で指定してください +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: "en" や "de_DE" などのロケールを指定するか、インターフェイスのロケールには null を指定してください +@msg $.localize: give true or false $.localize: true または false を指定してください +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: 設定できるのはローカライズをオンにする 512 か 0 だけです +@msg $.flags: give a number $.flags: 数値を指定してください +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: ここではスクリプトは UTF-8 のみを読み書きします +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: エンコーディング名を文字列で指定してください +@msg $.memCache: the memory cache size cannot be set $.memCache: メモリーキャッシュのサイズは設定できません +@msg $.setenv: give a value, as a string $.setenv: 値を文字列で指定してください +@msg $.setenv: only {_1} can be set $.setenv: 設定できるのは {_1} だけです +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: 値は最大 {MAX_ENV_BYTES} 文字の英字、数字、_ . - @ です +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: 0 から {MAX_SLEEP_MS} までのミリ秒数を指定してください +@msg $.sleep: give a number of milliseconds $.sleep: ミリ秒数を指定してください +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: 組み込み関数のコールバック、getter、変換、または $.evalFile が実行するファイルの中では実行を待機できません。スクリプト自身のコードから呼び出してください +@msg $.bp: scripts here have no debugger $.bp: ここではスクリプトにデバッガーはありません +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: スクリプトはまだダイアログを表示できません +@msg {name}: give a message {name}: メッセージを指定してください +@msg {name}: give the text the field starts with {name}: フィールドの初期テキストを指定してください +@msg {name}: the message is longer than 16 KiB {name}: メッセージが 16 KiB を超えています +@msg {name}: the title is longer than 256 bytes {name}: タイトルが 256 バイトを超えています +@msg {name}: the text the field starts with is longer than 16 KiB {name}: フィールドの初期テキストが 16 KiB を超えています +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: 組み込み関数のコールバック、getter、変換、または $.evalFile が実行するファイルの中ではダイアログを開けません。スクリプト自身のコードから呼び出してください +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: `answers` の次の回答は {name} ではなく {_1} のものです +@msg {name}: `answers` has no answer left for this dialog {name}: `answers` にこのダイアログの回答が残っていません +@msg vc.document{place} is too large for a script vc.document{place} はスクリプトには大きすぎます +@msg vc.log: the log of this run is full vc.log: この実行のログがいっぱいです +@msg this function's script run has ended この関数のスクリプトの実行は終了しています +@msg the script made more host calls than one run may make スクリプトが 1 回の実行で許されるより多くのホスト呼び出しを行いました +@msg the script passed more data to and from commands than one run may pass スクリプトが 1 回の実行で許されるより多くのデータをコマンドとやり取りしました +@msg the script added more objects and data to the documents than one run may add スクリプトが 1 回の実行で許されるより多くのオブジェクトとデータをドキュメントに追加しました +@msg {what}: the object is not a File or a Folder {what}: オブジェクトは File でも Folder でもありません +@msg {what}: the count must be a finite number, 0 or more {what}: 数は 0 以上の有限の数値にしてください +@msg File.seek: the position must be a finite number File.seek: 位置は有限の数値にしてください +@msg File.seek: the mode must be 0, 1 or 2 File.seek: モードは 0, 1 または 2 にしてください +@msg script file is compiled: {value} スクリプトファイルはコンパイル済みです: {value} +@msg `name` must be the name of a script engine `name` はスクリプトエンジンの名前にしてください +@msg the main script engine is new for each run and is never kept, so it cannot be dropped メインのスクリプトエンジンは実行ごとに新しく作られ、保持されないため、破棄できません +@msg there is no script engine named {name} {name} という名前のスクリプトエンジンはありません @msg Running a script スクリプトを実行中 @msg Copied the script report スクリプトのレポートをコピーしました @msg Exported {path} {path} を書き出しました diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index e5bf998d5c..b0e5487641 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -5349,6 +5349,85 @@ imageTrace Outline კონტური @msg the script's run is no longer available სკრიპტის გაშვება აღარ არის ხელმისაწვდომი @msg a failed command changed undo steps that could not be put back, so the script was stopped წარუმატებელმა ბრძანებამ დაბრუნების ნაბიჯები შეცვალა და მათი პირვანდელ მდგომარეობაში მოყვანა ვერ მოხერხდა, ამიტომ სკრიპტი შეჩერდა @msg a recovery copy could not be written, so the script was not run აღდგენის ასლის ჩაწერა ვერ მოხერხდა, ამიტომ სკრიპტი არ გაეშვა +@msg Script file access denied სკრიპტის ფაილზე წვდომა აკრძალულია +@msg Script file exceeds 8 MiB სკრიპტის ფაილი 8 MiB-ს აღემატება +@msg Script file is not open სკრიპტის ფაილი გახსნილი არ არის +@msg Script file cannot be decoded სკრიპტის ფაილის დეკოდირება შეუძლებელია +@msg Script file is not a regular file სკრიპტის ფაილი ჩვეულებრივი ფაილი არ არის +@msg Script file does not exist სკრიპტის ფაილი არ არსებობს +@msg Script file could not be read სკრიპტის ფაილის წაკითხვა ვერ მოხერხდა +@msg Script folder has more than 2,048 entries სკრიპტის საქაღალდეში 2048-ზე მეტი ჩანაწერია +@msg Script file open mode must be r, w, e or a სკრიპტის ფაილის გახსნის რეჟიმი უნდა იყოს r, w, e ან a +@msg Script file writing is not available სკრიპტის ფაილების ჩაწერა მიუწვდომელია +@msg Script file dialogs are not available სკრიპტის ფაილის დიალოგები მიუწვდომელია +@msg Script files cannot be opened in another application სკრიპტის ფაილების სხვა აპლიკაციაში გახსნა შეუძლებელია +@msg Script file access is unavailable on the web ვებში სკრიპტის ფაილებზე წვდომა მიუწვდომელია +@msg Script has 256 files open სკრიპტს 256 ფაილი აქვს გახსნილი +@msg Script file path exceeds 32,767 characters სკრიპტის ფაილის მისამართი 32 767 სიმბოლოს აღემატება +@msg Script folder mask takes too many steps to match სკრიპტის საქაღალდის ნიღბის შედარებას ზედმეტად ბევრი ნაბიჯი სჭირდება +@msg the script opened more file data than one run may open (32 MiB) სკრიპტმა გახსნა იმაზე მეტი ფაილის მონაცემი, ვიდრე ერთ გაშვებას შეუძლია (32 MiB) +@msg File.seek: takes a position and a mode File.seek: იღებს პოზიციას და რეჟიმს +@msg vc.run: give a command id, as a string vc.run: მიუთითეთ ბრძანების id სტრიქონის სახით +@msg vc.run: takes a command id and an object of parameters vc.run: იღებს ბრძანების id-ს და პარამეტრების ობიექტს +@msg vc.run: the parameters must be an object vc.run: პარამეტრები უნდა იყოს ობიექტი +@msg vc.run: the result{place} is too large for a script vc.run: შედეგი{place} ზედმეტად დიდია სკრიპტისთვის +@msg $.evalFile requires a file path $.evalFile-ს სჭირდება ფაილის მისამართი +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: დროის ლიმიტი უნდა იყოს მილიწამების სასრული რიცხვი, 0 ან მეტი +@msg $.evalFile: takes a file path and a timeout $.evalFile: იღებს ფაილის მისამართს და დროის ლიმიტს +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: {file}, სტრიქონი {line}, სვეტი {column}: {e} (გამონაკლისი) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: სტრიქონი {line}, სვეტი {column}: {e} (გამონაკლისი) +@msg {name}: {e} (thrown) {name}: {e} (გამონაკლისი) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: {file}, სტრიქონი {line}, სვეტი {column}: {e} (ლიმიტი) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: სტრიქონი {line}, სვეტი {column}: {e} (ლიმიტი) +@msg {name}: {e} (limit) {name}: {e} (ლიმიტი) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: {file}, სტრიქონი {line}, სვეტი {column}: {e} (სინტაქსური შეცდომა) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: სტრიქონი {line}, სვეტი {column}: {e} (სინტაქსური შეცდომა) +@msg {name}: {e} (syntax) {name}: {e} (სინტაქსური შეცდომა) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: {file}, სტრიქონი {line}, სვეტი {column}: {e} (შეჩერდა) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: სტრიქონი {line}, სვეტი {column}: {e} (შეჩერდა) +@msg {name}: {e} (stopped) {name}: {e} (შეჩერდა) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: {file}, სტრიქონი {line}, სვეტი {column}: {e} (შიდა შეცდომა) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: სტრიქონი {line}, სვეტი {column}: {e} (შიდა შეცდომა) +@msg {name}: {e} (internal) {name}: {e} (შიდა შეცდომა) +@msg {e} (these files stay written: {paths}) {e} (ეს ფაილები ჩაწერილი რჩება: {paths}) +@msg $.{name}: give a name, as a string $.{name}: მიუთითეთ სახელი სტრიქონის სახით +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: მიუთითეთ ლოკალი, მაგალითად "en" ან "de_DE", ან null ინტერფეისის ლოკალისთვის +@msg $.localize: give true or false $.localize: მიუთითეთ true ან false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: შეიძლება დაყენდეს მხოლოდ 512, რომელიც ლოკალიზაციას რთავს, ან 0 +@msg $.flags: give a number $.flags: მიუთითეთ რიცხვი +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: აქ სკრიპტები მხოლოდ UTF-8-ს კითხულობენ და წერენ +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: მიუთითეთ კოდირების სახელი სტრიქონის სახით +@msg $.memCache: the memory cache size cannot be set $.memCache: მეხსიერების ქეშის ზომის დაყენება შეუძლებელია +@msg $.setenv: give a value, as a string $.setenv: მიუთითეთ მნიშვნელობა სტრიქონის სახით +@msg $.setenv: only {_1} can be set $.setenv: შეიძლება დაყენდეს მხოლოდ {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: მნიშვნელობაში არის არაუმეტეს {MAX_ENV_BYTES} ასო, ციფრი და _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: მიუთითეთ მილიწამების რაოდენობა 0-დან {MAX_SLEEP_MS}-მდე +@msg $.sleep: give a number of milliseconds $.sleep: მიუთითეთ მილიწამების რაოდენობა +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: გაშვებას არ შეუძლია ლოდინი ჩაშენებული ფუნქციის უკუძახილში, getter-ში, გარდაქმნაში ან ფაილში, რომელსაც $.evalFile უშვებს; გამოიძახეთ ის სკრიპტის საკუთარი კოდიდან +@msg $.bp: scripts here have no debugger $.bp: აქ სკრიპტებს გამმართველი არ აქვთ +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: სკრიპტებს ჯერ არ შეუძლიათ დიალოგის ჩვენება +@msg {name}: give a message {name}: მიუთითეთ შეტყობინება +@msg {name}: give the text the field starts with {name}: მიუთითეთ ტექსტი, რომლითაც ველი იწყება +@msg {name}: the message is longer than 16 KiB {name}: შეტყობინება 16 KiB-ზე გრძელია +@msg {name}: the title is longer than 256 bytes {name}: სათაური 256 ბაიტზე გრძელია +@msg {name}: the text the field starts with is longer than 16 KiB {name}: ტექსტი, რომლითაც ველი იწყება, 16 KiB-ზე გრძელია +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: დიალოგი ვერ გაიხსნება ჩაშენებული ფუნქციის უკუძახილში, getter-ში, გარდაქმნაში ან ფაილში, რომელსაც $.evalFile უშვებს; გამოიძახეთ ის სკრიპტის საკუთარი კოდიდან +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: შემდეგი პასუხი `answers`-ში არის {_1}-ისთვის და არა {name}-ისთვის +@msg {name}: `answers` has no answer left for this dialog {name}: `answers`-ში ამ დიალოგისთვის პასუხი აღარ დარჩა +@msg vc.document{place} is too large for a script vc.document{place} ზედმეტად დიდია სკრიპტისთვის +@msg vc.log: the log of this run is full vc.log: ამ გაშვების ჟურნალი სავსეა +@msg this function's script run has ended ამ ფუნქციის სკრიპტის გაშვება დასრულდა +@msg the script made more host calls than one run may make სკრიპტმა იმაზე მეტი მასპინძლის გამოძახება შეასრულა, ვიდრე ერთ გაშვებას შეუძლია +@msg the script passed more data to and from commands than one run may pass სკრიპტმა ბრძანებებს და ბრძანებებიდან იმაზე მეტი მონაცემი გადასცა, ვიდრე ერთ გაშვებას შეუძლია +@msg the script added more objects and data to the documents than one run may add სკრიპტმა დოკუმენტებს იმაზე მეტი ობიექტი და მონაცემი დაამატა, ვიდრე ერთ გაშვებას შეუძლია +@msg {what}: the object is not a File or a Folder {what}: ობიექტი არც File-ია და არც Folder +@msg {what}: the count must be a finite number, 0 or more {what}: რაოდენობა უნდა იყოს სასრული რიცხვი, 0 ან მეტი +@msg File.seek: the position must be a finite number File.seek: პოზიცია უნდა იყოს სასრული რიცხვი +@msg File.seek: the mode must be 0, 1 or 2 File.seek: რეჟიმი უნდა იყოს 0, 1 ან 2 +@msg script file is compiled: {value} სკრიპტის ფაილი კომპილირებულია: {value} +@msg `name` must be the name of a script engine `name` უნდა იყოს სკრიპტის ძრავის სახელი +@msg the main script engine is new for each run and is never kept, so it cannot be dropped მთავარი სკრიპტის ძრავა ყოველი გაშვებისთვის ახალია და არასოდეს ინახება, ამიტომ მისი მოცილება შეუძლებელია +@msg there is no script engine named {name} სკრიპტის ძრავა სახელით {name} არ არსებობს @msg Running a script სკრიპტი მუშაობს @msg Copied the script report კოპირებულია სკრიპტის ანგარიში @msg Offset Path: the offset leaves nothing of the selected paths (an inset larger than the shapes) ტრაექტორიის წანაცვლება: წანაცვლების შემდეგ მონიშნული ტრაექტორიებიდან არაფერი რჩება (შიგნით წანაცვლება ფიგურებზე დიდია) diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index b10632963f..2b33486cbd 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -4938,6 +4938,85 @@ theme Appearance 외관 @msg the script's run is no longer available 스크립트 실행을 더 이상 사용할 수 없습니다 @msg a failed command changed undo steps that could not be put back, so the script was stopped 실패한 명령이 되돌릴 수 없는 실행 취소 단계를 변경하여 스크립트를 중지했습니다 @msg a recovery copy could not be written, so the script was not run 복구 사본을 쓸 수 없어 스크립트를 실행하지 않았습니다 +@msg Script file access denied 스크립트 파일 접근이 거부되었습니다 +@msg Script file exceeds 8 MiB 스크립트 파일이 8 MiB를 초과합니다 +@msg Script file is not open 스크립트 파일이 열려 있지 않습니다 +@msg Script file cannot be decoded 스크립트 파일을 디코딩할 수 없습니다 +@msg Script file is not a regular file 스크립트 파일이 일반 파일이 아닙니다 +@msg Script file does not exist 스크립트 파일이 없습니다 +@msg Script file could not be read 스크립트 파일을 읽을 수 없습니다 +@msg Script folder has more than 2,048 entries 스크립트 폴더의 항목이 2,048개를 초과합니다 +@msg Script file open mode must be r, w, e or a 스크립트 파일 열기 모드는 r, w, e 또는 a여야 합니다 +@msg Script file writing is not available 스크립트 파일 쓰기를 사용할 수 없습니다 +@msg Script file dialogs are not available 스크립트 파일 대화 상자를 사용할 수 없습니다 +@msg Script files cannot be opened in another application 스크립트 파일을 다른 응용 프로그램에서 열 수 없습니다 +@msg Script file access is unavailable on the web 웹에서는 스크립트 파일에 접근할 수 없습니다 +@msg Script has 256 files open 스크립트가 파일 256개를 열고 있습니다 +@msg Script file path exceeds 32,767 characters 스크립트 파일 경로가 32,767자를 초과합니다 +@msg Script folder mask takes too many steps to match 스크립트 폴더 마스크를 일치시키는 데 단계가 너무 많이 필요합니다 +@msg the script opened more file data than one run may open (32 MiB) 스크립트가 한 번의 실행에서 열 수 있는 것보다 많은 파일 데이터를 열었습니다(32 MiB) +@msg File.seek: takes a position and a mode File.seek: 위치와 모드를 받습니다 +@msg vc.run: give a command id, as a string vc.run: 명령 id를 문자열로 지정하세요 +@msg vc.run: takes a command id and an object of parameters vc.run: 명령 id와 매개변수 객체를 받습니다 +@msg vc.run: the parameters must be an object vc.run: 매개변수는 객체여야 합니다 +@msg vc.run: the result{place} is too large for a script vc.run: 결과{place}이(가) 스크립트에 비해 너무 큽니다 +@msg $.evalFile requires a file path $.evalFile에는 파일 경로가 필요합니다 +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: 시간 제한은 0 이상의 유한한 밀리초 수여야 합니다 +@msg $.evalFile: takes a file path and a timeout $.evalFile: 파일 경로와 시간 제한을 받습니다 +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: {file}의 {line}행 {column}열: {e} (발생) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: {line}행 {column}열: {e} (발생) +@msg {name}: {e} (thrown) {name}: {e} (발생) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: {file}의 {line}행 {column}열: {e} (제한) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: {line}행 {column}열: {e} (제한) +@msg {name}: {e} (limit) {name}: {e} (제한) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: {file}의 {line}행 {column}열: {e} (구문 오류) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: {line}행 {column}열: {e} (구문 오류) +@msg {name}: {e} (syntax) {name}: {e} (구문 오류) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: {file}의 {line}행 {column}열: {e} (중지됨) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: {line}행 {column}열: {e} (중지됨) +@msg {name}: {e} (stopped) {name}: {e} (중지됨) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: {file}의 {line}행 {column}열: {e} (내부 오류) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: {line}행 {column}열: {e} (내부 오류) +@msg {name}: {e} (internal) {name}: {e} (내부 오류) +@msg {e} (these files stay written: {paths}) {e} (이 파일은 쓰인 상태로 남습니다: {paths}) +@msg $.{name}: give a name, as a string $.{name}: 이름을 문자열로 지정하세요 +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: "en" 또는 "de_DE" 같은 로캘을 지정하거나, 인터페이스 로캘에는 null을 지정하세요 +@msg $.localize: give true or false $.localize: true 또는 false를 지정하세요 +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: 현지화를 켜는 512 또는 0만 설정할 수 있습니다 +@msg $.flags: give a number $.flags: 숫자를 지정하세요 +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: 여기서 스크립트는 UTF-8만 읽고 씁니다 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: 인코딩 이름을 문자열로 지정하세요 +@msg $.memCache: the memory cache size cannot be set $.memCache: 메모리 캐시 크기는 설정할 수 없습니다 +@msg $.setenv: give a value, as a string $.setenv: 값을 문자열로 지정하세요 +@msg $.setenv: only {_1} can be set $.setenv: {_1}만 설정할 수 있습니다 +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: 값은 최대 {MAX_ENV_BYTES}자의 문자, 숫자 및 _ . - @입니다 +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: 0부터 {MAX_SLEEP_MS}까지의 밀리초 수를 지정하세요 +@msg $.sleep: give a number of milliseconds $.sleep: 밀리초 수를 지정하세요 +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: 기본 제공 함수의 콜백, getter, 변환 또는 $.evalFile이 실행하는 파일 안에서는 실행이 기다릴 수 없습니다. 스크립트 자체 코드에서 호출하세요 +@msg $.bp: scripts here have no debugger $.bp: 여기서는 스크립트에 디버거가 없습니다 +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: 스크립트는 아직 대화 상자를 표시할 수 없습니다 +@msg {name}: give a message {name}: 메시지를 지정하세요 +@msg {name}: give the text the field starts with {name}: 필드의 시작 텍스트를 지정하세요 +@msg {name}: the message is longer than 16 KiB {name}: 메시지가 16 KiB보다 깁니다 +@msg {name}: the title is longer than 256 bytes {name}: 제목이 256바이트보다 깁니다 +@msg {name}: the text the field starts with is longer than 16 KiB {name}: 필드의 시작 텍스트가 16 KiB보다 깁니다 +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: 기본 제공 함수의 콜백, getter, 변환 또는 $.evalFile이 실행하는 파일 안에서는 대화 상자를 열 수 없습니다. 스크립트 자체 코드에서 호출하세요 +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: `answers`의 다음 답은 {name}이(가) 아니라 {_1}에 대한 것입니다 +@msg {name}: `answers` has no answer left for this dialog {name}: `answers`에 이 대화 상자에 대한 답이 남아 있지 않습니다 +@msg vc.document{place} is too large for a script vc.document{place}이(가) 스크립트에 비해 너무 큽니다 +@msg vc.log: the log of this run is full vc.log: 이 실행의 로그가 가득 찼습니다 +@msg this function's script run has ended 이 함수의 스크립트 실행이 끝났습니다 +@msg the script made more host calls than one run may make 스크립트가 한 번의 실행에 허용된 것보다 많은 호스트 호출을 했습니다 +@msg the script passed more data to and from commands than one run may pass 스크립트가 한 번의 실행에 허용된 것보다 많은 데이터를 명령과 주고받았습니다 +@msg the script added more objects and data to the documents than one run may add 스크립트가 한 번의 실행에 허용된 것보다 많은 객체와 데이터를 문서에 추가했습니다 +@msg {what}: the object is not a File or a Folder {what}: 객체가 File도 Folder도 아닙니다 +@msg {what}: the count must be a finite number, 0 or more {what}: 개수는 0 이상의 유한한 숫자여야 합니다 +@msg File.seek: the position must be a finite number File.seek: 위치는 유한한 숫자여야 합니다 +@msg File.seek: the mode must be 0, 1 or 2 File.seek: 모드는 0, 1 또는 2여야 합니다 +@msg script file is compiled: {value} 스크립트 파일이 컴파일되어 있습니다: {value} +@msg `name` must be the name of a script engine `name`은(는) 스크립트 엔진의 이름이어야 합니다 +@msg the main script engine is new for each run and is never kept, so it cannot be dropped 기본 스크립트 엔진은 실행마다 새로 만들어지고 유지되지 않으므로 삭제할 수 없습니다 +@msg there is no script engine named {name} 이름이 {name}인 스크립트 엔진이 없습니다 @msg Running a script 스크립트 실행 중 @msg Copied the script report 스크립트 보고서를 복사했습니다 @msg Exported {path} {path}을(를) 내보냈습니다 diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 2eca92f56b..91f49805d4 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4344,6 +4344,85 @@ imageTrace Outline Kontur @msg the script's run is no longer available uruchomienie skryptu nie jest już dostępne @msg a failed command changed undo steps that could not be put back, so the script was stopped nieudane polecenie zmieniło kroki cofania, których nie udało się przywrócić, więc skrypt został zatrzymany @msg a recovery copy could not be written, so the script was not run nie udało się zapisać kopii odzyskiwania, więc skrypt nie został uruchomiony +@msg Script file access denied Odmowa dostępu do pliku skryptu +@msg Script file exceeds 8 MiB Plik skryptu przekracza 8 MiB +@msg Script file is not open Plik skryptu nie jest otwarty +@msg Script file cannot be decoded Nie można zdekodować pliku skryptu +@msg Script file is not a regular file Plik skryptu nie jest zwykłym plikiem +@msg Script file does not exist Plik skryptu nie istnieje +@msg Script file could not be read Nie udało się odczytać pliku skryptu +@msg Script folder has more than 2,048 entries Folder skryptu ma więcej niż 2048 pozycji +@msg Script file open mode must be r, w, e or a Tryb otwarcia pliku skryptu musi być r, w, e lub a +@msg Script file writing is not available Zapisywanie plików skryptu jest niedostępne +@msg Script file dialogs are not available Okna dialogowe plików skryptu są niedostępne +@msg Script files cannot be opened in another application Plików skryptu nie można otworzyć w innej aplikacji +@msg Script file access is unavailable on the web Dostęp do plików skryptu jest niedostępny w przeglądarce +@msg Script has 256 files open Skrypt ma otwartych 256 plików +@msg Script file path exceeds 32,767 characters Ścieżka pliku skryptu przekracza 32 767 znaków +@msg Script folder mask takes too many steps to match Dopasowanie maski folderu skryptu wymaga zbyt wielu kroków +@msg the script opened more file data than one run may open (32 MiB) skrypt otworzył więcej danych plików, niż może otworzyć jedno uruchomienie (32 MiB) +@msg File.seek: takes a position and a mode File.seek: przyjmuje pozycję i tryb +@msg vc.run: give a command id, as a string vc.run: podaj identyfikator polecenia jako ciąg znaków +@msg vc.run: takes a command id and an object of parameters vc.run: przyjmuje identyfikator polecenia i obiekt parametrów +@msg vc.run: the parameters must be an object vc.run: parametry muszą być obiektem +@msg vc.run: the result{place} is too large for a script vc.run: wynik{place} jest za duży dla skryptu +@msg $.evalFile requires a file path $.evalFile wymaga ścieżki pliku +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: limit czasu musi być skończoną liczbą milisekund, 0 lub więcej +@msg $.evalFile: takes a file path and a timeout $.evalFile: przyjmuje ścieżkę pliku i limit czasu +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: wiersz {line}, kolumna {column} w {file}: {e} (zgłoszony wyjątek) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: wiersz {line}, kolumna {column}: {e} (zgłoszony wyjątek) +@msg {name}: {e} (thrown) {name}: {e} (zgłoszony wyjątek) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: wiersz {line}, kolumna {column} w {file}: {e} (ograniczenie) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: wiersz {line}, kolumna {column}: {e} (ograniczenie) +@msg {name}: {e} (limit) {name}: {e} (ograniczenie) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: wiersz {line}, kolumna {column} w {file}: {e} (błąd składni) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: wiersz {line}, kolumna {column}: {e} (błąd składni) +@msg {name}: {e} (syntax) {name}: {e} (błąd składni) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: wiersz {line}, kolumna {column} w {file}: {e} (zatrzymany) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: wiersz {line}, kolumna {column}: {e} (zatrzymany) +@msg {name}: {e} (stopped) {name}: {e} (zatrzymany) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: wiersz {line}, kolumna {column} w {file}: {e} (błąd wewnętrzny) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: wiersz {line}, kolumna {column}: {e} (błąd wewnętrzny) +@msg {name}: {e} (internal) {name}: {e} (błąd wewnętrzny) +@msg {e} (these files stay written: {paths}) {e} (te pliki pozostają zapisane: {paths}) +@msg $.{name}: give a name, as a string $.{name}: podaj nazwę jako ciąg znaków +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: podaj ustawienia regionalne, takie jak "en" lub "de_DE", albo null dla ustawień interfejsu +@msg $.localize: give true or false $.localize: podaj true lub false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: można ustawić tylko 512, które włącza lokalizację, albo 0 +@msg $.flags: give a number $.flags: podaj liczbę +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: skrypty odczytują i zapisują tu tylko UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: podaj nazwę kodowania jako ciąg znaków +@msg $.memCache: the memory cache size cannot be set $.memCache: nie można ustawić rozmiaru pamięci podręcznej +@msg $.setenv: give a value, as a string $.setenv: podaj wartość jako ciąg znaków +@msg $.setenv: only {_1} can be set $.setenv: można ustawić tylko {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: wartość ma najwyżej {MAX_ENV_BYTES} liter, cyfr i znaków _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: podaj liczbę milisekund od 0 do {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: podaj liczbę milisekund +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: uruchomienie nie może czekać w wywołaniu zwrotnym funkcji wbudowanej, getterze, konwersji ani pliku uruchamianym przez $.evalFile; wywołaj ją z własnego kodu skryptu +@msg $.bp: scripts here have no debugger $.bp: skrypty nie mają tu debugera +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: skrypty nie mogą jeszcze wyświetlać okna dialogowego +@msg {name}: give a message {name}: podaj komunikat +@msg {name}: give the text the field starts with {name}: podaj tekst, od którego zaczyna się pole +@msg {name}: the message is longer than 16 KiB {name}: komunikat jest dłuższy niż 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: tytuł jest dłuższy niż 256 bajtów +@msg {name}: the text the field starts with is longer than 16 KiB {name}: tekst, od którego zaczyna się pole, jest dłuższy niż 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: okno dialogowe nie może się otworzyć w wywołaniu zwrotnym funkcji wbudowanej, getterze, konwersji ani pliku uruchamianym przez $.evalFile; wywołaj je z własnego kodu skryptu +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: następna odpowiedź w `answers` jest dla {_1}, nie dla {name} +@msg {name}: `answers` has no answer left for this dialog {name}: w `answers` nie została żadna odpowiedź dla tego okna dialogowego +@msg vc.document{place} is too large for a script vc.document{place} jest za duży dla skryptu +@msg vc.log: the log of this run is full vc.log: dziennik tego uruchomienia jest pełny +@msg this function's script run has ended uruchomienie skryptu tej funkcji zakończyło się +@msg the script made more host calls than one run may make skrypt wykonał więcej wywołań hosta, niż może wykonać jedno uruchomienie +@msg the script passed more data to and from commands than one run may pass skrypt przekazał do poleceń i z poleceń więcej danych, niż może przekazać jedno uruchomienie +@msg the script added more objects and data to the documents than one run may add skrypt dodał do dokumentów więcej obiektów i danych, niż może dodać jedno uruchomienie +@msg {what}: the object is not a File or a Folder {what}: obiekt nie jest ani File, ani Folder +@msg {what}: the count must be a finite number, 0 or more {what}: liczba musi być liczbą skończoną, 0 lub większą +@msg File.seek: the position must be a finite number File.seek: pozycja musi być liczbą skończoną +@msg File.seek: the mode must be 0, 1 or 2 File.seek: tryb musi wynosić 0, 1 lub 2 +@msg script file is compiled: {value} plik skryptu jest skompilowany: {value} +@msg `name` must be the name of a script engine `name` musi być nazwą silnika skryptów +@msg the main script engine is new for each run and is never kept, so it cannot be dropped główny silnik skryptów jest nowy przy każdym uruchomieniu i nigdy nie jest zachowywany, więc nie można go usunąć +@msg there is no script engine named {name} nie ma silnika skryptów o nazwie {name} @msg Running a script Uruchamianie skryptu @msg Copied the script report Skopiowano raport skryptu @msg Corners edits the corners of a path Narożniki edytuje narożniki ścieżki diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 24a3db3fe0..fad4d85d3c 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -5218,6 +5218,85 @@ axis Both Ambos @msg the script's run is no longer available a execução do script não está mais disponível @msg a failed command changed undo steps that could not be put back, so the script was stopped um comando que falhou alterou etapas de desfazer que não puderam ser restauradas, então o script foi interrompido @msg a recovery copy could not be written, so the script was not run não foi possível gravar uma cópia de recuperação, portanto o script não foi executado +@msg Script file access denied Acesso ao arquivo de script negado +@msg Script file exceeds 8 MiB O arquivo de script excede 8 MiB +@msg Script file is not open O arquivo de script não está aberto +@msg Script file cannot be decoded Não é possível decodificar o arquivo de script +@msg Script file is not a regular file O arquivo de script não é um arquivo comum +@msg Script file does not exist O arquivo de script não existe +@msg Script file could not be read Não foi possível ler o arquivo de script +@msg Script folder has more than 2,048 entries A pasta de script tem mais de 2.048 entradas +@msg Script file open mode must be r, w, e or a O modo de abertura do arquivo de script deve ser r, w, e ou a +@msg Script file writing is not available A gravação de arquivos de script não está disponível +@msg Script file dialogs are not available As caixas de diálogo de arquivos de script não estão disponíveis +@msg Script files cannot be opened in another application Arquivos de script não podem ser abertos em outro aplicativo +@msg Script file access is unavailable on the web O acesso a arquivos de script não está disponível na web +@msg Script has 256 files open O script tem 256 arquivos abertos +@msg Script file path exceeds 32,767 characters O caminho do arquivo de script excede 32.767 caracteres +@msg Script folder mask takes too many steps to match A máscara de pasta de script exige etapas demais para corresponder +@msg the script opened more file data than one run may open (32 MiB) o script abriu mais dados de arquivo do que uma execução pode abrir (32 MiB) +@msg File.seek: takes a position and a mode File.seek: recebe uma posição e um modo +@msg vc.run: give a command id, as a string vc.run: informe um id de comando, como string +@msg vc.run: takes a command id and an object of parameters vc.run: recebe um id de comando e um objeto de parâmetros +@msg vc.run: the parameters must be an object vc.run: os parâmetros devem ser um objeto +@msg vc.run: the result{place} is too large for a script vc.run: o resultado{place} é grande demais para um script +@msg $.evalFile requires a file path $.evalFile requer um caminho de arquivo +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: o tempo limite deve ser um número finito de milissegundos, 0 ou mais +@msg $.evalFile: takes a file path and a timeout $.evalFile: recebe um caminho de arquivo e um tempo limite +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: linha {line}, coluna {column} de {file}: {e} (lançado) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: linha {line}, coluna {column}: {e} (lançado) +@msg {name}: {e} (thrown) {name}: {e} (lançado) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: linha {line}, coluna {column} de {file}: {e} (limite) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: linha {line}, coluna {column}: {e} (limite) +@msg {name}: {e} (limit) {name}: {e} (limite) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: linha {line}, coluna {column} de {file}: {e} (erro de sintaxe) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: linha {line}, coluna {column}: {e} (erro de sintaxe) +@msg {name}: {e} (syntax) {name}: {e} (erro de sintaxe) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: linha {line}, coluna {column} de {file}: {e} (interrompido) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: linha {line}, coluna {column}: {e} (interrompido) +@msg {name}: {e} (stopped) {name}: {e} (interrompido) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: linha {line}, coluna {column} de {file}: {e} (erro interno) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: linha {line}, coluna {column}: {e} (erro interno) +@msg {name}: {e} (internal) {name}: {e} (erro interno) +@msg {e} (these files stay written: {paths}) {e} (estes arquivos continuam gravados: {paths}) +@msg $.{name}: give a name, as a string $.{name}: informe um nome, como string +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: informe uma localidade como "en" ou "de_DE", ou null para a da interface +@msg $.localize: give true or false $.localize: informe true ou false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: só é possível definir 512, que ativa a localização, ou 0 +@msg $.flags: give a number $.flags: informe um número +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: aqui os scripts só leem e gravam UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: informe o nome de uma codificação, como string +@msg $.memCache: the memory cache size cannot be set $.memCache: o tamanho do cache de memória não pode ser definido +@msg $.setenv: give a value, as a string $.setenv: informe um valor, como string +@msg $.setenv: only {_1} can be set $.setenv: só é possível definir {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: um valor tem no máximo {MAX_ENV_BYTES} letras, dígitos e _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: informe um número de milissegundos de 0 a {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: informe um número de milissegundos +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: uma execução não pode esperar dentro de um callback de uma função interna, um getter, uma conversão ou um arquivo que $.evalFile executa; chame-a a partir do próprio código do script +@msg $.bp: scripts here have no debugger $.bp: aqui os scripts não têm depurador +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: os scripts ainda não podem mostrar uma caixa de diálogo +@msg {name}: give a message {name}: informe uma mensagem +@msg {name}: give the text the field starts with {name}: informe o texto com que o campo começa +@msg {name}: the message is longer than 16 KiB {name}: a mensagem tem mais de 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: o título tem mais de 256 bytes +@msg {name}: the text the field starts with is longer than 16 KiB {name}: o texto com que o campo começa tem mais de 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: uma caixa de diálogo não pode abrir dentro de um callback de uma função interna, um getter, uma conversão ou um arquivo que $.evalFile executa; chame-a a partir do próprio código do script +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: a próxima resposta em `answers` é para {_1}, não para {name} +@msg {name}: `answers` has no answer left for this dialog {name}: `answers` não tem mais respostas para esta caixa de diálogo +@msg vc.document{place} is too large for a script vc.document{place} é grande demais para um script +@msg vc.log: the log of this run is full vc.log: o registro desta execução está cheio +@msg this function's script run has ended a execução do script desta função terminou +@msg the script made more host calls than one run may make o script fez mais chamadas ao host do que uma execução pode fazer +@msg the script passed more data to and from commands than one run may pass o script passou mais dados para os comandos e a partir deles do que uma execução pode passar +@msg the script added more objects and data to the documents than one run may add o script adicionou aos documentos mais objetos e dados do que uma execução pode adicionar +@msg {what}: the object is not a File or a Folder {what}: o objeto não é um File nem um Folder +@msg {what}: the count must be a finite number, 0 or more {what}: a contagem deve ser um número finito, 0 ou mais +@msg File.seek: the position must be a finite number File.seek: a posição deve ser um número finito +@msg File.seek: the mode must be 0, 1 or 2 File.seek: o modo deve ser 0, 1 ou 2 +@msg script file is compiled: {value} o arquivo de script está compilado: {value} +@msg `name` must be the name of a script engine `name` deve ser o nome de um mecanismo de script +@msg the main script engine is new for each run and is never kept, so it cannot be dropped o mecanismo de script principal é novo a cada execução e nunca é mantido, por isso não pode ser descartado +@msg there is no script engine named {name} não há nenhum mecanismo de script chamado {name} @msg Running a script Executando um script @msg Copied the script report Relatório do script copiado @msg This shortcut file is in a form VectorCraft can't read. Este arquivo de atalhos está em um formato que o VectorCraft não consegue ler. diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 0c0c0bb1f0..c8f74c6636 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -4248,6 +4248,85 @@ axis Both Оба @msg the script's run is no longer available выполнение скрипта больше недоступно @msg a failed command changed undo steps that could not be put back, so the script was stopped неудавшаяся команда изменила шаги отмены, которые не удалось восстановить, поэтому скрипт остановлен @msg a recovery copy could not be written, so the script was not run не удалось записать копию для восстановления, поэтому скрипт не выполнен +@msg Script file access denied Доступ к файлу скрипта запрещен +@msg Script file exceeds 8 MiB Файл скрипта больше 8 МиБ +@msg Script file is not open Файл скрипта не открыт +@msg Script file cannot be decoded Не удается декодировать файл скрипта +@msg Script file is not a regular file Файл скрипта не является обычным файлом +@msg Script file does not exist Файл скрипта не существует +@msg Script file could not be read Не удалось прочитать файл скрипта +@msg Script folder has more than 2,048 entries В папке скрипта больше 2048 элементов +@msg Script file open mode must be r, w, e or a Режим открытия файла скрипта должен быть r, w, e или a +@msg Script file writing is not available Запись файлов скрипта недоступна +@msg Script file dialogs are not available Диалоговые окна файлов скрипта недоступны +@msg Script files cannot be opened in another application Файлы скрипта нельзя открыть в другом приложении +@msg Script file access is unavailable on the web Доступ к файлам скрипта в веб-версии недоступен +@msg Script has 256 files open У скрипта открыто 256 файлов +@msg Script file path exceeds 32,767 characters Путь к файлу скрипта длиннее 32 767 символов +@msg Script folder mask takes too many steps to match Сопоставление маски папки скрипта требует слишком много шагов +@msg the script opened more file data than one run may open (32 MiB) скрипт открыл больше данных файлов, чем может открыть один запуск (32 МиБ) +@msg File.seek: takes a position and a mode File.seek: принимает позицию и режим +@msg vc.run: give a command id, as a string vc.run: укажите идентификатор команды в виде строки +@msg vc.run: takes a command id and an object of parameters vc.run: принимает идентификатор команды и объект параметров +@msg vc.run: the parameters must be an object vc.run: параметры должны быть объектом +@msg vc.run: the result{place} is too large for a script vc.run: результат{place} слишком велик для скрипта +@msg $.evalFile requires a file path $.evalFile требует путь к файлу +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: тайм-аут должен быть конечным числом миллисекунд, 0 или больше +@msg $.evalFile: takes a file path and a timeout $.evalFile: принимает путь к файлу и тайм-аут +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: строка {line}, столбец {column} в {file}: {e} (исключение) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: строка {line}, столбец {column}: {e} (исключение) +@msg {name}: {e} (thrown) {name}: {e} (исключение) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: строка {line}, столбец {column} в {file}: {e} (ограничение) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: строка {line}, столбец {column}: {e} (ограничение) +@msg {name}: {e} (limit) {name}: {e} (ограничение) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: строка {line}, столбец {column} в {file}: {e} (синтаксическая ошибка) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: строка {line}, столбец {column}: {e} (синтаксическая ошибка) +@msg {name}: {e} (syntax) {name}: {e} (синтаксическая ошибка) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: строка {line}, столбец {column} в {file}: {e} (остановлен) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: строка {line}, столбец {column}: {e} (остановлен) +@msg {name}: {e} (stopped) {name}: {e} (остановлен) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: строка {line}, столбец {column} в {file}: {e} (внутренняя ошибка) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: строка {line}, столбец {column}: {e} (внутренняя ошибка) +@msg {name}: {e} (internal) {name}: {e} (внутренняя ошибка) +@msg {e} (these files stay written: {paths}) {e} (эти файлы остаются записанными: {paths}) +@msg $.{name}: give a name, as a string $.{name}: укажите имя в виде строки +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: укажите локаль, например "en" или "de_DE", или null для локали интерфейса +@msg $.localize: give true or false $.localize: укажите true или false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: можно установить только 512, которое включает локализацию, или 0 +@msg $.flags: give a number $.flags: укажите число +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: здесь скрипты читают и записывают только UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: укажите имя кодировки в виде строки +@msg $.memCache: the memory cache size cannot be set $.memCache: размер кэша памяти нельзя установить +@msg $.setenv: give a value, as a string $.setenv: укажите значение в виде строки +@msg $.setenv: only {_1} can be set $.setenv: можно установить только {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: значение содержит не более {MAX_ENV_BYTES} букв, цифр и знаков _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: укажите число миллисекунд от 0 до {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: укажите число миллисекунд +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: запуск не может ждать внутри обратного вызова встроенной функции, геттера, преобразования или файла, который выполняет $.evalFile; вызовите её из собственного кода скрипта +@msg $.bp: scripts here have no debugger $.bp: здесь у скриптов нет отладчика +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: скрипты пока не могут показывать диалоговое окно +@msg {name}: give a message {name}: укажите сообщение +@msg {name}: give the text the field starts with {name}: укажите текст, с которого начинается поле +@msg {name}: the message is longer than 16 KiB {name}: сообщение длиннее 16 КиБ +@msg {name}: the title is longer than 256 bytes {name}: заголовок длиннее 256 байт +@msg {name}: the text the field starts with is longer than 16 KiB {name}: текст, с которого начинается поле, длиннее 16 КиБ +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: диалоговое окно не может открыться внутри обратного вызова встроенной функции, геттера, преобразования или файла, который выполняет $.evalFile; вызовите его из собственного кода скрипта +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: следующий ответ в `answers` предназначен для {_1}, а не для {name} +@msg {name}: `answers` has no answer left for this dialog {name}: в `answers` не осталось ответа для этого диалогового окна +@msg vc.document{place} is too large for a script vc.document{place} слишком велик для скрипта +@msg vc.log: the log of this run is full vc.log: журнал этого запуска заполнен +@msg this function's script run has ended запуск скрипта этой функции завершён +@msg the script made more host calls than one run may make скрипт сделал больше вызовов хоста, чем разрешено одному запуску +@msg the script passed more data to and from commands than one run may pass скрипт передал командам и получил от них больше данных, чем разрешено одному запуску +@msg the script added more objects and data to the documents than one run may add скрипт добавил в документы больше объектов и данных, чем разрешено одному запуску +@msg {what}: the object is not a File or a Folder {what}: объект не является ни File, ни Folder +@msg {what}: the count must be a finite number, 0 or more {what}: количество должно быть конечным числом, 0 или больше +@msg File.seek: the position must be a finite number File.seek: позиция должна быть конечным числом +@msg File.seek: the mode must be 0, 1 or 2 File.seek: режим должен быть 0, 1 или 2 +@msg script file is compiled: {value} файл скрипта скомпилирован: {value} +@msg `name` must be the name of a script engine `name` должно быть именем движка скриптов +@msg the main script engine is new for each run and is never kept, so it cannot be dropped основной движок скриптов создаётся заново для каждого запуска и никогда не сохраняется, поэтому его нельзя удалить +@msg there is no script engine named {name} движка скриптов с именем {name} нет @msg Running a script Выполняется скрипт @msg Copied the script report Отчёт о сценарии скопирован @msg Corners edits the corners of a path «Углы» редактирует углы контура diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 911f406a57..1b8845df14 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -4121,6 +4121,85 @@ axis Both Båda @msg the script's run is no longer available skriptets körning är inte längre tillgänglig @msg a failed command changed undo steps that could not be put back, so the script was stopped ett misslyckat kommando ändrade ångrasteg som inte kunde återställas, så skriptet stoppades @msg a recovery copy could not be written, so the script was not run en återställningskopia kunde inte skrivas, så skriptet kördes inte +@msg Script file access denied Åtkomst till skriptfilen nekades +@msg Script file exceeds 8 MiB Skriptfilen är större än 8 MiB +@msg Script file is not open Skriptfilen är inte öppen +@msg Script file cannot be decoded Skriptfilen kan inte avkodas +@msg Script file is not a regular file Skriptfilen är inte en vanlig fil +@msg Script file does not exist Skriptfilen finns inte +@msg Script file could not be read Skriptfilen kunde inte läsas +@msg Script folder has more than 2,048 entries Skriptmappen har fler än 2 048 poster +@msg Script file open mode must be r, w, e or a Skriptfilens öppningsläge måste vara r, w, e eller a +@msg Script file writing is not available Skrivning av skriptfiler är inte tillgänglig +@msg Script file dialogs are not available Fildialogrutor för skript är inte tillgängliga +@msg Script files cannot be opened in another application Skriptfiler kan inte öppnas i ett annat program +@msg Script file access is unavailable on the web Åtkomst till skriptfiler är inte tillgänglig på webben +@msg Script has 256 files open Skriptet har 256 filer öppna +@msg Script file path exceeds 32,767 characters Skriptfilens sökväg är längre än 32 767 tecken +@msg Script folder mask takes too many steps to match Skriptmappens mask kräver för många steg för att matcha +@msg the script opened more file data than one run may open (32 MiB) skriptet öppnade mer fildata än en körning får öppna (32 MiB) +@msg File.seek: takes a position and a mode File.seek: tar en position och ett läge +@msg vc.run: give a command id, as a string vc.run: ange ett kommando-id som en sträng +@msg vc.run: takes a command id and an object of parameters vc.run: tar ett kommando-id och ett objekt med parametrar +@msg vc.run: the parameters must be an object vc.run: parametrarna måste vara ett objekt +@msg vc.run: the result{place} is too large for a script vc.run: resultatet{place} är för stort för ett skript +@msg $.evalFile requires a file path $.evalFile kräver en filsökväg +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: tidsgränsen måste vara ett ändligt antal millisekunder, 0 eller mer +@msg $.evalFile: takes a file path and a timeout $.evalFile: tar en filsökväg och en tidsgräns +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: rad {line}, kolumn {column} i {file}: {e} (kastat) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: rad {line}, kolumn {column}: {e} (kastat) +@msg {name}: {e} (thrown) {name}: {e} (kastat) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: rad {line}, kolumn {column} i {file}: {e} (gräns) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: rad {line}, kolumn {column}: {e} (gräns) +@msg {name}: {e} (limit) {name}: {e} (gräns) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: rad {line}, kolumn {column} i {file}: {e} (syntaxfel) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: rad {line}, kolumn {column}: {e} (syntaxfel) +@msg {name}: {e} (syntax) {name}: {e} (syntaxfel) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: rad {line}, kolumn {column} i {file}: {e} (stoppat) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: rad {line}, kolumn {column}: {e} (stoppat) +@msg {name}: {e} (stopped) {name}: {e} (stoppat) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: rad {line}, kolumn {column} i {file}: {e} (internt fel) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: rad {line}, kolumn {column}: {e} (internt fel) +@msg {name}: {e} (internal) {name}: {e} (internt fel) +@msg {e} (these files stay written: {paths}) {e} (dessa filer förblir skrivna: {paths}) +@msg $.{name}: give a name, as a string $.{name}: ange ett namn som en sträng +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: ange en språkinställning som "en" eller "de_DE", eller null för gränssnittets +@msg $.localize: give true or false $.localize: ange true eller false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: endast 512, som slår på lokalisering, eller 0 kan anges +@msg $.flags: give a number $.flags: ange ett tal +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: skript läser och skriver här endast UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: ange namnet på en kodning som en sträng +@msg $.memCache: the memory cache size cannot be set $.memCache: minnescachens storlek kan inte anges +@msg $.setenv: give a value, as a string $.setenv: ange ett värde som en sträng +@msg $.setenv: only {_1} can be set $.setenv: endast {_1} kan anges +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: ett värde har högst {MAX_ENV_BYTES} bokstäver, siffror och _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: ange ett antal millisekunder från 0 till {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: ange ett antal millisekunder +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: en körning kan inte vänta i ett återanrop från en inbyggd funktion, en getter, en konvertering eller en fil som $.evalFile kör; anropa den från skriptets egen kod +@msg $.bp: scripts here have no debugger $.bp: skript har ingen felsökare här +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: skript kan inte visa en dialogruta ännu +@msg {name}: give a message {name}: ange ett meddelande +@msg {name}: give the text the field starts with {name}: ange texten som fältet börjar med +@msg {name}: the message is longer than 16 KiB {name}: meddelandet är längre än 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: rubriken är längre än 256 byte +@msg {name}: the text the field starts with is longer than 16 KiB {name}: texten som fältet börjar med är längre än 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: en dialogruta kan inte öppnas i ett återanrop från en inbyggd funktion, en getter, en konvertering eller en fil som $.evalFile kör; anropa den från skriptets egen kod +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: nästa svar i `answers` gäller {_1}, inte {name} +@msg {name}: `answers` has no answer left for this dialog {name}: `answers` har inget svar kvar för den här dialogrutan +@msg vc.document{place} is too large for a script vc.document{place} är för stort för ett skript +@msg vc.log: the log of this run is full vc.log: loggen för den här körningen är full +@msg this function's script run has ended skriptkörningen för den här funktionen har avslutats +@msg the script made more host calls than one run may make skriptet gjorde fler värdanrop än en körning får göra +@msg the script passed more data to and from commands than one run may pass skriptet skickade mer data till och från kommandon än en körning får skicka +@msg the script added more objects and data to the documents than one run may add skriptet lade till fler objekt och mer data i dokumenten än en körning får lägga till +@msg {what}: the object is not a File or a Folder {what}: objektet är varken en File eller en Folder +@msg {what}: the count must be a finite number, 0 or more {what}: antalet måste vara ett ändligt tal, 0 eller mer +@msg File.seek: the position must be a finite number File.seek: positionen måste vara ett ändligt tal +@msg File.seek: the mode must be 0, 1 or 2 File.seek: läget måste vara 0, 1 eller 2 +@msg script file is compiled: {value} skriptfilen är kompilerad: {value} +@msg `name` must be the name of a script engine `name` måste vara namnet på en skriptmotor +@msg the main script engine is new for each run and is never kept, so it cannot be dropped huvudskriptmotorn är ny för varje körning och sparas aldrig, så den kan inte tas bort +@msg there is no script engine named {name} det finns ingen skriptmotor med namnet {name} @msg Running a script Kör ett skript @msg Copied the script report Kopierade skriptrapporten @msg Corners edits the corners of a path Hörn redigerar hörnen på en bana diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index fded4ba9f6..887eb4253b 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -1754,6 +1754,23 @@ fn package_status_message_templates_parse() { assert!(Catalog::parse("@msg\tPackaged {n} file(s) in {folder}{note}\tbad\n").message("Packaged 1 file(s) in /a b").is_none()); } +/// A placeholder that occurs twice in a template matches the same text both times, so a template +/// that ends with the name it starts with does not swallow a line that wraps its message. +#[test] +fn a_repeated_placeholder_matches_the_same_text() { + let c = Catalog::parse(concat!( + "@msg\t{name}: the next answer is for {_1}, not {name}\tnext {name} {_1}\n", + "@msg\t{file}: line {line}: {e} (thrown)\tthrown {file} {line} {e}\n", + )); + let (form, caps) = c.message("confirm: the next answer is for prompt, not confirm").expect("matches"); + assert_eq!((form, caps), ("next {name} {_1}", vec![("name", "confirm"), ("_1", "prompt"), ("name", "confirm")])); + let line = "t.js: line 3: Error: confirm: the next answer is for prompt, not confirm (thrown)"; + let (form, caps) = c.message(line).expect("matches"); + assert_eq!(form, "thrown {file} {line} {e}"); + assert_eq!(caps.last(), Some(&("e", "Error: confirm: the next answer is for prompt, not confirm"))); + assert!(c.message("alert: the next answer is for prompt, not confirm").is_none()); +} + /// A template that starts with text matches a message it wraps before a template that starts /// with a placeholder, even one with more literal text, so the wrapped reason is translated by /// its own row. @@ -2181,6 +2198,73 @@ fn wrong(&self) -> String { String::new() } assert_eq!(found.iter().collect::>(), want); } +/// A constant's name reads the text the file declares under it, else every text the files of its +/// own crate declare under it, else every text any scanned crate declares under it: an engine +/// reader's error does not read the Scripts menu's headers, which are constants of the same names +/// in another crate. +#[test] +fn message_scan_reads_constants_of_the_file_and_its_crate() { + use std::collections::{BTreeMap, BTreeSet}; + let jxl = str_consts(r#"const TRUNCATED: &str = "the JPEG XL file is cut short"; const LIMIT: &str = "the image is too large";"#); + let pcx = str_consts(r#"const TRUNCATED: &str = "the PCX file is cut short";"#); + let menu = str_consts(r#"const TRUNCATED: &str = "Some scripts were not listed"; const SHARED: &str = "a message of another crate";"#); + let gather = |files: &[&Vec<(String, String)>]| { + let mut map: BTreeMap> = BTreeMap::new(); + for (name, value) in files.iter().copied().flatten() { + map.entry(name.clone()).or_default().push(value.clone()); + } + map + }; + let engine = gather(&[&jxl, &pcx]); + let everywhere = gather(&[&jxl, &pcx, &menu]); + let code = + "fn f() -> Result<()> { Err(TRUNCATED.into()) }\nfn g() -> Result<()> { Err(LIMIT.into()) }\nfn h() -> Result<()> { Err(SHARED.into()) }"; + let found = |own: &[(String, String)], in_crate: &BTreeMap>| -> BTreeSet { + source_messages(code, &[], &scoped_consts(own, in_crate, &everywhere)).into_iter().collect() + }; + let in_jxl = ["a message of another crate", "the JPEG XL file is cut short", "the image is too large"]; + assert_eq!(found(&jxl, &engine).iter().collect::>(), in_jxl); + let in_engine = ["a message of another crate", "the JPEG XL file is cut short", "the PCX file is cut short", "the image is too large"]; + assert_eq!(found(&[], &engine).iter().collect::>(), in_engine); + assert_eq!(found(&[], &BTreeMap::new()).len(), 5); + let scanned = message_literals(); + for header in [crate::scripts_menu::TRUNCATED, crate::scripts_menu::UNREADABLE] { + assert!(!scanned.contains(header), "{header}"); + } +} + +/// The scan reads the errors the script interpreter throws at a script with a method of any +/// receiver, `&format!` strings included, and not a call of a longer name. +#[test] +fn message_scan_reads_script_interpreter_errors() { + let code = r#" +fn f(i: &mut Interp, interp: &mut Interp) -> JsResult { + let _ = i.type_error(&format!("{what}: the object is not a File or a Folder")); + let _ = interp.throw(ErrorType::Range, "File.seek: the mode must be 0, 1 or 2"); + let _ = self.error("the path has an empty step"); + let _ = self.throw_host(t, "not an error: a longer name"); + let _ = throw_type_error(interp, "not an error: a function"); + Ok(Value::Undefined) +} +"#; + let js: Vec<_> = ERROR_HELPERS.iter().filter(|(c, _, _)| *c == "js").map(|&(_, call, before)| (call, before)).collect(); + let found = source_messages(code, &js, &Default::default()); + assert_eq!(found, ["{what}: the object is not a File or a Folder", "File.seek: the mode must be 0, 1 or 2", "the path has an empty step"]); +} + +/// The scan stops at a test module whose `cfg` is `test` or `all(test, …)`, and reads on past a +/// declaration of a test file and a module that is not only for tests. +#[test] +fn message_scan_skips_test_modules_with_any_test_cfg() { + let code = "fn a() {}\n#[cfg(test)]\nmod tests_x;\n#[cfg(any(test, feature = \"x\"))]\nmod extra {}\nfn b() {}\n"; + for module in ["#[cfg(test)]\nmod tests {", "#[cfg(all(test, not(target_arch = \"wasm32\")))]\nmod tests {", "#[cfg(all( test , unix))] mod t {"] + { + let text = format!("{code}{module} fn c() {{}} }}\n"); + assert_eq!(without_test_module(&text), code, "{module}"); + } + assert_eq!(without_test_module(code), code); +} + /// The limits a plug-in run can exceed, and the error of a removal that leaves the plug-in's grant /// in the plug-in store, are translated in every language that translates every message, as the /// status bar shows them. @@ -2219,6 +2303,244 @@ fn plugin_limit_errors_are_translated() { } } +/// The errors a script's `File` and `Folder` objects, `vc.run` and `$.evalFile` raise are +/// translated in every language of [`COMPLETE_MESSAGES`], and so is the status bar's line for a run +/// that ends with one: the script's name, its place, the command ids and what the script itself +/// threw stay as they are. +#[test] +fn script_errors_are_translated() { + use serde_json::json; + let scanned = message_literals(); + let templates = [ + "Script file access denied", + "Script file exceeds 8 MiB", + "Script file is not open", + "Script file cannot be decoded", + "Script file is not a regular file", + "Script file does not exist", + "Script file could not be read", + "Script folder has more than 2,048 entries", + "Script file open mode must be r, w, e or a", + "Script file writing is not available", + "Script file dialogs are not available", + "Script files cannot be opened in another application", + "Script file access is unavailable on the web", + "Script has 256 files open", + "Script file path exceeds 32,767 characters", + "Script folder mask takes too many steps to match", + "the script opened more file data than one run may open (32 MiB)", + "File.seek: takes a position and a mode", + "vc.run: give a command id, as a string", + "vc.run: takes a command id and an object of parameters", + "vc.run: the parameters must be an object", + "vc.run: the result{place} is too large for a script", + "$.evalFile requires a file path", + "$.evalFile: the timeout must be a finite number of milliseconds, 0 or more", + "$.evalFile: takes a file path and a timeout", + ]; + for template in templates { + assert!(scanned.contains(template), "{template}"); + } + let messages: Vec = templates.iter().map(|t| t.replace("{place}", ".layers[2]")).collect(); + // The status bar's lines for runs that end with one of these errors, each with the message it holds. + let mut s = vectorcraft_engine::Session::new(); + let mut lines = vec![]; + for (source, inner) in [ + ("vc.run()", messages[18].as_str()), + ("vc.run('view.capsLock', {}, 1)", &messages[19]), + ("vc.run('view.capsLock', 1)", &messages[20]), + ("$.evalFile()", &messages[22]), + ("$.evalFile('a.jsx', -1)", &messages[23]), + ("$.evalFile('a.jsx', 0, 1)", &messages[24]), + ] { + let e = s.execute("script.run", &json!({"source": source, "name": "t.js"})).unwrap_err().to_string(); + assert!(e.starts_with("t.js: line ") && e.contains(inner) && e.ends_with(" (thrown)"), "{source}: {e}"); + lines.push((e, Some(inner.to_string()))); + } + // A `File` gives why it could not open as its `error`, which the script throws. + let source = "var f = new File('/vc-no-such-folder/a.txt');\nif (!f.open('r')) throw new Error(f.error);"; + let e = s.execute("script.run", &json!({"source": source, "name": "t.js"})).unwrap_err().to_string(); + let inner = messages[..17].iter().find(|m| e.ends_with(&format!(": Error: {m} (thrown)"))).unwrap_or_else(|| panic!("{e}")); + lines.push((e, Some(inner.clone()))); + let thrown = s.execute("script.run", &json!({"source": "throw new Error('mine')", "name": "t.js"})).unwrap_err().to_string(); + assert_eq!(thrown, "t.js: line 1, column 1: Error: mine (thrown)"); + lines.push((thrown, None)); + // A script that does not compile, and an error raised in code `eval` compiled, which has no place. + let syntax = s.execute("script.run", &json!({"source": "var = 1;", "name": "t.js"})).unwrap_err().to_string(); + assert!(syntax.starts_with("t.js: line 1, column ") && syntax.ends_with(" (syntax)"), "{syntax}"); + lines.push((syntax, None)); + let source = format!("eval(\"throw new Error('{}')\");", messages[18]); + let placeless = s.execute("script.run", &json!({"source": source, "name": "t.js"})).unwrap_err().to_string(); + assert_eq!(placeless, format!("t.js: Error: {} (thrown)", messages[18])); + lines.push((placeless, Some(messages[18].clone()))); + lines.push((format!("t.js: line 7, column 2: {} (stopped)", messages[16]), Some(messages[16].clone()))); + lines.push((format!("t.js: line 7, column 2 of lib.jsx: {} (internal)", messages[16]), Some(messages[16].clone()))); + lines.push((format!("t.js: {} (internal)", messages[16]), Some(messages[16].clone()))); + // A run that ends at a limit, in a file another one included, with files left written. + lines.push((format!("t.js: line 4, column 9 of lib.jsx: {} (limit)", messages[16]), Some(messages[16].clone()))); + lines.push((format!("t.js: {} (limit)", messages[16]), Some(messages[16].clone()))); + lines.push((format!("t.js: line 3, column 1 of lib.jsx: TypeError: {} (thrown)", messages[0]), Some(messages[0].clone()))); + lines.push((format!("t.js: TypeError: {} (thrown)", messages[0]), Some(messages[0].clone()))); + let kept = format!("t.js: line 2, column 5: Error: {} (thrown) (these files stay written: /tmp/a.txt, /tmp/b.txt)", messages[13]); + lines.push((kept, Some(messages[13].clone()))); + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + for m in &messages { + let shown = message(lang, m); + assert_ne!(shown, *m, "{code}"); + assert!(["vc.run", "$.evalFile", "File.seek"].iter().all(|id| !m.contains(id) || shown.contains(id)), "{code}: {shown}"); + } + assert!(message(lang, &messages[21]).contains(".layers[2]"), "{code}"); + for (line, inner) in &lines { + let shown = message(lang, line); + let kinds = ["(thrown)", "(limit)", "(syntax)", "(stopped)", "(internal)", "stay written"]; + assert!(kinds.iter().all(|k| !shown.contains(k)), "{code}: {shown}"); + let numbers: Vec<&str> = line.split(|c: char| !c.is_ascii_digit()).filter(|n| !n.is_empty()).collect(); + assert!(shown.starts_with("t.js") && numbers.iter().all(|n| shown.contains(n)), "{code}: {line} -> {shown}"); + match inner { + Some(inner) => assert!(shown.contains(&message(lang, inner)), "{code}: {line} -> {shown}"), + None if line.ends_with("(syntax)") => assert_ne!(shown, *line, "{code}"), + None => assert!(shown.contains("Error") && shown.contains("mine"), "{code}: {shown}"), + } + for kept in ["lib.jsx", "/tmp/a.txt, /tmp/b.txt"] { + assert!(!line.contains(kept) || shown.contains(kept), "{code}: {shown}"); + } + } + } +} + +/// The errors a script's `$` object, its `alert`, `confirm` and `prompt` dialogs, `vc.document`, +/// `vc.log`, the methods of its `File` and `Folder` objects and a run's limits give, and the errors +/// of the script engine commands, are translated in every language of [`COMPLETE_MESSAGES`], on +/// their own and in the status bar's line for a run that ends with one. Names, numbers and the +/// ids of functions stay as they are. +#[test] +fn script_host_errors_are_translated() { + use serde_json::json; + let scanned = message_literals(); + let templates = [ + "$.{name}: give a name, as a string", + "$.locale: give a locale such as \"en\" or \"de_DE\", or null for the interface's", + "$.localize: give true or false", + "$.flags: only 512, which turns localization on, or 0 can be set", + "$.flags: give a number", + "$.appEncoding: scripts here read and write UTF-8 only", + "$.appEncoding: give an encoding's name, as a string", + "$.memCache: the memory cache size cannot be set", + "$.setenv: give a value, as a string", + "$.setenv: only {_1} can be set", + "$.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @", + "$.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS}", + "$.sleep: give a number of milliseconds", + "$.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code", + "$.bp: scripts here have no debugger", + "$.colorPicker: scripts cannot show a dialog yet", + "{name}: give a message", + "{name}: give the text the field starts with", + "{name}: the message is longer than 16 KiB", + "{name}: the title is longer than 256 bytes", + "{name}: the text the field starts with is longer than 16 KiB", + "{name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code", + "{name}: the next answer in `answers` is for {_1}, not {name}", + "{name}: `answers` has no answer left for this dialog", + "vc.document{place} is too large for a script", + "vc.log: the log of this run is full", + "this function's script run has ended", + "the script made more host calls than one run may make", + "the script passed more data to and from commands than one run may pass", + "the script added more objects and data to the documents than one run may add", + "{what}: the object is not a File or a Folder", + "{what}: the count must be a finite number, 0 or more", + "File.seek: the position must be a finite number", + "File.seek: the mode must be 0, 1 or 2", + "script file is compiled: {value}", + "`name` must be the name of a script engine", + "the main script engine is new for each run and is never kept, so it cannot be dropped", + "there is no script engine named {name}", + ]; + for template in templates { + assert!(scanned.contains(template), "{template}"); + } + let mut s = vectorcraft_engine::Session::new(); + // (what the line holds, what that is as the script's error, what the catalogs must keep) + let mut lines: Vec<(String, String, Vec<&str>)> = vec![]; + for (source, inner, kept) in [ + ("$.getenv(1)", "$.getenv: give a name, as a string", vec!["$.getenv"]), + ("$.setenv('LANG', 1)", "$.setenv: give a value, as a string", vec!["$.setenv"]), + ("$.setenv('HOME', 'x')", "$.setenv: only LANG, LC_MESSAGES, LC_ALL, OS can be set", vec!["$.setenv", "LANG, LC_MESSAGES, LC_ALL, OS"]), + ("$.setenv('LANG', 'a b')", "$.setenv: a value has at most 64 letters, digits and _ . - @", vec!["$.setenv", "64", "_ . - @"]), + ("$.sleep('x')", "$.sleep: give a number of milliseconds", vec!["$.sleep"]), + ("$.sleep(5000)", "$.sleep: give a number of milliseconds from 0 to 1000", vec!["$.sleep", "1000"]), + ("$.flags = 3", "$.flags: only 512, which turns localization on, or 0 can be set", vec!["$.flags", "512"]), + ("$.flags = 'x'", "$.flags: give a number", vec!["$.flags"]), + ("$.localize = 1", "$.localize: give true or false", vec!["$.localize"]), + ("$.locale = 1", templates[1], vec!["$.locale", "\"en\"", "\"de_DE\""]), + ("$.appEncoding = 'latin1'", templates[5], vec!["$.appEncoding", "UTF-8"]), + ("$.appEncoding = 1", templates[6], vec!["$.appEncoding"]), + ("$.memCache = 1", templates[7], vec!["$.memCache"]), + ("$.bp()", templates[14], vec!["$.bp"]), + ("$.colorPicker()", templates[15], vec!["$.colorPicker"]), + ("File.prototype.seek.call({})", "seek: the object is not a File or a Folder", vec!["seek", "File"]), + ("new File('a.txt').seek(NaN)", templates[32], vec!["File.seek"]), + ("new File('a.txt').seek(0, 5)", templates[33], vec!["File.seek", "0, 1", "2"]), + ("new File('a.txt').read(-1)", "File.read: the count must be a finite number, 0 or more", vec!["File.read", "0"]), + ] { + let e = s.execute("script.run", &json!({"source": source, "name": "t.js"})).unwrap_err().to_string(); + assert!(e.starts_with("t.js: ") && e.contains(&format!(": {inner} (")), "{source}: {e}"); + lines.push((e, inner.to_string(), kept)); + } + let in_callback = templates[21].replace("{name}", "alert"); + for (inner, kept) in [ + ("alert: give a message", vec!["alert"]), + ("prompt: give the text the field starts with", vec!["prompt"]), + ("confirm: the message is longer than 16 KiB", vec!["confirm", "16"]), + ("alert: the title is longer than 256 bytes", vec!["alert", "256"]), + ("prompt: the text the field starts with is longer than 16 KiB", vec!["prompt", "16"]), + (in_callback.as_str(), vec!["alert", "$.evalFile"]), + ("confirm: the next answer in `answers` is for prompt, not confirm", vec!["`answers`", "prompt", "confirm"]), + ("alert: `answers` has no answer left for this dialog", vec!["`answers`", "alert"]), + (templates[13], vec!["$.sleep", "$.evalFile"]), + ("vc.document.layers[0] is too large for a script", vec!["vc.document.layers[0]"]), + (templates[25], vec!["vc.log"]), + (templates[26], vec![]), + (templates[27], vec![]), + (templates[28], vec![]), + (templates[29], vec![]), + ("script file is compiled: lib.jsxbin", vec!["lib.jsxbin"]), + ] { + let line = format!("t.js: line 3, column 7: Error: {inner} (thrown)"); + lines.push((line, inner.to_string(), kept)); + } + let mut commands = vec![]; + for (id, params) in + [("script.engine.drop", json!({})), ("script.engine.drop", json!({"name": "main"})), ("script.engine.drop", json!({"name": "kept"}))] + { + commands.push(s.execute(id, ¶ms).unwrap_err().to_string()); + } + assert!(commands[0].contains(templates[35]) && commands[1].contains(templates[36]), "{commands:?}"); + assert!(commands[2].contains("there is no script engine named \"kept\""), "{commands:?}"); + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + for (line, inner, kept) in &lines { + let shown = message(lang, inner); + assert_ne!(shown, *inner, "{code}"); + assert!(kept.iter().all(|k| shown.contains(k)), "{code}: {inner} -> {shown}"); + let whole = message(lang, line); + let kinds = ["(thrown)", "(limit)", "(syntax)", "(stopped)", "(internal)"]; + assert!(whole.starts_with("t.js") && whole.contains(&shown) && kinds.iter().all(|k| !whole.contains(k)), "{code}: {line} -> {whole}"); + } + for e in &commands { + let shown = message(lang, e); + assert_ne!(shown, *e, "{code}"); + assert!( + !shown.contains("must be the name") && !shown.contains("is never kept") && !shown.contains("there is no script engine"), + "{code}: {shown}" + ); + } + assert!(message(lang, &commands[2]).contains("\"kept\""), "{code}"); + } +} + /// A manifest whose `commands` value has the wrong shape is refused with an error that every /// language of [`COMPLETE_MESSAGES`] translates whole, the command's name and the place in the /// manifest included. @@ -2918,23 +3240,30 @@ const COMPLETE_MESSAGES: &[&str] = &[ ]; /// Crates whose error and status messages reach the status bar. -const MESSAGE_CRATES: &[&str] = &["ui-egui", "engine", "doc", "format", "svg", "pdf", "eps", "text", "plugins", "metafile", "cad", "trace"]; +const MESSAGE_CRATES: &[&str] = &["ui-egui", "engine", "doc", "format", "svg", "pdf", "eps", "text", "plugins", "metafile", "cad", "trace", "js"]; /// Where a message literal starts: a status, an error value, a `thiserror` message. const MESSAGE_MARKERS: &[&str] = &[".status(", "ui.status = ", "status = ", "Other(", "Err(", "ok_or(", "ok_or_else(|| ", "#[error("]; /// Helpers that make an error from a message, by crate, with the number of arguments before the /// message: the engine's `bad(cmd, msg)` (`EngineError::BadParams`), `err(msg)` (`cmd/fileio`) -/// and `error(msg)` (`cmd/dimension.rs`), the PDF writer's `bad(why)` (`forms.rs`) and -/// `failed(why)` (`encrypt.rs`, `linearize.rs`), and the plug-in host's `bad(what)` (a parameter's -/// spec and dialog keys), `wrong(what)` (a parameter's value), `out_err(at, msg)` (plug-in output), -/// `in_range(x, lo, hi, at, what)` and `unit(x, at, what)` (a painted effect's numbers) and -/// `.read_packed(packed, what, max)` (the block a plug-in returned). A helper that starts with -/// `.` is a method. +/// and `error(msg)` (`cmd/dimension.rs`), the script host's `fail(msg)` (`script/files.rs`, +/// `script/dollar.rs`) and `value(msg)`, which gives the messages the script `File` object's own +/// code throws (`script/files.rs`), and `.over(limit)` for a limit a run passes (`script/mod.rs`), +/// the PDF writer's `bad(why)` (`forms.rs`) and `failed(why)` (`encrypt.rs`, `linearize.rs`), the +/// plug-in host's `bad(what)` (a parameter's spec and dialog keys), `wrong(what)` (a parameter's +/// value), `out_err(at, msg)` (plug-in output), `in_range(x, lo, hi, at, what)` and +/// `unit(x, at, what)` (a painted effect's numbers) and `.read_packed(packed, what, max)` (the block +/// a plug-in returned), and the script interpreter's methods that throw an error at a script: +/// `.type_error(msg)`, `.throw(kind, msg)` and the XPath evaluator's `.error(msg)`. A helper that +/// starts with `.` is a method of any receiver. const ERROR_HELPERS: &[(&str, &str, usize)] = &[ ("engine", "bad(", 1), ("engine", "err(", 0), ("engine", "error(", 0), + ("engine", "fail(", 0), + ("engine", "value(", 0), + ("engine", ".over(", 0), ("pdf", "bad(", 0), ("pdf", "failed(", 0), ("plugins", "bad(", 0), @@ -2943,6 +3272,9 @@ const ERROR_HELPERS: &[(&str, &str, usize)] = &[ ("plugins", "in_range(", 4), ("plugins", "unit(", 2), ("plugins", ".read_packed(", 1), + ("js", ".type_error(", 0), + ("js", ".throw(", 1), + ("js", ".error(", 0), ]; /// Error variants whose first argument is a name, not a message: a command id @@ -2977,7 +3309,11 @@ fn message_literals_in(names: &[&str]) -> std::collections::BTreeSet { if name != "tests" { stack.push(path); } - } else if name.ends_with(".rs") && !name.starts_with("tests") && !(d == crates.join("ui-egui").join("src") && name == "control.rs") { + } else if name.ends_with(".rs") + && !name.starts_with("tests") + && !name.ends_with("_tests.rs") + && !(d == crates.join("ui-egui").join("src") && name == "control.rs") + { // Control replies are English protocol data, never status-bar messages // (see i18n's module contract). Engine messages are scanned in their own crates. let text = std::fs::read_to_string(&path).unwrap_or_default(); @@ -2985,20 +3321,59 @@ fn message_literals_in(names: &[&str]) -> std::collections::BTreeSet { } } } - let mut consts = std::collections::BTreeMap::new(); - for (_, text) in &files { - for (name, value) in str_consts(without_test_module(text)) { - consts.entry(name).or_insert_with(Vec::new).push(value); + let crate_of = |path: &std::path::Path| names.iter().copied().find(|c| path.starts_with(crates.join(c))).unwrap_or(""); + let declared: Vec<_> = files.iter().map(|(path, text)| (crate_of(path), str_consts(without_test_module(text)))).collect(); + let mut by_crate: std::collections::BTreeMap<&str, std::collections::BTreeMap>> = std::collections::BTreeMap::new(); + let mut everywhere: std::collections::BTreeMap> = std::collections::BTreeMap::new(); + for (krate, consts) in &declared { + let in_crate = by_crate.entry(*krate).or_default(); + for (name, value) in consts { + in_crate.entry(name.clone()).or_default().push(value.clone()); + everywhere.entry(name.clone()).or_default().push(value.clone()); } } - for (path, text) in &files { + let none = std::collections::BTreeMap::new(); + let crate_consts: std::collections::BTreeMap<&str, _> = + by_crate.iter().map(|(krate, in_crate)| (*krate, scoped_consts(&[], in_crate, &everywhere).into_owned())).collect(); + for ((path, text), (krate, own)) in files.iter().zip(&declared) { let helpers: Vec<_> = ERROR_HELPERS.iter().filter(|(c, _, _)| path.starts_with(crates.join(c))).map(|&(_, call, before)| (call, before)).collect(); + let consts = scoped_consts(own, crate_consts.get(krate).unwrap_or(&none), &none); out.extend(source_messages(without_test_module(text), &helpers, &consts)); } out } +/// The `&str` constants a file can name, from the constants it declares (`own`), those the files +/// of its crate declare (`in_crate`) and those every scanned crate declares (`everywhere`): a name +/// the file declares has the file's own text only, a name its crate declares has every text the +/// crate's files give it, and any other name has every text the scanned crates give it. +fn scoped_consts<'a>( + own: &[(String, String)], + in_crate: &'a std::collections::BTreeMap>, + everywhere: &std::collections::BTreeMap>, +) -> std::borrow::Cow<'a, std::collections::BTreeMap>> { + let elsewhere = everywhere.keys().any(|name| !in_crate.contains_key(name)); + let own_differs = own.iter().any(|(name, _)| { + let mine: Vec<&String> = own.iter().filter(|(n, _)| n == name).map(|(_, v)| v).collect(); + in_crate.get(name).is_none_or(|values| values.iter().collect::>() != mine) + }); + if !elsewhere && !own_differs { + return std::borrow::Cow::Borrowed(in_crate); + } + let mut consts = everywhere.clone(); + for (name, values) in in_crate { + consts.insert(name.clone(), values.clone()); + } + for (name, _) in own { + consts.remove(name); + } + for (name, value) in own { + consts.entry(name.clone()).or_default().push(value.clone()); + } + std::borrow::Cow::Owned(consts) +} + /// The `&str` constants `code` declares outside its comments (`const NAME: &str = "…";`), with /// their text, escapes resolved. fn str_consts(code: &str) -> Vec<(String, String)> { @@ -3103,11 +3478,17 @@ fn skip_args(args: &str, n: usize) -> Option<&str> { None } -/// Source up to its inline test module (`#[cfg(test)] mod tests {`); declarations of test files -/// (`#[cfg(test)] mod tests_x;`) don't end it. +/// Source up to its inline test module (`#[cfg(test)] mod tests {`, or a `cfg(all(test, …))` one); +/// declarations of test files (`#[cfg(test)] mod tests_x;`) don't end it. fn without_test_module(text: &str) -> &str { - for (at, m) in text.match_indices("#[cfg(test)]") { - let after = text[at + m.len()..].trim_start(); + for (at, m) in text.match_indices("#[cfg(") { + let rest = &text[at + m.len()..]; + let Some(end) = rest.find(")]") else { continue }; + let cond: String = rest[..end].chars().filter(|c| !c.is_whitespace()).collect(); + if cond != "test" && !cond.starts_with("all(test,") { + continue; + } + let after = rest[end + 2..].trim_start(); if let Some(rest) = after.strip_prefix("mod ") && rest.trim_start_matches(|c: char| c.is_alphanumeric() || c == '_').trim_start().starts_with('{') { diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index b85b65184b..f8f4ea6fd4 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -4001,6 +4001,85 @@ axis Both Her İkisi @msg the script's run is no longer available betiğin çalıştırması artık kullanılamıyor @msg a failed command changed undo steps that could not be put back, so the script was stopped başarısız bir komut geri yüklenemeyen geri alma adımlarını değiştirdi, bu yüzden betik durduruldu @msg a recovery copy could not be written, so the script was not run kurtarma kopyası yazılamadı, bu nedenle betik çalıştırılmadı +@msg Script file access denied Betik dosyasına erişim reddedildi +@msg Script file exceeds 8 MiB Betik dosyası 8 MiB'yi aşıyor +@msg Script file is not open Betik dosyası açık değil +@msg Script file cannot be decoded Betik dosyasının kodu çözülemiyor +@msg Script file is not a regular file Betik dosyası normal bir dosya değil +@msg Script file does not exist Betik dosyası yok +@msg Script file could not be read Betik dosyası okunamadı +@msg Script folder has more than 2,048 entries Betik klasöründe 2.048'den fazla öğe var +@msg Script file open mode must be r, w, e or a Betik dosyası açma modu r, w, e veya a olmalıdır +@msg Script file writing is not available Betik dosyası yazma kullanılamıyor +@msg Script file dialogs are not available Betik dosyası iletişim kutuları kullanılamıyor +@msg Script files cannot be opened in another application Betik dosyaları başka bir uygulamada açılamaz +@msg Script file access is unavailable on the web Betik dosyası erişimi web'de kullanılamıyor +@msg Script has 256 files open Betiğin 256 açık dosyası var +@msg Script file path exceeds 32,767 characters Betik dosyası yolu 32.767 karakteri aşıyor +@msg Script folder mask takes too many steps to match Betik klasörü maskesinin eşleşmesi çok fazla adım gerektiriyor +@msg the script opened more file data than one run may open (32 MiB) betik, bir çalıştırmanın açabileceğinden fazla dosya verisi açtı (32 MiB) +@msg File.seek: takes a position and a mode File.seek: bir konum ve bir mod alır +@msg vc.run: give a command id, as a string vc.run: bir komut kimliğini dize olarak verin +@msg vc.run: takes a command id and an object of parameters vc.run: bir komut kimliği ve bir parametre nesnesi alır +@msg vc.run: the parameters must be an object vc.run: parametreler bir nesne olmalıdır +@msg vc.run: the result{place} is too large for a script vc.run: sonuç{place} bir betik için çok büyük +@msg $.evalFile requires a file path $.evalFile bir dosya yolu gerektirir +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: zaman aşımı sonlu bir milisaniye sayısı olmalıdır, 0 veya daha fazla +@msg $.evalFile: takes a file path and a timeout $.evalFile: bir dosya yolu ve bir zaman aşımı alır +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: {file}, satır {line}, sütun {column}: {e} (fırlatıldı) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: satır {line}, sütun {column}: {e} (fırlatıldı) +@msg {name}: {e} (thrown) {name}: {e} (fırlatıldı) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: {file}, satır {line}, sütun {column}: {e} (sınır) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: satır {line}, sütun {column}: {e} (sınır) +@msg {name}: {e} (limit) {name}: {e} (sınır) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: {file}, satır {line}, sütun {column}: {e} (sözdizimi hatası) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: satır {line}, sütun {column}: {e} (sözdizimi hatası) +@msg {name}: {e} (syntax) {name}: {e} (sözdizimi hatası) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: {file}, satır {line}, sütun {column}: {e} (durduruldu) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: satır {line}, sütun {column}: {e} (durduruldu) +@msg {name}: {e} (stopped) {name}: {e} (durduruldu) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: {file}, satır {line}, sütun {column}: {e} (iç hata) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: satır {line}, sütun {column}: {e} (iç hata) +@msg {name}: {e} (internal) {name}: {e} (iç hata) +@msg {e} (these files stay written: {paths}) {e} (bu dosyalar yazılmış olarak kalır: {paths}) +@msg $.{name}: give a name, as a string $.{name}: bir adı dize olarak verin +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: "en" veya "de_DE" gibi bir yerel ayar verin ya da arayüzünki için null verin +@msg $.localize: give true or false $.localize: true veya false verin +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: yalnızca yerelleştirmeyi açan 512 veya 0 ayarlanabilir +@msg $.flags: give a number $.flags: bir sayı verin +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: burada betikler yalnızca UTF-8 okur ve yazar +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: bir kodlamanın adını dize olarak verin +@msg $.memCache: the memory cache size cannot be set $.memCache: bellek önbelleğinin boyutu ayarlanamaz +@msg $.setenv: give a value, as a string $.setenv: bir değeri dize olarak verin +@msg $.setenv: only {_1} can be set $.setenv: yalnızca {_1} ayarlanabilir +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: bir değer en fazla {MAX_ENV_BYTES} harf, rakam ve _ . - @ içerir +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: 0 ile {MAX_SLEEP_MS} arasında bir milisaniye sayısı verin +@msg $.sleep: give a number of milliseconds $.sleep: bir milisaniye sayısı verin +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: bir çalıştırma yerleşik bir işlevin geri çağrısında, bir getter içinde, bir dönüştürmede veya $.evalFile'ın çalıştırdığı bir dosyada bekleyemez; bunu betiğin kendi kodundan çağırın +@msg $.bp: scripts here have no debugger $.bp: burada betiklerin hata ayıklayıcısı yok +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: betikler henüz iletişim kutusu gösteremez +@msg {name}: give a message {name}: bir ileti verin +@msg {name}: give the text the field starts with {name}: alanın başladığı metni verin +@msg {name}: the message is longer than 16 KiB {name}: ileti 16 KiB'den uzun +@msg {name}: the title is longer than 256 bytes {name}: başlık 256 bayttan uzun +@msg {name}: the text the field starts with is longer than 16 KiB {name}: alanın başladığı metin 16 KiB'den uzun +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: bir iletişim kutusu yerleşik bir işlevin geri çağrısında, bir getter içinde, bir dönüştürmede veya $.evalFile'ın çalıştırdığı bir dosyada açılamaz; bunu betiğin kendi kodundan çağırın +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: `answers` içindeki sonraki yanıt {name} için değil, {_1} için +@msg {name}: `answers` has no answer left for this dialog {name}: `answers` içinde bu iletişim kutusu için yanıt kalmadı +@msg vc.document{place} is too large for a script vc.document{place} bir betik için çok büyük +@msg vc.log: the log of this run is full vc.log: bu çalıştırmanın günlüğü dolu +@msg this function's script run has ended bu işlevin betik çalıştırması sona erdi +@msg the script made more host calls than one run may make betik, bir çalıştırmanın yapabileceğinden daha fazla ana bilgisayar çağrısı yaptı +@msg the script passed more data to and from commands than one run may pass betik, komutlara ve komutlardan bir çalıştırmanın aktarabileceğinden daha fazla veri aktardı +@msg the script added more objects and data to the documents than one run may add betik, belgelere bir çalıştırmanın ekleyebileceğinden daha fazla nesne ve veri ekledi +@msg {what}: the object is not a File or a Folder {what}: nesne ne File ne de Folder +@msg {what}: the count must be a finite number, 0 or more {what}: sayı 0 veya daha büyük, sonlu bir sayı olmalıdır +@msg File.seek: the position must be a finite number File.seek: konum sonlu bir sayı olmalıdır +@msg File.seek: the mode must be 0, 1 or 2 File.seek: mod 0, 1 veya 2 olmalıdır +@msg script file is compiled: {value} betik dosyası derlenmiş: {value} +@msg `name` must be the name of a script engine `name` bir betik motorunun adı olmalıdır +@msg the main script engine is new for each run and is never kept, so it cannot be dropped ana betik motoru her çalıştırmada yenidir ve hiç saklanmaz, bu yüzden bırakılamaz +@msg there is no script engine named {name} {name} adlı bir betik motoru yok @msg Running a script Betik çalıştırılıyor @msg Copied the script report Komut dosyası raporu kopyalandı @msg Corners edits the corners of a path Köşeler bir yolun köşelerini düzenler diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 8e05bb2fc9..cf31814aca 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -4246,6 +4246,85 @@ axis Both Обидві @msg the script's run is no longer available виконання скрипта більше не доступне @msg a failed command changed undo steps that could not be put back, so the script was stopped невдала команда змінила кроки скасування, які не вдалося відновити, тому скрипт зупинено @msg a recovery copy could not be written, so the script was not run не вдалося записати копію для відновлення, тому скрипт не виконано +@msg Script file access denied Доступ до файлу скрипта заборонено +@msg Script file exceeds 8 MiB Файл скрипта перевищує 8 МіБ +@msg Script file is not open Файл скрипта не відкрито +@msg Script file cannot be decoded Не вдається декодувати файл скрипта +@msg Script file is not a regular file Файл скрипта не є звичайним файлом +@msg Script file does not exist Файл скрипта не існує +@msg Script file could not be read Не вдалося прочитати файл скрипта +@msg Script folder has more than 2,048 entries Тека скрипта має понад 2048 елементів +@msg Script file open mode must be r, w, e or a Режим відкриття файлу скрипта має бути r, w, e або a +@msg Script file writing is not available Запис файлів скрипта недоступний +@msg Script file dialogs are not available Діалогові вікна файлів скрипта недоступні +@msg Script files cannot be opened in another application Файли скрипта не можна відкрити в іншому застосунку +@msg Script file access is unavailable on the web Доступ до файлів скрипта у вебверсії недоступний +@msg Script has 256 files open Скрипт має 256 відкритих файлів +@msg Script file path exceeds 32,767 characters Шлях до файлу скрипта довший за 32 767 символів +@msg Script folder mask takes too many steps to match Зіставлення маски теки скрипта потребує забагато кроків +@msg the script opened more file data than one run may open (32 MiB) скрипт відкрив більше даних файлів, ніж може відкрити один запуск (32 МіБ) +@msg File.seek: takes a position and a mode File.seek: приймає позицію і режим +@msg vc.run: give a command id, as a string vc.run: укажіть ідентифікатор команди як рядок +@msg vc.run: takes a command id and an object of parameters vc.run: приймає ідентифікатор команди та об’єкт параметрів +@msg vc.run: the parameters must be an object vc.run: параметри мають бути об’єктом +@msg vc.run: the result{place} is too large for a script vc.run: результат{place} завеликий для скрипта +@msg $.evalFile requires a file path $.evalFile потребує шляху до файлу +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: тайм-аут має бути скінченним числом мілісекунд, 0 або більше +@msg $.evalFile: takes a file path and a timeout $.evalFile: приймає шлях до файлу і тайм-аут +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: рядок {line}, стовпець {column} у {file}: {e} (виняток) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: рядок {line}, стовпець {column}: {e} (виняток) +@msg {name}: {e} (thrown) {name}: {e} (виняток) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: рядок {line}, стовпець {column} у {file}: {e} (обмеження) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: рядок {line}, стовпець {column}: {e} (обмеження) +@msg {name}: {e} (limit) {name}: {e} (обмеження) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: рядок {line}, стовпець {column} у {file}: {e} (синтаксична помилка) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: рядок {line}, стовпець {column}: {e} (синтаксична помилка) +@msg {name}: {e} (syntax) {name}: {e} (синтаксична помилка) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: рядок {line}, стовпець {column} у {file}: {e} (зупинено) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: рядок {line}, стовпець {column}: {e} (зупинено) +@msg {name}: {e} (stopped) {name}: {e} (зупинено) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: рядок {line}, стовпець {column} у {file}: {e} (внутрішня помилка) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: рядок {line}, стовпець {column}: {e} (внутрішня помилка) +@msg {name}: {e} (internal) {name}: {e} (внутрішня помилка) +@msg {e} (these files stay written: {paths}) {e} (ці файли залишаються записаними: {paths}) +@msg $.{name}: give a name, as a string $.{name}: укажіть ім'я як рядок +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: укажіть локаль, наприклад "en" або "de_DE", або null для локалі інтерфейсу +@msg $.localize: give true or false $.localize: укажіть true або false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: можна встановити лише 512, яке вмикає локалізацію, або 0 +@msg $.flags: give a number $.flags: укажіть число +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: тут скрипти читають і записують лише UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: укажіть назву кодування як рядок +@msg $.memCache: the memory cache size cannot be set $.memCache: розмір кешу пам'яті не можна встановити +@msg $.setenv: give a value, as a string $.setenv: укажіть значення як рядок +@msg $.setenv: only {_1} can be set $.setenv: можна встановити лише {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: значення має щонайбільше {MAX_ENV_BYTES} літер, цифр і знаків _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: укажіть кількість мілісекунд від 0 до {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: укажіть кількість мілісекунд +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: запуск не може чекати всередині зворотного виклику вбудованої функції, гетера, перетворення або файлу, який виконує $.evalFile; викличте її з власного коду скрипту +@msg $.bp: scripts here have no debugger $.bp: тут у скриптів немає налагоджувача +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: скрипти поки не можуть показувати діалогове вікно +@msg {name}: give a message {name}: укажіть повідомлення +@msg {name}: give the text the field starts with {name}: укажіть текст, з якого починається поле +@msg {name}: the message is longer than 16 KiB {name}: повідомлення довше за 16 КіБ +@msg {name}: the title is longer than 256 bytes {name}: заголовок довший за 256 байтів +@msg {name}: the text the field starts with is longer than 16 KiB {name}: текст, з якого починається поле, довший за 16 КіБ +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: діалогове вікно не може відкритися всередині зворотного виклику вбудованої функції, гетера, перетворення або файлу, який виконує $.evalFile; викличте його з власного коду скрипту +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: наступна відповідь у `answers` призначена для {_1}, а не для {name} +@msg {name}: `answers` has no answer left for this dialog {name}: у `answers` не залишилося відповіді для цього діалогового вікна +@msg vc.document{place} is too large for a script vc.document{place} завеликий для скрипту +@msg vc.log: the log of this run is full vc.log: журнал цього запуску заповнений +@msg this function's script run has ended запуск скрипту цієї функції завершився +@msg the script made more host calls than one run may make скрипт зробив більше викликів хоста, ніж дозволено одному запуску +@msg the script passed more data to and from commands than one run may pass скрипт передав командам і отримав від них більше даних, ніж дозволено одному запуску +@msg the script added more objects and data to the documents than one run may add скрипт додав до документів більше об'єктів і даних, ніж дозволено одному запуску +@msg {what}: the object is not a File or a Folder {what}: об'єкт не є ні File, ні Folder +@msg {what}: the count must be a finite number, 0 or more {what}: кількість має бути скінченним числом, 0 або більше +@msg File.seek: the position must be a finite number File.seek: позиція має бути скінченним числом +@msg File.seek: the mode must be 0, 1 or 2 File.seek: режим має бути 0, 1 або 2 +@msg script file is compiled: {value} файл скрипту скомпільований: {value} +@msg `name` must be the name of a script engine `name` має бути назвою рушія скриптів +@msg the main script engine is new for each run and is never kept, so it cannot be dropped основний рушій скриптів створюється наново для кожного запуску й ніколи не зберігається, тому його не можна видалити +@msg there is no script engine named {name} рушія скриптів з назвою {name} немає @msg Running a script Виконується скрипт @msg Copied the script report Звіт про сценарій скопійовано @msg Corners edits the corners of a path «Кути» редагує кути контуру diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index f10ab118e4..34a56d569c 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -4672,6 +4672,85 @@ theme Appearance Giao diện @msg the script's run is no longer available lần chạy tập lệnh không còn khả dụng @msg a failed command changed undo steps that could not be put back, so the script was stopped một lệnh thất bại đã thay đổi các bước hoàn tác không thể khôi phục, nên tập lệnh đã bị dừng @msg a recovery copy could not be written, so the script was not run không thể ghi bản sao khôi phục nên tập lệnh không được chạy +@msg Script file access denied Truy cập tệp tập lệnh bị từ chối +@msg Script file exceeds 8 MiB Tệp tập lệnh vượt quá 8 MiB +@msg Script file is not open Tệp tập lệnh chưa được mở +@msg Script file cannot be decoded Không thể giải mã tệp tập lệnh +@msg Script file is not a regular file Tệp tập lệnh không phải là tệp thông thường +@msg Script file does not exist Tệp tập lệnh không tồn tại +@msg Script file could not be read Không thể đọc tệp tập lệnh +@msg Script folder has more than 2,048 entries Thư mục tập lệnh có hơn 2.048 mục +@msg Script file open mode must be r, w, e or a Chế độ mở tệp tập lệnh phải là r, w, e hoặc a +@msg Script file writing is not available Không thể ghi tệp tập lệnh +@msg Script file dialogs are not available Không có hộp thoại tệp cho tập lệnh +@msg Script files cannot be opened in another application Không thể mở tệp tập lệnh trong ứng dụng khác +@msg Script file access is unavailable on the web Không thể truy cập tệp tập lệnh trên web +@msg Script has 256 files open Tập lệnh đang mở 256 tệp +@msg Script file path exceeds 32,767 characters Đường dẫn tệp tập lệnh vượt quá 32.767 ký tự +@msg Script folder mask takes too many steps to match Mặt nạ thư mục tập lệnh cần quá nhiều bước để so khớp +@msg the script opened more file data than one run may open (32 MiB) tập lệnh đã mở nhiều dữ liệu tệp hơn mức một lần chạy được phép mở (32 MiB) +@msg File.seek: takes a position and a mode File.seek: nhận một vị trí và một chế độ +@msg vc.run: give a command id, as a string vc.run: hãy cung cấp id lệnh dưới dạng chuỗi +@msg vc.run: takes a command id and an object of parameters vc.run: nhận một id lệnh và một đối tượng tham số +@msg vc.run: the parameters must be an object vc.run: tham số phải là một đối tượng +@msg vc.run: the result{place} is too large for a script vc.run: kết quả{place} quá lớn đối với tập lệnh +@msg $.evalFile requires a file path $.evalFile cần đường dẫn tệp +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile: thời gian chờ phải là một số mili giây hữu hạn, từ 0 trở lên +@msg $.evalFile: takes a file path and a timeout $.evalFile: nhận một đường dẫn tệp và một thời gian chờ +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}: dòng {line}, cột {column} của {file}: {e} (đã ném) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}: dòng {line}, cột {column}: {e} (đã ném) +@msg {name}: {e} (thrown) {name}: {e} (đã ném) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}: dòng {line}, cột {column} của {file}: {e} (giới hạn) +@msg {name}: line {line}, column {column}: {e} (limit) {name}: dòng {line}, cột {column}: {e} (giới hạn) +@msg {name}: {e} (limit) {name}: {e} (giới hạn) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}: dòng {line}, cột {column} của {file}: {e} (lỗi cú pháp) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}: dòng {line}, cột {column}: {e} (lỗi cú pháp) +@msg {name}: {e} (syntax) {name}: {e} (lỗi cú pháp) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}: dòng {line}, cột {column} của {file}: {e} (đã dừng) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}: dòng {line}, cột {column}: {e} (đã dừng) +@msg {name}: {e} (stopped) {name}: {e} (đã dừng) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}: dòng {line}, cột {column} của {file}: {e} (lỗi nội bộ) +@msg {name}: line {line}, column {column}: {e} (internal) {name}: dòng {line}, cột {column}: {e} (lỗi nội bộ) +@msg {name}: {e} (internal) {name}: {e} (lỗi nội bộ) +@msg {e} (these files stay written: {paths}) {e} (các tệp này vẫn được ghi: {paths}) +@msg $.{name}: give a name, as a string $.{name}: hãy cung cấp tên dưới dạng chuỗi +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale: hãy cung cấp một ngôn ngữ vùng như "en" hoặc "de_DE", hoặc null cho ngôn ngữ của giao diện +@msg $.localize: give true or false $.localize: hãy cung cấp true hoặc false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags: chỉ có thể đặt 512, giá trị bật bản địa hóa, hoặc 0 +@msg $.flags: give a number $.flags: hãy cung cấp một số +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding: ở đây tập lệnh chỉ đọc và ghi UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding: hãy cung cấp tên bảng mã dưới dạng chuỗi +@msg $.memCache: the memory cache size cannot be set $.memCache: không thể đặt kích thước bộ nhớ đệm +@msg $.setenv: give a value, as a string $.setenv: hãy cung cấp giá trị dưới dạng chuỗi +@msg $.setenv: only {_1} can be set $.setenv: chỉ có thể đặt {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv: một giá trị có tối đa {MAX_ENV_BYTES} chữ cái, chữ số và _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep: hãy cung cấp số mili giây từ 0 đến {MAX_SLEEP_MS} +@msg $.sleep: give a number of milliseconds $.sleep: hãy cung cấp số mili giây +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep: một lần chạy không thể chờ bên trong lệnh gọi lại của hàm dựng sẵn, getter, phép chuyển đổi hoặc tệp mà $.evalFile chạy; hãy gọi nó từ mã của chính tập lệnh +@msg $.bp: scripts here have no debugger $.bp: ở đây tập lệnh không có trình gỡ lỗi +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker: tập lệnh chưa thể hiển thị hộp thoại +@msg {name}: give a message {name}: hãy cung cấp thông báo +@msg {name}: give the text the field starts with {name}: hãy cung cấp văn bản mà trường bắt đầu +@msg {name}: the message is longer than 16 KiB {name}: thông báo dài hơn 16 KiB +@msg {name}: the title is longer than 256 bytes {name}: tiêu đề dài hơn 256 byte +@msg {name}: the text the field starts with is longer than 16 KiB {name}: văn bản mà trường bắt đầu dài hơn 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}: hộp thoại không thể mở bên trong lệnh gọi lại của hàm dựng sẵn, getter, phép chuyển đổi hoặc tệp mà $.evalFile chạy; hãy gọi nó từ mã của chính tập lệnh +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}: câu trả lời tiếp theo trong `answers` dành cho {_1}, không phải {name} +@msg {name}: `answers` has no answer left for this dialog {name}: `answers` không còn câu trả lời nào cho hộp thoại này +@msg vc.document{place} is too large for a script vc.document{place} quá lớn đối với tập lệnh +@msg vc.log: the log of this run is full vc.log: nhật ký của lần chạy này đã đầy +@msg this function's script run has ended lần chạy tập lệnh của hàm này đã kết thúc +@msg the script made more host calls than one run may make tập lệnh đã thực hiện nhiều lệnh gọi máy chủ hơn mức một lần chạy được phép +@msg the script passed more data to and from commands than one run may pass tập lệnh đã truyền đến và từ các lệnh nhiều dữ liệu hơn mức một lần chạy được phép +@msg the script added more objects and data to the documents than one run may add tập lệnh đã thêm vào tài liệu nhiều đối tượng và dữ liệu hơn mức một lần chạy được phép +@msg {what}: the object is not a File or a Folder {what}: đối tượng không phải File cũng không phải Folder +@msg {what}: the count must be a finite number, 0 or more {what}: số lượng phải là một số hữu hạn, 0 trở lên +@msg File.seek: the position must be a finite number File.seek: vị trí phải là một số hữu hạn +@msg File.seek: the mode must be 0, 1 or 2 File.seek: chế độ phải là 0, 1 hoặc 2 +@msg script file is compiled: {value} tệp tập lệnh đã được biên dịch: {value} +@msg `name` must be the name of a script engine `name` phải là tên của một bộ máy tập lệnh +@msg the main script engine is new for each run and is never kept, so it cannot be dropped bộ máy tập lệnh chính được tạo mới cho mỗi lần chạy và không bao giờ được giữ lại, nên không thể loại bỏ nó +@msg there is no script engine named {name} không có bộ máy tập lệnh nào tên {name} @msg Running a script Đang chạy tập lệnh @msg Copied the script report Đã sao chép báo cáo script @msg Corners edits the corners of a path Corners chỉnh sửa các góc của đường dẫn diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index b699270a8b..5d3a739794 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -4703,6 +4703,85 @@ imageTrace Outline 轮廓 @msg the script's run is no longer available 脚本运行已不可用 @msg a failed command changed undo steps that could not be put back, so the script was stopped 失败的命令更改了无法恢复的撤销步骤,因此脚本已停止 @msg a recovery copy could not be written, so the script was not run 无法写入恢复副本,因此未运行脚本 +@msg Script file access denied 脚本文件访问被拒绝 +@msg Script file exceeds 8 MiB 脚本文件超过 8 MiB +@msg Script file is not open 脚本文件未打开 +@msg Script file cannot be decoded 无法解码脚本文件 +@msg Script file is not a regular file 脚本文件不是常规文件 +@msg Script file does not exist 脚本文件不存在 +@msg Script file could not be read 无法读取脚本文件 +@msg Script folder has more than 2,048 entries 脚本文件夹的条目超过 2,048 个 +@msg Script file open mode must be r, w, e or a 脚本文件的打开模式必须是 r、w、e 或 a +@msg Script file writing is not available 脚本文件写入不可用 +@msg Script file dialogs are not available 脚本文件对话框不可用 +@msg Script files cannot be opened in another application 脚本文件无法在其他应用程序中打开 +@msg Script file access is unavailable on the web 网页版无法访问脚本文件 +@msg Script has 256 files open 脚本已打开 256 个文件 +@msg Script file path exceeds 32,767 characters 脚本文件路径超过 32,767 个字符 +@msg Script folder mask takes too many steps to match 脚本文件夹掩码匹配所需步骤过多 +@msg the script opened more file data than one run may open (32 MiB) 脚本打开的文件数据超过了单次运行可打开的上限(32 MiB) +@msg File.seek: takes a position and a mode File.seek:接受一个位置和一个模式 +@msg vc.run: give a command id, as a string vc.run:请以字符串形式提供命令 ID +@msg vc.run: takes a command id and an object of parameters vc.run:接受一个命令 ID 和一个参数对象 +@msg vc.run: the parameters must be an object vc.run:参数必须是对象 +@msg vc.run: the result{place} is too large for a script vc.run:结果{place}对脚本来说过大 +@msg $.evalFile requires a file path $.evalFile 需要文件路径 +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile:超时必须是 0 或更大的有限毫秒数 +@msg $.evalFile: takes a file path and a timeout $.evalFile:接受一个文件路径和一个超时值 +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}:{file} 第 {line} 行,第 {column} 列:{e}(抛出) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}:第 {line} 行,第 {column} 列:{e}(抛出) +@msg {name}: {e} (thrown) {name}:{e}(抛出) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}:{file} 第 {line} 行,第 {column} 列:{e}(限制) +@msg {name}: line {line}, column {column}: {e} (limit) {name}:第 {line} 行,第 {column} 列:{e}(限制) +@msg {name}: {e} (limit) {name}:{e}(限制) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}:{file} 第 {line} 行,第 {column} 列:{e}(语法错误) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}:第 {line} 行,第 {column} 列:{e}(语法错误) +@msg {name}: {e} (syntax) {name}:{e}(语法错误) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}:{file} 第 {line} 行,第 {column} 列:{e}(已停止) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}:第 {line} 行,第 {column} 列:{e}(已停止) +@msg {name}: {e} (stopped) {name}:{e}(已停止) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}:{file} 第 {line} 行,第 {column} 列:{e}(内部错误) +@msg {name}: line {line}, column {column}: {e} (internal) {name}:第 {line} 行,第 {column} 列:{e}(内部错误) +@msg {name}: {e} (internal) {name}:{e}(内部错误) +@msg {e} (these files stay written: {paths}) {e}(这些文件保持已写入状态:{paths}) +@msg $.{name}: give a name, as a string $.{name}:请以字符串形式提供名称 +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale:请提供 "en" 或 "de_DE" 之类的区域设置,或用 null 表示界面的区域设置 +@msg $.localize: give true or false $.localize:请提供 true 或 false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags:只能设置 512(开启本地化)或 0 +@msg $.flags: give a number $.flags:请提供一个数字 +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding:此处脚本只读写 UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding:请以字符串形式提供编码名称 +@msg $.memCache: the memory cache size cannot be set $.memCache:无法设置内存缓存大小 +@msg $.setenv: give a value, as a string $.setenv:请以字符串形式提供值 +@msg $.setenv: only {_1} can be set $.setenv:只能设置 {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv:值最多包含 {MAX_ENV_BYTES} 个字母、数字和 _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep:请提供 0 到 {MAX_SLEEP_MS} 之间的毫秒数 +@msg $.sleep: give a number of milliseconds $.sleep:请提供毫秒数 +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep:运行不能在内置函数的回调、getter、转换或 $.evalFile 运行的文件中等待;请从脚本自身的代码中调用 +@msg $.bp: scripts here have no debugger $.bp:此处脚本没有调试器 +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker:脚本目前还不能显示对话框 +@msg {name}: give a message {name}:请提供消息 +@msg {name}: give the text the field starts with {name}:请提供字段的初始文本 +@msg {name}: the message is longer than 16 KiB {name}:消息超过 16 KiB +@msg {name}: the title is longer than 256 bytes {name}:标题超过 256 字节 +@msg {name}: the text the field starts with is longer than 16 KiB {name}:字段的初始文本超过 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}:对话框不能在内置函数的回调、getter、转换或 $.evalFile 运行的文件中打开;请从脚本自身的代码中调用 +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}:`answers` 中的下一个回答是给 {_1} 的,而不是给 {name} 的 +@msg {name}: `answers` has no answer left for this dialog {name}:`answers` 中已没有此对话框的回答 +@msg vc.document{place} is too large for a script vc.document{place}对脚本来说过大 +@msg vc.log: the log of this run is full vc.log:本次运行的日志已满 +@msg this function's script run has ended 此函数的脚本运行已结束 +@msg the script made more host calls than one run may make 脚本进行的主机调用超过了一次运行允许的数量 +@msg the script passed more data to and from commands than one run may pass 脚本与命令之间传递的数据超过了一次运行允许的数量 +@msg the script added more objects and data to the documents than one run may add 脚本向文档添加的对象和数据超过了一次运行允许的数量 +@msg {what}: the object is not a File or a Folder {what}:该对象既不是 File 也不是 Folder +@msg {what}: the count must be a finite number, 0 or more {what}:数量必须是 0 或更大的有限数 +@msg File.seek: the position must be a finite number File.seek:位置必须是有限数 +@msg File.seek: the mode must be 0, 1 or 2 File.seek:模式必须是 0, 1 或 2 +@msg script file is compiled: {value} 脚本文件已编译:{value} +@msg `name` must be the name of a script engine `name` 必须是脚本引擎的名称 +@msg the main script engine is new for each run and is never kept, so it cannot be dropped 主脚本引擎在每次运行时都是新的,从不保留,因此无法丢弃 +@msg there is no script engine named {name} 没有名为 {name} 的脚本引擎 @msg Running a script 正在运行脚本 @msg Copied the script report 已复制脚本报告 @msg Exported {path} 已导出 {path} diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 83e4eb4a60..68cf343b19 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2477,6 +2477,85 @@ file-filter Templates 範本 @msg the script's run is no longer available 指令碼執行已無法使用 @msg a failed command changed undo steps that could not be put back, so the script was stopped 失敗的命令變更了無法還原的復原步驟,因此指令碼已停止 @msg a recovery copy could not be written, so the script was not run 無法寫入復原副本,因此未執行指令碼 +@msg Script file access denied 指令碼檔案存取遭拒 +@msg Script file exceeds 8 MiB 指令碼檔案超過 8 MiB +@msg Script file is not open 指令碼檔案未開啟 +@msg Script file cannot be decoded 無法解碼指令碼檔案 +@msg Script file is not a regular file 指令碼檔案不是一般檔案 +@msg Script file does not exist 指令碼檔案不存在 +@msg Script file could not be read 無法讀取指令碼檔案 +@msg Script folder has more than 2,048 entries 指令碼資料夾的項目超過 2,048 個 +@msg Script file open mode must be r, w, e or a 指令碼檔案的開啟模式必須是 r、w、e 或 a +@msg Script file writing is not available 無法使用指令碼檔案寫入 +@msg Script file dialogs are not available 無法使用指令碼檔案對話方塊 +@msg Script files cannot be opened in another application 指令碼檔案無法在其他應用程式中開啟 +@msg Script file access is unavailable on the web 網頁版無法存取指令碼檔案 +@msg Script has 256 files open 指令碼已開啟 256 個檔案 +@msg Script file path exceeds 32,767 characters 指令碼檔案路徑超過 32,767 個字元 +@msg Script folder mask takes too many steps to match 指令碼資料夾遮罩比對所需步驟過多 +@msg the script opened more file data than one run may open (32 MiB) 指令碼開啟的檔案資料超過單次執行可開啟的上限(32 MiB) +@msg File.seek: takes a position and a mode File.seek:接受一個位置和一個模式 +@msg vc.run: give a command id, as a string vc.run:請以字串提供命令 ID +@msg vc.run: takes a command id and an object of parameters vc.run:接受一個命令 ID 和一個參數物件 +@msg vc.run: the parameters must be an object vc.run:參數必須是物件 +@msg vc.run: the result{place} is too large for a script vc.run:結果{place}對指令碼來說過大 +@msg $.evalFile requires a file path $.evalFile 需要檔案路徑 +@msg $.evalFile: the timeout must be a finite number of milliseconds, 0 or more $.evalFile:逾時必須是 0 或更大的有限毫秒數 +@msg $.evalFile: takes a file path and a timeout $.evalFile:接受一個檔案路徑和一個逾時值 +@msg {name}: line {line}, column {column} of {file}: {e} (thrown) {name}:{file} 第 {line} 行,第 {column} 欄:{e}(擲回) +@msg {name}: line {line}, column {column}: {e} (thrown) {name}:第 {line} 行,第 {column} 欄:{e}(擲回) +@msg {name}: {e} (thrown) {name}:{e}(擲回) +@msg {name}: line {line}, column {column} of {file}: {e} (limit) {name}:{file} 第 {line} 行,第 {column} 欄:{e}(限制) +@msg {name}: line {line}, column {column}: {e} (limit) {name}:第 {line} 行,第 {column} 欄:{e}(限制) +@msg {name}: {e} (limit) {name}:{e}(限制) +@msg {name}: line {line}, column {column} of {file}: {e} (syntax) {name}:{file} 第 {line} 行,第 {column} 欄:{e}(語法錯誤) +@msg {name}: line {line}, column {column}: {e} (syntax) {name}:第 {line} 行,第 {column} 欄:{e}(語法錯誤) +@msg {name}: {e} (syntax) {name}:{e}(語法錯誤) +@msg {name}: line {line}, column {column} of {file}: {e} (stopped) {name}:{file} 第 {line} 行,第 {column} 欄:{e}(已停止) +@msg {name}: line {line}, column {column}: {e} (stopped) {name}:第 {line} 行,第 {column} 欄:{e}(已停止) +@msg {name}: {e} (stopped) {name}:{e}(已停止) +@msg {name}: line {line}, column {column} of {file}: {e} (internal) {name}:{file} 第 {line} 行,第 {column} 欄:{e}(內部錯誤) +@msg {name}: line {line}, column {column}: {e} (internal) {name}:第 {line} 行,第 {column} 欄:{e}(內部錯誤) +@msg {name}: {e} (internal) {name}:{e}(內部錯誤) +@msg {e} (these files stay written: {paths}) {e}(這些檔案保持已寫入狀態:{paths}) +@msg $.{name}: give a name, as a string $.{name}:請以字串提供名稱 +@msg $.locale: give a locale such as "en" or "de_DE", or null for the interface's $.locale:請提供 "en" 或 "de_DE" 之類的地區設定,或以 null 表示介面的地區設定 +@msg $.localize: give true or false $.localize:請提供 true 或 false +@msg $.flags: only 512, which turns localization on, or 0 can be set $.flags:只能設定 512(開啟在地化)或 0 +@msg $.flags: give a number $.flags:請提供一個數字 +@msg $.appEncoding: scripts here read and write UTF-8 only $.appEncoding:此處指令碼只讀寫 UTF-8 +@msg $.appEncoding: give an encoding's name, as a string $.appEncoding:請以字串提供編碼名稱 +@msg $.memCache: the memory cache size cannot be set $.memCache:無法設定記憶體快取大小 +@msg $.setenv: give a value, as a string $.setenv:請以字串提供值 +@msg $.setenv: only {_1} can be set $.setenv:只能設定 {_1} +@msg $.setenv: a value has at most {MAX_ENV_BYTES} letters, digits and _ . - @ $.setenv:值最多包含 {MAX_ENV_BYTES} 個字母、數字和 _ . - @ +@msg $.sleep: give a number of milliseconds from 0 to {MAX_SLEEP_MS} $.sleep:請提供 0 到 {MAX_SLEEP_MS} 之間的毫秒數 +@msg $.sleep: give a number of milliseconds $.sleep:請提供毫秒數 +@msg $.sleep: a run cannot wait inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code $.sleep:執行不能在內建函式的回呼、getter、轉換或 $.evalFile 執行的檔案中等待;請從指令碼本身的程式碼呼叫 +@msg $.bp: scripts here have no debugger $.bp:此處指令碼沒有偵錯工具 +@msg $.colorPicker: scripts cannot show a dialog yet $.colorPicker:指令碼目前還不能顯示對話框 +@msg {name}: give a message {name}:請提供訊息 +@msg {name}: give the text the field starts with {name}:請提供欄位的初始文字 +@msg {name}: the message is longer than 16 KiB {name}:訊息超過 16 KiB +@msg {name}: the title is longer than 256 bytes {name}:標題超過 256 位元組 +@msg {name}: the text the field starts with is longer than 16 KiB {name}:欄位的初始文字超過 16 KiB +@msg {name}: a dialog cannot open inside a callback of a built-in function, a getter, a conversion or a file $.evalFile runs; call it from the script's own code {name}:對話框不能在內建函式的回呼、getter、轉換或 $.evalFile 執行的檔案中開啟;請從指令碼本身的程式碼呼叫 +@msg {name}: the next answer in `answers` is for {_1}, not {name} {name}:`answers` 中的下一個回答是給 {_1} 的,而不是給 {name} 的 +@msg {name}: `answers` has no answer left for this dialog {name}:`answers` 中已沒有此對話框的回答 +@msg vc.document{place} is too large for a script vc.document{place}對指令碼來說太大 +@msg vc.log: the log of this run is full vc.log:本次執行的記錄已滿 +@msg this function's script run has ended 此函式的指令碼執行已結束 +@msg the script made more host calls than one run may make 指令碼進行的主機呼叫超過一次執行允許的數量 +@msg the script passed more data to and from commands than one run may pass 指令碼與命令之間傳遞的資料超過一次執行允許的數量 +@msg the script added more objects and data to the documents than one run may add 指令碼加入文件的物件和資料超過一次執行允許的數量 +@msg {what}: the object is not a File or a Folder {what}:此物件既不是 File 也不是 Folder +@msg {what}: the count must be a finite number, 0 or more {what}:數量必須是 0 或更大的有限數 +@msg File.seek: the position must be a finite number File.seek:位置必須是有限數 +@msg File.seek: the mode must be 0, 1 or 2 File.seek:模式必須是 0, 1 或 2 +@msg script file is compiled: {value} 指令碼檔案已編譯:{value} +@msg `name` must be the name of a script engine `name` 必須是指令碼引擎的名稱 +@msg the main script engine is new for each run and is never kept, so it cannot be dropped 主指令碼引擎在每次執行時都是新的,從不保留,因此無法捨棄 +@msg there is no script engine named {name} 沒有名為 {name} 的指令碼引擎 @msg Running a script 正在執行指令碼 @msg Copied the script report 已複製指令碼報告 @msg Exported {path} 已匯出 {path} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 8938bfce54..0934a0ad08 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -837,6 +837,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The History panel, Edit › Undo and Edit › Redo translate the names of the steps that apply or redefine a character or paragraph style and of the step that redefines a graphic style: each such step keeps its template (`Apply {name}`, `Redefine {name}`, `Redefine Graphic Style “{name}”`) and the style's name, every complete catalog has a row for each template, and the panel and the menu show the style's name as the document holds it, except the Normal styles' names, which they show in the interface language (`steps_named_after_a_style_list_the_template_around_the_name`, `undo_and_redo_name_a_style_step_around_the_style_name`). - The status bar translates the limits a plug-in run can exceed (its instruction, time and memory budgets and its output size) and the error of a plug-in removal that leaves the plug-in's grant in the plug-in store, in every language that translates every message. The untranslated-strings report also lists messages that an error or a status takes from a `&str` constant (`plugin_limit_errors_are_translated`, `message_scan_reads_messages_held_in_constants`). - The status bar translates the plug-in host's other errors (manifest, module and run checks, the output an importer, exporter or effect returns, and the approval a plug-in's permissions need) in every language that translates every message. A JSON object or array inside a message stays as written, and a message that wraps another one, such as `plug-in manifest: {0}`, is matched by its own row before a row that starts with a placeholder. The reasons inside these errors (what is wrong with a parameter's spec or dialog keys, the value a parameter needs, what is wrong with an object, stroke, paint or effect in a plug-in's output) are translated with them, and the untranslated-strings report lists the reasons the plug-in host's error helpers take (`plugin_messages_are_translated_in_every_complete_catalog`, `plugin_errors_translate_with_their_values`, `plugin_error_reasons_are_translated_with_the_error`, `message_scan_reads_plugin_helpers`, `templates_that_start_with_text_match_first`). + - The status bar translates the errors a script's `File` and `Folder` objects, `vc.run`, `$.evalFile`, the `$` object's properties and functions, `alert`, `confirm` and `prompt`, `vc.document` and `vc.log` raise, the limits a run can pass, and the errors of Drop Script Engine, and the line for a run that fails (a syntax error, a thrown error, a limit, a stop or an internal error, with the script's name, the line and column, the included file it is in and the files left written), in every language that translates every message. The script's name, paths, numbers, command ids and the text a script throws itself are shown as they are. A failure with no line and column, such as an error in code `eval` compiled, is shown with one colon after the script's name (`an_error_without_a_place_names_the_script_and_kind`). A message template that names a value twice matches only when both places hold the same text, so the line for a failed run is not taken for the message inside it (`a_repeated_placeholder_matches_the_same_text`). The untranslated-strings report also lists the messages the script host's `fail`, `value` and `over` helpers take and the errors the script interpreter throws, and a constant's text comes from the file or crate that declares it, so the Scripts menu's headers are not listed as messages (`script_errors_are_translated`, `script_host_errors_are_translated`, `message_scan_reads_script_interpreter_errors`, `message_scan_reads_constants_of_the_file_and_its_crate`, `message_scan_skips_test_modules_with_any_test_cfg`). - Localised UI: menus (in-window and native), panels, dialogs, toolbar and Preferences read from per-language catalogs (`crates/ui-egui/src/i18n`, see `docs/development.md`); Traditional Chinese (Taiwan), Simplified Chinese (mainland), Japanese, Korean, Vietnamese, German, Spanish, French, Italian, Polish, Brazilian Portuguese, Russian, Ukrainian, Georgian and Catalan ship complete, and Czech covers every menu label (and more), with system-locale detection on macOS, Windows, Linux and the web (the browser's languages, or `?lang=`), a Language preference and, on macOS, a VectorCraft ▸ Language menu. Names are never translated (fonts and their styles, layers, artboards, saved presets, user libraries, custom workspaces, recent files, plug-ins). The counts that Package's status and question, the folder search of Missing Fonts and Find Linked Files, the modified and missing linked file prompts and the CSS Properties panel's notes show use the interface language's plural forms instead of a fixed "(s)" form. Evidence: `the_missing_links_note_uses_each_count_form` in `crates/ui-egui/src/dialogs/tests_package.rs`, `the_modified_links_question_uses_each_count_form` in `crates/ui-egui/src/dialogs/missing_links.rs`, `search_counts_use_each_count_form` in `crates/ui-egui/src/dialogs/missing_fonts/tests.rs` and `the_unnamed_objects_note_uses_each_count_form` in `crates/ui-egui/src/panels/tests_css_properties.rs`. The status bar's messages for relinked, replaced, updated and embedded images, broken links, linked files that can't be read or changed on disk, images that can't be decoded, added and unavailable fonts, copied CSS, downloads and exports with their notes name one item in the singular and more in the plural, in English and in each language's plural forms (`counted_status_messages_take_the_plural_form` in `crates/ui-egui/src/i18n/tests.rs`). From b1a35f842880e7047cc75ed33a67cb7742e9dcec Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 16:23:10 -0800 Subject: [PATCH 13/15] Tests: envelope ink tests set type in a test face and check its outlines The three envelope ink tests set "Type" in the default family and unwrapped ink_bounds(). Without bundled fonts, craft-fonts or system fonts (vectorcraft-effects' tests on a bare Linux host), no face draws and the effects test panicked at the unwrap. Each test now adds the Heighttest Sans face built from the bundled Source Sans 3 (test-fonts feature, now also on vectorcraft-effects' dev-dependency), sets the text in it, and computes the expected box from the layout's glyph outlines. It checks that envelope_ink gives that box as well as the before and after registration boxes, so a change to the registered measure fails the test. --- crates/effects/Cargo.toml | 2 ++ crates/effects/tests/envelope_ink.rs | 24 +++++++++++++++++++++--- crates/eps/tests/envelope_ink.rs | 24 +++++++++++++++++++++--- crates/render/tests/envelope_ink.rs | 24 +++++++++++++++++++++--- 4 files changed, 65 insertions(+), 9 deletions(-) diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index 4078312855..d5821607ec 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -26,3 +26,5 @@ serde_json = { workspace = true } [dev-dependencies] vectorcraft-color = { workspace = true } +# A face built in code from the bundled Source Sans 3 (no font file is committed). +vectorcraft-text = { workspace = true, features = ["test-fonts"] } diff --git a/crates/effects/tests/envelope_ink.rs b/crates/effects/tests/envelope_ink.rs index a95906cc1b..45ac0fb64d 100644 --- a/crates/effects/tests/envelope_ink.rs +++ b/crates/effects/tests/envelope_ink.rs @@ -6,20 +6,38 @@ use std::sync::Arc; use vectorcraft_doc::{CharStyle, Node, NodeId, NodeKind, TextObject}; -use vectorcraft_geom::{Point, Rect}; +use vectorcraft_geom::{Point, Rect, Shape}; +use vectorcraft_text::test_fonts::{HEIGHT_FAMILY, height_font}; /// The largest distance between the edges of `a` and `b`. fn off(a: Rect, b: Rect) -> f64 { [a.x0 - b.x0, a.y0 - b.y0, a.x1 - b.x1, a.y1 - b.y1].iter().fold(0.0f64, |m, v| m.max(v.abs())) } +/// "Type" at 48 pt in a face the test adds, so its glyphs draw on a machine without craft-fonts or +/// system fonts. +fn type_in_test_face() -> TextObject { + assert!(vectorcraft_text::FontDb::global().add_font(height_font(true).unwrap()) > 0, "the test face loads"); + TextObject::point(Point::new(10.0, 60.0), "Type", CharStyle { font_family: HEIGHT_FAMILY.into(), size: 48.0, ..Default::default() }) +} + +/// The box of the outlines `t`'s glyphs draw, in document space, measured glyph by glyph. +fn outline_box(t: &TextObject) -> Rect { + let laid = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), t); + let outlines: Vec = laid.glyphs.iter().filter(|g| !g.outline.elements().is_empty()).map(|g| (t.xf * &g.outline).bounding_box()).collect(); + assert_eq!(outlines.len(), 4, "every glyph of \"Type\" draws an outline"); + outlines.into_iter().reduce(|a, b| a.union(b)).unwrap() +} + #[test] fn live_evaluation_measures_type_in_envelopes_by_its_glyphs() { - let t = TextObject::point(Point::new(10.0, 60.0), "Type", CharStyle { size: 48.0, ..Default::default() }); + let t = type_in_test_face(); let n = Arc::new(Node::new(NodeId(1), NodeKind::Text(Box::new(t.clone())))); let laid = n.geometric_bounds().unwrap(); - let ink = t.xf.transform_rect_bbox(vectorcraft_text::layout(vectorcraft_text::FontDb::global(), &t).ink_bounds().unwrap()); + let ink = outline_box(&t); assert!(laid.height() - ink.height() > 1.0, "the laid-out box {laid:?} reaches past the glyphs {ink:?}"); + let measured = vectorcraft_text::envelope_ink(&t, t.xf, None).unwrap(); + assert!(off(measured, ink) < 1e-6, "the envelope measure gives the glyphs' box: {measured:?} vs {ink:?}"); let before = vectorcraft_doc::live::envelope_content_bounds(std::slice::from_ref(&n)).unwrap(); assert!(off(before, laid) < 1e-6, "with nothing registered, type keeps its laid-out box: {before:?} vs {laid:?}"); diff --git a/crates/eps/tests/envelope_ink.rs b/crates/eps/tests/envelope_ink.rs index eccbf8a8f0..3086043238 100644 --- a/crates/eps/tests/envelope_ink.rs +++ b/crates/eps/tests/envelope_ink.rs @@ -6,20 +6,38 @@ use std::sync::Arc; use vectorcraft_doc::{CharStyle, Node, NodeId, NodeKind, TextObject}; -use vectorcraft_geom::{Point, Rect}; +use vectorcraft_geom::{Point, Rect, Shape}; +use vectorcraft_text::test_fonts::{HEIGHT_FAMILY, height_font}; /// The largest distance between the edges of `a` and `b`. fn off(a: Rect, b: Rect) -> f64 { [a.x0 - b.x0, a.y0 - b.y0, a.x1 - b.x1, a.y1 - b.y1].iter().fold(0.0f64, |m, v| m.max(v.abs())) } +/// "Type" at 48 pt in a face the test adds, so its glyphs draw on a machine without craft-fonts or +/// system fonts. +fn type_in_test_face() -> TextObject { + assert!(vectorcraft_text::FontDb::global().add_font(height_font(true).unwrap()) > 0, "the test face loads"); + TextObject::point(Point::new(10.0, 60.0), "Type", CharStyle { font_family: HEIGHT_FAMILY.into(), size: 48.0, ..Default::default() }) +} + +/// The box of the outlines `t`'s glyphs draw, in document space, measured glyph by glyph. +fn outline_box(t: &TextObject) -> Rect { + let laid = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), t); + let outlines: Vec = laid.glyphs.iter().filter(|g| !g.outline.elements().is_empty()).map(|g| (t.xf * &g.outline).bounding_box()).collect(); + assert_eq!(outlines.len(), 4, "every glyph of \"Type\" draws an outline"); + outlines.into_iter().reduce(|a, b| a.union(b)).unwrap() +} + #[test] fn reading_an_ai_file_measures_type_in_envelopes_by_its_glyphs() { - let t = TextObject::point(Point::new(10.0, 60.0), "Type", CharStyle { size: 48.0, ..Default::default() }); + let t = type_in_test_face(); let n = Arc::new(Node::new(NodeId(1), NodeKind::Text(Box::new(t.clone())))); let laid = n.geometric_bounds().unwrap(); - let ink = t.xf.transform_rect_bbox(vectorcraft_text::layout(vectorcraft_text::FontDb::global(), &t).ink_bounds().unwrap()); + let ink = outline_box(&t); assert!(laid.height() - ink.height() > 1.0, "the laid-out box {laid:?} reaches past the glyphs {ink:?}"); + let measured = vectorcraft_text::envelope_ink(&t, t.xf, None).unwrap(); + assert!(off(measured, ink) < 1e-6, "the envelope measure gives the glyphs' box: {measured:?} vs {ink:?}"); let before = vectorcraft_doc::live::envelope_content_bounds(std::slice::from_ref(&n)).unwrap(); assert!(off(before, laid) < 1e-6, "with nothing registered, type keeps its laid-out box: {before:?} vs {laid:?}"); diff --git a/crates/render/tests/envelope_ink.rs b/crates/render/tests/envelope_ink.rs index 7622143f50..512f56398b 100644 --- a/crates/render/tests/envelope_ink.rs +++ b/crates/render/tests/envelope_ink.rs @@ -7,20 +7,38 @@ use std::sync::Arc; use vectorcraft_doc::{CharStyle, Node, NodeId, NodeKind, TextObject}; -use vectorcraft_geom::{Point, Rect}; +use vectorcraft_geom::{Point, Rect, Shape}; +use vectorcraft_text::test_fonts::{HEIGHT_FAMILY, height_font}; /// The largest distance between the edges of `a` and `b`. fn off(a: Rect, b: Rect) -> f64 { [a.x0 - b.x0, a.y0 - b.y0, a.x1 - b.x1, a.y1 - b.y1].iter().fold(0.0f64, |m, v| m.max(v.abs())) } +/// "Type" at 48 pt in a face the test adds, so its glyphs draw on a machine without craft-fonts or +/// system fonts. +fn type_in_test_face() -> TextObject { + assert!(vectorcraft_text::FontDb::global().add_font(height_font(true).unwrap()) > 0, "the test face loads"); + TextObject::point(Point::new(10.0, 60.0), "Type", CharStyle { font_family: HEIGHT_FAMILY.into(), size: 48.0, ..Default::default() }) +} + +/// The box of the outlines `t`'s glyphs draw, in document space, measured glyph by glyph. +fn outline_box(t: &TextObject) -> Rect { + let laid = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), t); + let outlines: Vec = laid.glyphs.iter().filter(|g| !g.outline.elements().is_empty()).map(|g| (t.xf * &g.outline).bounding_box()).collect(); + assert_eq!(outlines.len(), 4, "every glyph of \"Type\" draws an outline"); + outlines.into_iter().reduce(|a, b| a.union(b)).unwrap() +} + #[test] fn a_new_renderer_measures_type_in_envelopes_by_its_glyphs() { - let t = TextObject::point(Point::new(10.0, 60.0), "Type", CharStyle { size: 48.0, ..Default::default() }); + let t = type_in_test_face(); let n = Arc::new(Node::new(NodeId(1), NodeKind::Text(Box::new(t.clone())))); let laid = n.geometric_bounds().unwrap(); - let ink = t.xf.transform_rect_bbox(vectorcraft_text::layout(vectorcraft_text::FontDb::global(), &t).ink_bounds().unwrap()); + let ink = outline_box(&t); assert!(laid.height() - ink.height() > 1.0, "the laid-out box {laid:?} reaches past the glyphs {ink:?}"); + let measured = vectorcraft_text::envelope_ink(&t, t.xf, None).unwrap(); + assert!(off(measured, ink) < 1e-6, "the envelope measure gives the glyphs' box: {measured:?} vs {ink:?}"); let before = vectorcraft_doc::live::envelope_content_bounds(std::slice::from_ref(&n)).unwrap(); assert!(off(before, laid) < 1e-6, "with nothing registered, type keeps its laid-out box: {before:?} vs {laid:?}"); From 7764da6ad85e9d5f2580b91e08b40c107e3b4312 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 16:27:30 -0800 Subject: [PATCH 14/15] Updates: Runtime derives Default on wasm32, so wasm32 clippy passes `cargo clippy --target wasm32-unknown-unknown -p vectorcraft-ui-egui -- -D warnings` stopped twice. In vectorcraft-text, MAX_FILE_SEARCHES is used only by the system font search, which is not compiled for wasm32, so it was dead code there. In vectorcraft-ui-egui, Runtime holds only manual_window_open and status_message on wasm32, and the hand-written Default set them to false and None, so clippy's derivable_impls stopped the run. - MAX_FILE_SEARCHES is compiled only for targets other than wasm32, like the SysFallback struct next to it. - Runtime derives Default on wasm32, and the hand-written Default, which creates the updater, is compiled only for other targets. --- crates/text/src/fontdb/names.rs | 1 + crates/ui-egui/src/updates_ui.rs | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/crates/text/src/fontdb/names.rs b/crates/text/src/fontdb/names.rs index 7531b130ec..47faeeddae 100644 --- a/crates/text/src/fontdb/names.rs +++ b/crates/text/src/fontdb/names.rs @@ -15,6 +15,7 @@ pub(super) struct SysFallback { /// The most characters searched for in the font files themselves between two scans of the font /// folders. Real text has a few uncovered characters; a document of thousands of distinct /// private-use code points would reread the whole catalog for each. +#[cfg(not(target_arch = "wasm32"))] pub(super) const MAX_FILE_SEARCHES: u32 = 1024; /// Fonts made for Thai, tried first (when installed) for Thai the font in use lacks: Windows diff --git a/crates/ui-egui/src/updates_ui.rs b/crates/ui-egui/src/updates_ui.rs index 77a00c33a5..41f5e68372 100644 --- a/crates/ui-egui/src/updates_ui.rs +++ b/crates/ui-egui/src/updates_ui.rs @@ -9,6 +9,7 @@ use craft_update::updater::{Action, Status, Updater}; #[cfg(not(target_arch = "wasm32"))] use craft_update::{CheckResultDialog, CheckResultResponse}; +#[cfg_attr(target_arch = "wasm32", derive(Default))] pub(crate) struct Runtime { #[cfg(not(target_arch = "wasm32"))] updater: Updater, @@ -30,23 +31,15 @@ pub(crate) struct Runtime { pub(crate) status_message: Option, } +#[cfg(not(target_arch = "wasm32"))] impl Default for Runtime { fn default() -> Self { Self { - #[cfg(not(target_arch = "wasm32"))] updater: Updater::new(&crate::UPDATE_APP, env!("CARGO_PKG_VERSION")), - #[cfg(not(target_arch = "wasm32"))] startup_check: false, - #[cfg(not(target_arch = "wasm32"))] check_requested: false, - #[cfg(not(target_arch = "wasm32"))] repaint: None, - #[cfg(not(target_arch = "wasm32"))] was_blocking: false, - #[cfg(target_arch = "wasm32")] - manual_window_open: false, - #[cfg(target_arch = "wasm32")] - status_message: None, } } } From 9b65bf2708db2cbf746253f69ca0d750960784b1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 16:28:54 -0800 Subject: [PATCH 15/15] 3D: a fill or stroke without the effect keeps an even-odd path's holes With a 3D effect on one fill or stroke, the object's other fills and strokes were drawn as nonzero paths, so an even-odd compound path or path filled its holes in them. Extrude & Bevel, Inflate, Rotate, Revolve and their Classic kinds now draw those items with the source's fill rule, through the group code's shape_node helper. --- crates/effects/src/group.rs | 2 +- crates/effects/src/revolve.rs | 51 +++++++++++++++++++++++- crates/effects/src/solids.rs | 3 +- crates/effects/src/solids/tests.rs | 62 ++++++++++++++++++++++++++++++ docs/target-app-parity.md | 1 + 5 files changed, 115 insertions(+), 4 deletions(-) diff --git a/crates/effects/src/group.rs b/crates/effects/src/group.rs index 0f61fda674..959bd5e857 100644 --- a/crates/effects/src/group.rs +++ b/crates/effects/src/group.rs @@ -689,7 +689,7 @@ pub fn member_shapes(doc: Option<&Document>, n: &Node) -> Vec<(PathData, FillRul } /// A path node of `id` on `path` (filled under `rule`) painted by `ap`. -fn shape_node(id: NodeId, path: PathData, rule: FillRule, ap: Appearance) -> Node { +pub(crate) fn shape_node(id: NodeId, path: PathData, rule: FillRule, ap: Appearance) -> Node { let mut n = Node::path(id, path, ap); if let NodeKind::Path { rule: r, .. } = &mut n.kind { *r = rule; diff --git a/crates/effects/src/revolve.rs b/crates/effects/src/revolve.rs index 0006e5362f..b5a46b0a9b 100644 --- a/crates/effects/src/revolve.rs +++ b/crates/effects/src/revolve.rs @@ -594,7 +594,7 @@ fn art(doc: Option<&Document>, n: &Node, expand: bool) -> Option { if is_container(n) { return group_art(n, expand); } - let (path, _) = profile(n)?; + let (path, rule) = profile(n)?; let ctx = GeomContext::of(n); let mut children = vec![]; let mut copies = 0; @@ -640,7 +640,8 @@ fn art(doc: Option<&Document>, n: &Node, expand: bool) -> Option { } children.push(Arc::new(art)); } else { - children.push(Arc::new(Node::path(n.id, path.clone(), Appearance { items: vec![item.clone()], ..Default::default() }))); + let flat = Appearance { items: vec![item.clone()], ..Default::default() }; + children.push(Arc::new(crate::group::shape_node(n.id, path.clone(), rule, flat))); } } children.splice(0..0, shadows); @@ -1022,6 +1023,52 @@ mod tests { assert!(surface.children().unwrap().iter().all(|c| c.opacity == 1.0 && !has_revolve(c))); } #[test] + fn a_fill_without_the_revolve_keeps_the_even_odd_hole() { + use vectorcraft_geom::FillRule; + use vectorcraft_geom::hit::fill_contains; + // Two nested squares drawn in the same direction: only the even-odd rule leaves a hole. + let [outer, inner] = [(100.0, 200.0), (130.0, 170.0)].map(|(lo, hi)| { + let mut b = BezPath::new(); + b.move_to((lo, lo)); + b.line_to((hi, lo)); + b.line_to((hi, hi)); + b.line_to((lo, hi)); + b.close_path(); + PathData::from_bezpath(&b) + }); + let flat = AppearanceItem::Fill(FillLayer::new(Paint::solid(Color::rgb(0.1, 0.3, 0.9)))); + for id in [REVOLVE, CLASSIC_REVOLVE] { + let mut top = AppearanceItem::Fill(FillLayer::new(Paint::solid(Color::rgb(0.8, 0.2, 0.1)))); + top.effects_mut().push(crate::new_effect(id, &json!({})).unwrap()); + let appearance = Appearance { items: vec![flat.clone(), top], ..Default::default() }; + let members = vec![ + Arc::new(Node::path(NodeId(2), outer.clone(), Appearance::default())), + Arc::new(Node::path(NodeId(3), inner.clone(), Appearance::default())), + ]; + let mut compound = Node::new(NodeId(1), NodeKind::Compound { children: members, rule: FillRule::EvenOdd }); + compound.appearance = appearance.clone().into(); + let both = PathData::new(outer.subpaths.iter().chain(&inner.subpaths).cloned().collect()); + let path = crate::group::shape_node(NodeId(1), both, FillRule::EvenOdd, appearance); + for (n, shape) in [(compound, "compound path"), (path, "path")] { + for (art, how) in [(revolve_art(&n), "live"), (expand_revolve_art(&n), "expanded")] { + let what = format!("{id} on the top fill of a {shape}, {how}"); + let art = art.unwrap_or_else(|| panic!("{what}")); + let children = art.children().unwrap(); + let plain: Vec = (0..children.len()) + .filter(|&i| children[i].appearance.items == [flat.clone()] && children[i].path_data().is_some()) + .collect(); + let [index] = plain[..] else { panic!("{what}: one flat child, got {plain:?}") }; + let NodeKind::Path { path, rule, .. } = &children[index].kind else { panic!("{what}: a path") }; + assert_eq!(*rule, FillRule::EvenOdd, "{what}"); + let bez = path.to_bezpath(); + assert!(fill_contains(&bez, *rule, Point::new(110.0, 150.0)), "{what}: the ring is filled"); + assert!(!fill_contains(&bez, *rule, Point::new(150.0, 150.0)), "{what}: the hole stays open"); + assert!(index + 1 < children.len(), "{what}: the revolved art is drawn above"); + } + } + } + } + #[test] fn export_bakes_faces_with_unique_ids_and_no_revolve_effects() { let mut d = Document::new(300.0, 300.0); let mut n = profile_node(); diff --git a/crates/effects/src/solids.rs b/crates/effects/src/solids.rs index e4fb218604..93679ca71d 100644 --- a/crates/effects/src/solids.rs +++ b/crates/effects/src/solids.rs @@ -1197,7 +1197,8 @@ pub fn solid_art_in(doc: Option<&Document>, n: &Node) -> Option { shadows.extend(shadow.into_iter().map(with_later)); children.extend(surfaces.into_iter().map(with_later)); } else { - children.push(Arc::new(Node::path(n.id, path.clone(), Appearance { items: vec![item.clone()], ..Default::default() }))); + let flat = Appearance { items: vec![item.clone()], ..Default::default() }; + children.push(Arc::new(crate::group::shape_node(n.id, path.clone(), rule, flat))); } } children.splice(0..0, shadows); diff --git a/crates/effects/src/solids/tests.rs b/crates/effects/src/solids/tests.rs index 1efe826c75..5041f01bb2 100644 --- a/crates/effects/src/solids/tests.rs +++ b/crates/effects/src/solids/tests.rs @@ -457,6 +457,68 @@ fn transparency_stays_on_the_whole_surface_and_items_take_their_own_effect() { assert!(matches!(surfaces[1].kind, NodeKind::Path { .. })); } +/// Two nested squares drawn in the same direction, so only the even-odd rule leaves a hole. +fn nested_squares() -> [PathData; 2] { + [(100.0, 200.0), (130.0, 170.0)].map(|(lo, hi)| { + let mut b = BezPath::new(); + b.move_to((lo, lo)); + b.line_to((hi, lo)); + b.line_to((hi, hi)); + b.line_to((lo, hi)); + b.close_path(); + PathData::from_bezpath(&b) + }) +} + +/// The nested squares as an even-odd compound path and as one even-odd path, painted by `items`. +fn even_odd_shapes(items: Vec) -> [Node; 2] { + let [outer, inner] = nested_squares(); + let appearance = Appearance { items, ..Default::default() }; + let children = vec![ + Arc::new(Node::path(NodeId(2), outer.clone(), Appearance::default())), + Arc::new(Node::path(NodeId(3), inner.clone(), Appearance::default())), + ]; + let mut compound = Node::new(NodeId(1), NodeKind::Compound { children, rule: FillRule::EvenOdd }); + compound.appearance = appearance.clone().into(); + let both = PathData::new(outer.subpaths.into_iter().chain(inner.subpaths).collect()); + [compound, crate::group::shape_node(NodeId(1), both, FillRule::EvenOdd, appearance)] +} + +/// Check that `art` draws `item` as one flat child: an even-odd path with a hole in the middle, +/// below the 3D art after it. +fn assert_flat_item_keeps_the_hole(art: &Node, item: &AppearanceItem, what: &str) { + use vectorcraft_geom::hit::fill_contains; + let children = art.children().unwrap(); + let flat: Vec = + (0..children.len()).filter(|&i| children[i].appearance.items == [item.clone()] && children[i].path_data().is_some()).collect(); + let [index] = flat[..] else { panic!("{what}: one flat child, got {flat:?}") }; + let NodeKind::Path { path, rule, .. } = &children[index].kind else { panic!("{what}: a path") }; + assert_eq!(*rule, FillRule::EvenOdd, "{what}"); + let bez = path.to_bezpath(); + assert!(fill_contains(&bez, *rule, Point::new(110.0, 150.0)), "{what}: the ring is filled"); + assert!(!fill_contains(&bez, *rule, Point::new(150.0, 150.0)), "{what}: the hole stays open"); + assert!(index + 1 < children.len(), "{what}: the 3D art is drawn above"); +} + +#[test] +fn a_fill_or_stroke_without_the_effect_keeps_the_even_odd_hole() { + let red = AppearanceItem::Fill(vectorcraft_doc::FillLayer::new(Paint::solid(RED))); + let blue = AppearanceItem::Fill(vectorcraft_doc::FillLayer::new(Paint::solid(BLUE))); + let stroke = AppearanceItem::Stroke(StrokeLayer::new(Paint::solid(Color::BLACK), 4.0)); + for id in SOLIDS { + // The top fill and then the top stroke take the effect; the fill below stays flat. + for (top, on) in [(&red, "fill"), (&stroke, "stroke")] { + let mut lifted = top.clone(); + lifted.effects_mut().push(fx(id, json!({}))); + for (n, shape) in even_odd_shapes(vec![blue.clone(), lifted]).into_iter().zip(["compound path", "path"]) { + let what = format!("{id} on the top {on} of a {shape}"); + let art = solid_art(&n).unwrap_or_else(|| panic!("{what}")); + assert_flat_item_keeps_the_hole(&art, &blue, &what); + } + } + } +} + #[test] fn export_and_expand_bake_faces_with_their_own_ids() { for id in SOLIDS { diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 8938bfce54..44b40703dc 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1152,6 +1152,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Divide uses open lines, bent paths and curves as cutting edges (#1307), preserving the frontmost filled face's appearance and holes. Engine tests cover implicit closure of filled open contours and unrelated objects; native automation confirms independent piece movement, one Undo/Redo, canvas/window captures and an exact saved-document read by a separate CLI process. The shared planar map keeps a segment cap (65,536 since #937, was 4,096) and its filled-area fallback; other Pathfinder operations are unchanged. - Type that Transform effects only move and copy (no scale, rotation, reflection or Random) exports as type in each place, and PDF export writes every copy as selectable, searchable text, when its characters are in solid colors without underline or strikethrough, the type object has no fills or strokes of its own, no inline graphics and no perspective, its transform does not scale or shear stroked characters, and the copies do not overlap. When the effect is on the type itself, the type can also have transparency, an opacity mask and raster effects. When the effect is on the group or layer holding the type, the type has no transparency or effects of its own and is not in a clipping path, the group or layer has no fill, stroke or Pathfinder effect of its own, and no group between them has a fill, stroke, Pathfinder or geometry effect. Type still exports as outlines when the effect stops its copies early, or when the copies would number more than 10,000 or take more than 20,000,000 bytes of document data, and so does other type under a geometry effect. - Extrude & Bevel and Inflate treat strokes as outlined: each visible stroke builds a solid from its outline in its own paint beside the top fill's ([three-d.md](three-d.md#fills-and-strokes)). + - A 3D effect on one fill or stroke ([the help page](https://helpx.adobe.com/illustrator/using/effects.html)) leaves the object's other fills and strokes drawn with the path's or compound path's fill rule, so an even-odd compound path keeps its holes in them; this holds for Extrude & Bevel, Inflate, Rotate and Revolve, and for the Classic Extrude & Bevel, Rotate and Revolve. Tests: `solids::tests::a_fill_or_stroke_without_the_effect_keeps_the_even_odd_hole`, `revolve::tests::a_fill_without_the_revolve_keeps_the_even_odd_hole`. - With caps and opaque paint, Extrude & Bevel (both kinds) and Inflate draw each side face of the fill's solid before the faces of the same object's strokes that overlap it (strokes on closed paths without dashes, a width profile or a brush, in a solid color or an opaque gradient), so the stroke's walls cover the fill's walls at concave corners instead of showing stripes of the fill. Tests: `solids::tests::a_fills_walls_are_drawn_before_the_stroke_faces_over_them`, `solids::tests::the_draw_order_moves_a_fill_wall_before_the_stroke_faces_it_overlaps`, `solid::tests::facets_tell_the_sides_from_the_ends_and_the_faces_turned_away`. - Extrude & Bevel, Inflate and Rotate apply to type: it makes a solid of its glyph outlines, painted with its own fills and strokes or, when it has none, its characters' colour (the first run's), and stays type, so editing the text reshapes the solid (#4715). - Extrude & Bevel, Inflate and Rotate (Effect › 3D and Materials): live effects in the `three-d` crate with depth, twist, taper, solid or hollow caps, five original bevel shapes (width, height, repeat, spacing, inside, both sides), Inflate's volume, both sides, twist, taper and cap, Rotate's turned fills and strokes, Position presets, the rotation and light gizmos, SVG/PDF vector output and Expand Appearance; one 3D effect per object; covered by geometry, effect, canvas-versus-export, command and dialog tests ([three-d.md](three-d.md)).