Merge remote-tracking branch 'upstream/main' into feat/view-zoom-to-selection-5601

# Conflicts:
#	docs/ui-parity.md
This commit is contained in:
Don Omondi committed 2026-11-06 02:41:26 -05:00
commit c5407dc5aa
68 files changed
+10765 -190

No files matched your search

+3 -2
View File
@@ -14,7 +14,7 @@
**Stage: alpha** · next: beta, ~13 points (ready for real work ~62% → ~75%, and reliable `.ai` exchange) and ~170–270 h away
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-05 · **Change:** minor (Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
VectorCraft is a clean-room, open-source, pure-Rust reimplementation of the Adobe Illustrator workflow. It runs
on macOS, Windows, Linux, FreeBSD and the web (WASM), and agents can drive all of it over MCP, the CLI and a JSON
@@ -107,7 +107,7 @@ Weights, evidence and the missing items per area: [target-app-parity.md](docs/ta
| English | `en` | full | 100% |
| Simplified Chinese | `zh-hans` | partial (messages in English) | 85% |
| Spanish | `es` | full | 100% |
| Hindi | `hi` | none | 0% |
| Hindi | `hi` | catalog complete; machine-assisted draft, native review pending | complete under the scanner |
| Arabic | `ar` | none (no right-to-left interface) | 0% |
| French | `fr` | full | 100% |
| Portuguese (Brazil) | `pt-br` | full | 100% |
@@ -223,6 +223,7 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | minor | Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged |
| 2026-11-05 | minor | Progress log row for the Type Tools add-on's Release Type on a Path (#5532); headline numbers unchanged. |
| 2026-11-03 | minor | Progress log row for the Type Tools add-on's Text Tweaker (#4924); headline numbers unchanged. |
| 2026-11-02 | minor | Closed font-family fields accept wheel input for selected text in Character, Properties and Control (#5253); scores and estimates unchanged. |
+77 -2
View File
@@ -6,9 +6,10 @@ use std::rc::Rc;
use std::sync::{Arc, OnceLock};
use vectorcraft_geom::hit::{fill_contains, stroke_contains};
use vectorcraft_geom::{BezPath, FillRule, Point, Rect};
use vectorcraft_geom::kurbo::ParamCurveNearest;
use vectorcraft_geom::{BezPath, FillRule, PathData, PathSeg, Point, Rect};
use crate::{AppearanceItem, Document, Node, NodeId, NodeKind, SymbolBoxes};
use crate::{AppearanceItem, Document, Node, NodeId, NodeKind, StrokeAlign, SymbolBoxes};
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HitKind {
@@ -724,6 +725,43 @@ fn hit_stroke(n: &Node, bp: &vectorcraft_geom::BezPath, rule: vectorcraft_geom::
stroke_contains(bp, 0.0, opt.tol, p).then_some(HitKind::Outline)
}
/// Check the body without assembling a `BezPath`. A miss near a joint or cap may still hit a
/// miter or square cap, so the caller falls back to the full stroke check there.
fn near_path_body(path: &PathData, p: Point, radius: f64, decoration_reach: f64) -> Option<(bool, bool)> {
if !radius.is_finite() || radius < 0.0 || !decoration_reach.is_finite() || decoration_reach < 0.0 {
return None;
}
let radius_sq = radius * radius;
let decoration_sq = decoration_reach * decoration_reach;
let mut near_decoration = false;
for sp in &path.subpaths {
for i in 0..sp.segment_count() {
let c = sp.segment(i);
if decoration_reach > 0.0 && !near_decoration && ([c.p0, c.p3].iter().any(|q| (*q - p).hypot2() <= decoration_sq)) {
near_decoration = true;
}
let controls = [c.p0, c.p1, c.p2, c.p3];
if controls.iter().all(|q| q.x < p.x - radius)
|| controls.iter().all(|q| q.x > p.x + radius)
|| controls.iter().all(|q| q.y < p.y - radius)
|| controls.iter().all(|q| q.y > p.y + radius)
{
continue;
}
let seg = if sp.segment_is_line(i) { PathSeg::Line(vectorcraft_geom::kurbo::Line::new(c.p0, c.p3)) } else { PathSeg::Cubic(c) };
if seg.nearest(p, 1e-9).distance_sq <= radius_sq {
if vectorcraft_geom::bez::has_length(&seg) {
return Some((true, near_decoration));
}
// A zero-length segment can still hit as an outline, though a painted stroke
// needs a segment with direction. Let the existing check decide its hit kind.
near_decoration = true;
}
}
}
Some((false, near_decoration))
}
#[cfg(test)]
thread_local! {
/// How many objects [`hit_leaf`] tested on this thread.
@@ -735,6 +773,43 @@ fn hit_leaf(n: &Node, p: Point, opt: HitOptions, symbols: &SymbolBoxes) -> Optio
LEAVES_TESTED.with(|c| c.set(c.get() + 1));
match &n.kind {
NodeKind::Path { path, rule, .. } => {
if opt.outline
&& let Some((hit, needs_full_check)) = near_path_body(path, p, opt.tol, 0.0)
{
if hit {
return Some(HitKind::Outline);
}
if !needs_full_check {
return None;
}
}
let mut strokes = n.appearance.painted_strokes();
if !opt.outline
&& n.appearance.fill().is_none_or(|f| f.paint.is_none())
&& let Some(s) = strokes.next()
&& strokes.next().is_none()
&& s.align == StrokeAlign::Center
&& s.width.is_finite()
&& s.width > 0.0
&& s.dash.as_ref().is_none_or(|d| !d.is_dashed())
&& s.profile.is_none()
&& s.start_arrow.is_none()
&& s.end_arrow.is_none()
&& s.brush.is_none()
&& let Some((hit, near_decoration)) = near_path_body(
path,
p,
s.width / 2.0 + opt.tol,
if s.join == crate::LineJoin::Miter || s.cap == crate::LineCap::Square { s.reach() + opt.tol } else { 0.0 },
)
{
if hit {
return Some(HitKind::Stroke);
}
if !near_decoration {
return None;
}
}
let bp = path.to_bezpath();
if let Some(k) = hit_stroke(n, &bp, *rule, p, opt) {
return Some(k);
+33
View File
@@ -38,6 +38,39 @@ fn unfilled_interior_misses() {
assert!(hit_test(&d, Point::new(50.5, 25.0), HitOptions::default()).is_some());
}
#[test]
fn long_plain_stroke_hits_its_middle_and_curved_end() {
let mut d = Document::new(200.0, 200.0);
let l = d.layers[0].id;
let id = d.alloc_id();
let mut sp = vectorcraft_geom::SubPath::polyline(&(0..=4097).map(|i| Point::new(i as f64 * 10.0, 0.0)).collect::<Vec<_>>(), false);
sp.anchors[4096].h_out = Point::new(40960.0, 100.0);
sp.anchors[4097].h_in = Point::new(40970.0, 100.0);
sp.anchors.push(vectorcraft_geom::Anchor::corner(Point::new(40970.0, 100.0)));
sp.anchors.push(vectorcraft_geom::Anchor::corner(Point::new(0.0, 100.0)));
let path = vectorcraft_geom::PathData::single(sp);
let look = Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
d.insert(Some(l), 0, Node::path(id, path, look)).unwrap();
let outline = HitOptions { outline: true, ..Default::default() };
for point in [Point::new(20485.0, 0.0), Point::new(40965.0, 75.0)] {
assert_eq!(hit_test(&d, point, HitOptions::default()).map(|h| h.kind), Some(HitKind::Stroke));
assert_eq!(hit_test(&d, point, outline).map(|h| h.kind), Some(HitKind::Outline));
}
assert!(hit_test(&d, Point::new(20485.0, 50.0), HitOptions::default()).is_none());
}
#[test]
fn coincident_anchors_remain_hittable_as_an_outline() {
let mut d = Document::new(200.0, 200.0);
let id = d.alloc_id();
let path = vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(50.0, 50.0); 2], false));
let look = Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
d.insert(d.layers.first().map(|l| l.id), 0, Node::path(id, path, look)).unwrap();
let at = Point::new(50.0, 50.0);
assert_eq!(hit_test(&d, at, HitOptions::default()).map(|h| h.kind), Some(HitKind::Outline));
assert_eq!(hit_test(&d, at, HitOptions { outline: true, ..Default::default() }).map(|h| h.kind), Some(HitKind::Outline));
}
/// #1103: a marquee drawn over a background picks what is on it, not the background, whose
/// outline it doesn't touch.
#[test]
+10 -1
View File
@@ -19,7 +19,7 @@ mod width;
use std::borrow::Cow;
use kurbo::{BezPath, ParamCurve, ParamCurveNearest, PathEl, PathSeg, Shape};
use kurbo::{BezPath, ParamCurve, ParamCurveNearest, PathEl, PathSeg, Rect, Shape};
use vectorcraft_doc::{LineCap, LineJoin, StrokeAlign, StrokeLayer};
pub(crate) use vectorcraft_geom::bez::{kink, segments, subpaths, tangent, unit};
@@ -120,6 +120,15 @@ pub fn line_outline(line: &BezPath, st: &StrokeLayer, width: f64, tol: f64) -> B
}
}
/// The variable-width outline near `near`, with its profile positions measured on the whole
/// undashed line. Returns `None` when no segment is omitted or the stroke is dashed.
pub fn line_outline_profile_near(line: &BezPath, st: &StrokeLayer, width: f64, tol: f64, near: Rect) -> Option<BezPath> {
if st.dash.is_some() || line.elements().is_empty() || width <= 0.0 || !width.is_finite() {
return None;
}
width::width_outline_near(line, width, st.profile.as_ref()?, st, tol, near)
}
/// [`line_outline`] of a dashed line without a width profile, made of only the dashes and dots on
/// the segments of `line` that `keep` accepts ([`dash_kept`]). `None` when `st` has no dash
/// pattern or has a width profile, or when its pattern draws the line solid.
+65 -1
View File
@@ -10,7 +10,7 @@
use std::f64::consts::PI;
use kurbo::{BezPath, ParamCurve, PathEl, PathSeg, Point, Vec2};
use kurbo::{BezPath, ParamCurve, PathEl, PathSeg, Point, Rect, Vec2};
use vectorcraft_doc::{LineCap, LineJoin, StrokeLayer, WidthProfile};
use super::{kink, segments, subpaths, unit};
@@ -21,6 +21,70 @@ pub fn width_outline(bp: &BezPath, width: f64, profile: &WidthProfile, st: &Stro
outline_spans(bp, &[], width, profile, st, tol)
}
/// Outline only flattened segments near `near`, retaining each run's original fractions of its
/// whole subpath for the width profile. `None` means no segments could be omitted.
pub(super) fn width_outline_near(bp: &BezPath, width: f64, profile: &WidthProfile, st: &StrokeLayer, tol: f64, near: Rect) -> Option<BezPath> {
let ctx = Ctx { half: width / 2.0, profile, cap: st.cap, join: st.join, miter_limit: st.miter_limit, tol: tol.max(1e-4) };
let mut out = BezPath::new();
let mut cut = false;
for (r, closed) in subpaths(bp) {
if closed {
return None;
}
let (pts, corner) = flatten(&segments(&bp.elements()[r]), closed, ctx.tol);
let n = pts.len();
if n < 2 {
continue;
}
let count = n - 1;
let mut lengths = Vec::with_capacity(count);
let mut kept = Vec::with_capacity(count);
let mut total = 0.0;
for i in 0..count {
let (a, b) = (pts[i], pts[i + 1]);
let len = a.distance(b);
if !len.is_finite() {
return None;
}
total += len;
lengths.push(len);
kept.push(!(a.x.max(b.x) < near.x0 || a.x.min(b.x) > near.x1 || a.y.max(b.y) < near.y0 || a.y.min(b.y) > near.y1));
}
if kept.iter().all(|v| *v) {
ctx.subpath(&mut out, &pts, &corner, closed, (0.0, 1.0));
continue;
}
cut = true;
if total <= 1e-12 {
continue;
}
let mut walked = 0.0;
let mut run = Vec::new();
let mut run_corner = Vec::new();
let mut from = 0.0;
for i in 0..count {
if kept[i] {
if run.is_empty() {
from = walked / total;
run.push(pts[i]);
run_corner.push(corner[i]);
}
run.push(pts[i + 1]);
run_corner.push(corner[i + 1]);
} else if run.len() > 1 {
ctx.subpath(&mut out, &run, &run_corner, false, (from, walked / total));
run.clear();
run_corner.clear();
}
walked += lengths[i];
}
if run.len() > 1 {
ctx.subpath(&mut out, &run, &run_corner, false, (from, walked / total));
}
}
cut.then_some(out)
}
/// [`width_outline`] of pieces of longer subpaths: subpath `i` of `bp` covers the fractions
/// `spans[i]` of the subpath it was cut from (see [`Dashed::spans`](super::Dashed::spans));
/// subpaths without a span are whole.
+11 -9
View File
@@ -190,7 +190,7 @@ impl Session {
let ids: Vec<u64> = ids.into_iter().map(|id| id.0).collect();
let aligned = match item {
ItemTarget::Item { aligned, .. } => aligned,
ItemTarget::Top => aligned(params),
ItemTarget::Top => aligned(params, "effect.apply").ok()?,
};
Some((json!({"ids": ids, "item": at, "aligned": aligned}), effects.as_slice()))
}
@@ -241,11 +241,12 @@ pub(crate) fn item_target(s: &Session, p: &Value, cmd: &str) -> Result<ItemTarge
/// [`item_target`] read from param `key` (e.g. `fromItem`).
pub(crate) fn item_target_at(s: &Session, p: &Value, key: &str, cmd: &str) -> Result<ItemTarget> {
let aligned = aligned(p, cmd)?;
match p.get(key) {
Some(Value::Null) => Ok(ItemTarget::Top),
Some(v) => v
.as_u64()
.map(|i| ItemTarget::Item { index: index(i), explicit: true, aligned: aligned(p) })
.map(|i| ItemTarget::Item { index: index(i), explicit: true, aligned })
.ok_or_else(|| bad(cmd, format!("`{key}` must be an appearance item index (paint order) or null"))),
// The active item is a row of the first selected object's own stack.
None if p.get("ids").is_some() || p.get("id").is_some() || targets_contents(p)? => Ok(ItemTarget::Top),
@@ -337,8 +338,8 @@ impl ItemTarget {
/// Does `p` say its item and effect indices are rows of the first target's stack (`aligned`),
/// which each other target edits where it has them (see [`ItemTarget::per_target`])?
pub(crate) fn aligned(p: &Value) -> bool {
p.get("aligned").and_then(Value::as_bool).unwrap_or(false)
pub(crate) fn aligned(p: &Value, cmd: &str) -> Result<bool> {
switch_or(p, "aligned", false, cmd)
}
/// What the appearances of `ids` share, when there are several of them and they all exist.
@@ -745,7 +746,7 @@ fn set_item(s: &mut Session, p: &Value) -> Result<Value> {
// When every object comes out as it was (for example, when none has item `index`), the document
// and its undo history stay as they are.
let before = s.doc()?.doc.clone();
let per = items_per_target(&before, &ids, &[idx], aligned(p));
let per = items_per_target(&before, &ids, &[idx], aligned(p, "appearance.setItem")?);
super::overprint::edit_counted(s, "Appearance", |d| {
let mut edited = Vec::new();
for (id, at) in ids.iter().zip(&per) {
@@ -818,7 +819,7 @@ fn remove_item(s: &mut Session, p: &Value) -> Result<Value> {
// When no object has an item at any of the indices, the document and its undo history stay as
// they are.
let before = s.doc()?.doc.clone();
let per = items_per_target(&before, &ids, &idx, aligned(p));
let per = items_per_target(&before, &ids, &idx, aligned(p, "appearance.removeItem")?);
super::overprint::edit_counted(s, "Remove Item", |d| {
for (id, idx) in ids.iter().zip(&per) {
if let Some(n) = d.node_mut(*id) {
@@ -854,11 +855,11 @@ fn duplicate_item(s: &mut Session, p: &Value) -> Result<Value> {
let active = s.active_appearance_item.as_ref().and_then(|a| a.objects.first().copied());
let mut active_at = None;
// Aligned rows of a mixed selection are copied right above themselves in each object.
if aligned(p) && to.is_some() && shared_stack(&s.doc()?.doc, &ids).is_some() {
if aligned(p, C)? && to.is_some() && shared_stack(&s.doc()?.doc, &ids).is_some() {
return Err(bad(C, "`to` takes the rows of one object's stack, not aligned rows"));
}
let before = s.doc()?.doc.clone();
let per = items_per_target(&before, &ids, &idx, aligned(p));
let per = items_per_target(&before, &ids, &idx, aligned(p, C)?);
s.edit("Duplicate Item", |d, _| {
let mut any = false;
for (id, idx) in ids.iter().zip(&per) {
@@ -932,11 +933,12 @@ fn move_item(s: &mut Session, p: &Value) -> Result<Value> {
const C: &str = "appearance.moveItem";
let to = index_param(p, "to", C)?;
let ids = require_targets(s, p, C)?;
let aligned = aligned(p, C)?;
if p.get("from").and_then(Value::as_str) == Some("contents") {
return move_contents(s, &ids, to);
}
// Where an aligned row would go in each of several different stacks isn't one place.
if aligned(p) && appearances_differ(&s.doc()?.doc, &ids) {
if aligned && appearances_differ(&s.doc()?.doc, &ids) {
return Err(bad(C, "rows of objects whose appearances differ can't be reordered together"));
}
if p.get("indices").is_some() {
+1 -1
View File
@@ -721,7 +721,7 @@ fn text_create(s: &mut Session, p: &Value) -> Result<Value> {
if rotation != 0.0 {
t.xf *= vectorcraft_geom::rotate_deg(rotation);
}
t.vertical = p.get("vertical").and_then(Value::as_bool).unwrap_or(false);
t.vertical = switch_or(p, "vertical", false, "text.create")?;
t.para = new_type_para();
new_type_alignment(s, p, "text.create", &mut t)?;
if let Some(a) = p.get("area") {
+2 -2
View File
@@ -14,7 +14,7 @@ use super::pathops::Beside;
use super::select::{first_selectable, is_selectable, selectable_ids, walk_selectable};
use super::{
CommandSpec, EngineError, Point, Result, Session, bad, bool_or, checked_ids_param, cmd, f64_or, f64_req, has_doc, has_selection, id_param, ok,
str_param,
str_param, switch_or,
};
pub fn specs() -> Vec<CommandSpec> {
@@ -716,7 +716,7 @@ fn release_guides(s: &mut Session, p: &Value) -> Result<Value> {
}
fn lock_guides(s: &mut Session, p: &Value) -> Result<Value> {
let v = p.get("locked").and_then(Value::as_bool).unwrap_or(!s.menu.guides_locked);
let v = switch_or(p, "locked", !s.menu.guides_locked, "view.guides.lock")?;
s.menu.guides_locked = v;
// Locked guides can't stay selected, ruler guides or guide paths, in any open document
// ([`Session::select`] lets those go in the active one).
+3 -2
View File
@@ -11,7 +11,7 @@ use super::clipboard::SwatchChoices;
use super::{
CommandSpec, Result, Session, always, bad, bool_or, can_clear_history, can_redo, can_undo, checked_ids_param, cmd, f64_or, f64_req,
finite_numbers, has_clipboard, has_doc, has_selection, has_selection_guides_or_artboard_tool, has_selection_or_guides, id_param, index, ok,
point_param, str_param,
point_param, str_param, switch_or,
};
use crate::{Clipboard, EngineError, inspect};
@@ -817,6 +817,7 @@ fn cut_direct_selection(s: &mut Session, roots: &[NodeId]) -> Result<Value> {
}
fn clear(s: &mut Session, p: &Value) -> Result<Value> {
let guides = switch_or(p, "guides", false, "edit.clear")?;
let explicit = if p.get("ids").is_some() { Some(checked_ids_param(s, p, "ids", "edit.clear")?) } else { None };
// Direct-selected anchors or segments: remove those, and any objects selected whole with them.
if explicit.is_none() && (!s.doc()?.selection.anchors.is_empty() || !s.doc()?.selection.segments.is_empty()) {
@@ -829,7 +830,7 @@ fn clear(s: &mut Session, p: &Value) -> Result<Value> {
let st = s.doc()?;
// Guides selected with the art go with it (not when ids are given, unless `guides` says so:
// Cut, which names the objects it copied).
let with_guides = explicit.is_none() || bool_or(p, "guides", false);
let with_guides = explicit.is_none() || guides;
let is_explicit = explicit.is_some();
let targets = explicit.unwrap_or_else(|| st.selection.in_paint_order(&st.doc));
// Keep the selected ids themselves, without promoting compound members. Delete a selected
+6 -4
View File
@@ -16,7 +16,7 @@ use vectorcraft_render::effects;
use super::appearance::{ItemTarget, aligned, appearance_targets, index_param, item_indices, item_target, item_target_at};
use super::expand::has_seeded;
use super::rasterfx;
use super::{CommandSpec, EngineError, NodeId, Result, Session, always, bad, cmd, fileio, has_doc, str_param};
use super::{CommandSpec, EngineError, NodeId, Result, Session, always, bad, cmd, fileio, has_doc, str_param, switch_or};
/// The effect commands of the Effect menu and the Appearance panel.
pub fn specs() -> Vec<CommandSpec> {
@@ -116,12 +116,13 @@ pub(crate) fn effect_targets(s: &Session, p: &Value, item: ItemTarget, index: us
// Whether `item` names an item in the stack it is a row of (else the edit is object-level there).
let anchor = roots.get(item.anchor(s, &roots)).and_then(|a| d.node(*a));
let anchor_level = anchor.map(|a| item.effects_item(&a.appearance, cmd)).transpose()?.flatten();
let aligned = aligned(p, cmd)?;
let mut out = Vec::with_capacity(roots.len());
for (id, item) in roots.iter().zip(per) {
let (Some(item), Some(n)) = (item, d.node(*id)) else { continue };
let at = item.effects_item(&n.appearance, cmd)?;
// An object-level effect this target shares with the first is where it is in this target.
let index = match (first.filter(|_| aligned(p)), at, anchor_level) {
let index = match (first.filter(|_| aligned), at, anchor_level) {
(Some(f), None, None) => SharedStack::of(&[&*f.appearance, &*n.appearance]).effect_in(index, 1).unwrap_or(index),
_ => index,
};
@@ -236,6 +237,7 @@ pub(crate) fn apply(s: &mut Session, p: &Value) -> Result<Value> {
}
let effect = effects::new_effect(id, &params).ok_or_else(|| bad(C, format!("unknown effect `{id}`")))?;
let label = effects::effect_info(id).map(|e| e.label.trim_end_matches('…').to_string()).unwrap_or_default();
aligned(p, C)?;
if let Some(loose) = loose_for_pathfinder(s, p, id)? {
let gid = s.edit(&label, |d, sel| {
let gid = super::object::group_nodes(d, &loose)?;
@@ -375,10 +377,10 @@ fn move_effect(s: &mut Session, p: &Value) -> Result<Value> {
let to = index_param(p, "to", C)?;
let src = item_target_at(s, p, "fromItem", C)?;
let dst = if p.get("toItem").is_some() { item_target_at(s, p, "toItem", C)? } else { src };
let copy = p.get("copy").and_then(Value::as_bool).unwrap_or(false);
let copy = switch_or(p, "copy", false, C)?;
let roots = appearance_targets(s, p)?;
// Where an aligned effect would go in each of several different stacks isn't one place.
if aligned(p) && super::appearance::appearances_differ(&s.doc()?.doc, &roots) {
if aligned(p, C)? && super::appearance::appearances_differ(&s.doc()?.doc, &roots) {
return Err(bad(C, "effects of objects whose appearances differ can't be moved together"));
}
// Where the effect landed in each object it moved in, in the order of `ids`.
+2 -2
View File
@@ -14,7 +14,7 @@ use std::sync::Arc;
use serde_json::{Value, json};
use vectorcraft_doc::{Document, MaskEdit, Node, NodeId, NodeKind, Selection};
use super::{CommandSpec, EngineError, Result, Session, bad, cmd, has_doc, id_param};
use super::{CommandSpec, EngineError, Result, Session, bad, cmd, has_doc, id_param, switch_or};
/// Name of the temporary mask-editing layer.
pub const MASK_EDIT_LAYER: &str = "Opacity Mask Editing";
@@ -138,7 +138,7 @@ fn view_mask(s: &mut Session, p: &Value) -> Result<Value> {
const C: &str = "transparency.viewOpacityMask";
let st = s.doc()?;
let editing = st.doc.mask_edit.map(|m| m.object);
if !p.get("on").and_then(Value::as_bool).unwrap_or(st.shown_mask().is_none()) {
if !switch_or(p, "on", st.shown_mask().is_none(), C)? {
let st = s.doc_mut()?;
let id = st.mask_view.take();
st.revision += 1;
+2 -2
View File
@@ -16,7 +16,7 @@ use vectorcraft_doc::{Appearance, AppearanceItem, FillLayer, GraphicStyle, Node,
use vectorcraft_tools::PaintDefaults;
use super::gradient::unplaced;
use super::{CommandSpec, Result, Session, always, cmd};
use super::{CommandSpec, Result, Session, always, cmd, switch_or};
pub fn specs() -> Vec<CommandSpec> {
vec![
@@ -216,7 +216,7 @@ impl Session {
}
fn set_basic(s: &mut Session, p: &Value) -> Result<Value> {
let on = p.get("on").and_then(Value::as_bool).unwrap_or(!s.prefs.new_art_basic);
let on = switch_or(p, "on", !s.prefs.new_art_basic, "appearance.setNewArtBasic")?;
s.prefs.new_art_basic = on;
Ok(json!({ "on": on }))
}
+8 -3
View File
@@ -117,8 +117,12 @@ fn apply_transform_moving_guides(
// A transform of ids that name no object, or an identity transform without a copy, moves
// nothing: the document and its undo history stay as they are, and Transform Again repeats it.
// With a copy, the reply lists the copies, and there are none.
// An edit normally preserves the tree positions already found here. Settling an active
// typing session can change the document before the edit closure runs, so look up again then.
let reindex = copy || (!s.previewing && crate::cmd::typing_in_progress(s));
let d = &s.doc()?.doc;
let none = d.index_paths(ids.iter().copied()).is_empty() && !has_guides;
let paths = d.index_paths(ids.iter().copied());
let none = paths.is_empty() && !has_guides;
let ids = if anchors && objects && !copy && !s.doc()?.selection.anchors.is_empty() {
if xf != Affine::IDENTITY {
crate::cmd::path::transform_anchors(s, label, xf, sc)?;
@@ -154,8 +158,9 @@ fn apply_transform_moving_guides(
}
None => ids.clone(),
};
// Transforms don't move nodes in the tree, so the paths found up front stay right.
let paths = d.index_paths(targets.iter().copied());
// Transforms don't move nodes in the tree, so reuse the paths found for the no-copy
// case; copies and a settled typing session need paths from the edited document.
let paths = if reindex { d.index_paths(targets.iter().copied()) } else { paths };
for id in &targets {
if let Some(n) = paths.get(id).and_then(|p| d.node_mut_at(p))
&& !(objects && areas && resize_type_area(n, xf))
+1 -1
View File
@@ -1191,7 +1191,7 @@ fn convert_anchors(s: &mut Session, p: &Value) -> Result<Value> {
pub(crate) fn delete_anchors(s: &mut Session, p: &Value) -> Result<Value> {
// `guides: true` (Cut, #3226): the selected ruler guides go in the same undo step.
let with_guides = p.get("guides").and_then(Value::as_bool).unwrap_or(false);
let with_guides = switch_or(p, "guides", false, "path.deleteAnchors")?;
let st = s.doc()?;
let sel = st.selection.anchors.clone();
let segments = st.selection.segments.clone();
+4 -3
View File
@@ -20,7 +20,7 @@ use serde_json::{Map, Value, json};
use vectorcraft_doc::{Effect, Node};
use vectorcraft_plugins::{Budget, Kind, Plugin, effect, export, objects, registry};
use super::{CommandSpec, EngineError, NodeId, Result, Session, always, bad, cmd, has_doc, ids_param, str_param};
use super::{CommandSpec, EngineError, NodeId, Result, Session, always, bad, cmd, has_doc, ids_param, str_param, switch_or};
/// What a plug-in error looks like to the user. A run the caller cancelled changed nothing.
fn err(e: vectorcraft_plugins::Error) -> EngineError {
@@ -288,12 +288,13 @@ fn load_given(c: &str, p: &Value) -> Result<(Plugin, Vec<u8>)> {
/// `plugin.list` entry.
fn install(s: &mut Session, p: &Value) -> Result<Value> {
const C: &str = "plugin.install";
let (replace, allow_heavy) = (switch_or(p, "replace", true, C)?, switch_or(p, "allowHeavy", false, C)?);
let (plugin, bytes) = load_given(C, p)?;
if !p.get("replace").and_then(Value::as_bool).unwrap_or(true) && registry::get(plugin.id()).is_some() {
if !replace && registry::get(plugin.id()).is_some() {
return Err(bad(C, format!("a plug-in with id {:?} is already installed", plugin.id())));
}
// A heavy plug-in is installed once the user agrees: whoever installs it asks them first.
if plugin.manifest().budget == Budget::Heavy && !p.get("allowHeavy").and_then(Value::as_bool).unwrap_or(false) {
if plugin.manifest().budget == Budget::Heavy && !allow_heavy {
let (minutes, times) = vectorcraft_plugins::heavy_terms();
return Err(bad(
C,
+2 -2
View File
@@ -10,7 +10,7 @@ use vectorcraft_pdf::{TileOrigin, TilingPage};
use super::fileio::pdf::pdf_error;
use super::print::{settings, to_json};
use super::{CommandSpec, Result, Session, bad, bool_or, cmd, has_doc, index};
use super::{CommandSpec, Result, Session, bad, bool_or, cmd, has_doc, index, switch_or};
const SET: &str = "print.tiling.set";
@@ -48,7 +48,7 @@ pub fn specs() -> Vec<CommandSpec> {
fn show(s: &mut Session, p: &Value) -> Result<Value> {
let st = s.doc_mut()?;
st.print_tiling = p.get("on").and_then(Value::as_bool).unwrap_or(!st.print_tiling);
st.print_tiling = switch_or(p, "on", !st.print_tiling, "view.printTiling")?;
Ok(json!({ "on": st.print_tiling }))
}
+4 -4
View File
@@ -14,7 +14,7 @@ use vectorcraft_geom::{Rect, shapes};
use super::{
CommandSpec, EngineError, NodeId, Result, Session, bad, bool_or, cmd, f64_or, f64_req, has_doc, has_selection, id_param, ids_param, index,
targets,
switch_or, targets,
};
/// The most slices one Divide Slices makes.
@@ -593,7 +593,7 @@ fn options(s: &mut Session, p: &Value) -> Result<Value> {
}
fn clip_to_artboard(s: &mut Session, p: &Value) -> Result<Value> {
let on = p.get("on").and_then(Value::as_bool).unwrap_or(!s.doc()?.doc.slices_clip_to_artboard);
let on = switch_or(p, "on", !s.doc()?.doc.slices_clip_to_artboard, "object.slice.clipToArtboard")?;
if on != s.doc()?.doc.slices_clip_to_artboard {
s.edit("Clip to Artboard", |d, _| {
d.slices_clip_to_artboard = on;
@@ -604,7 +604,7 @@ fn clip_to_artboard(s: &mut Session, p: &Value) -> Result<Value> {
}
fn hide(s: &mut Session, p: &Value) -> Result<Value> {
let v = p.get("hidden").and_then(Value::as_bool).unwrap_or(!s.menu.slices_hidden);
let v = switch_or(p, "hidden", !s.menu.slices_hidden, "view.slices.hide")?;
s.menu.slices_hidden = v;
if v {
deselect_in_every_document(s);
@@ -613,7 +613,7 @@ fn hide(s: &mut Session, p: &Value) -> Result<Value> {
}
fn lock(s: &mut Session, p: &Value) -> Result<Value> {
let v = p.get("locked").and_then(Value::as_bool).unwrap_or(!s.menu.slices_locked);
let v = switch_or(p, "locked", !s.menu.slices_locked, "view.slices.lock")?;
s.menu.slices_locked = v;
if v {
deselect_in_every_document(s);
+1 -1
View File
@@ -1585,7 +1585,7 @@ fn create_in_path(s: &mut Session, p: &Value) -> Result<Value> {
};
let kind = if on_path { TextKind::OnPath { path: path.clone(), start, end: None } } else { TextKind::Area { frame: path.clone() } };
let mut t = TextObject {
vertical: p.get("vertical").and_then(Value::as_bool).unwrap_or(false),
vertical: switch_or(p, "vertical", false, C)?,
kind,
xf: Affine::IDENTITY,
runs: vec![TextRun { text, style, inline: None }],
+19
View File
@@ -20,6 +20,25 @@ fn text(s: &Session, id: u64) -> String {
}
}
#[test]
fn empty_later_frames_keep_the_first_frames_edited_paragraph_style() {
let mut s = Session::new();
s.execute("file.new", &json!({"width": 600, "height": 300})).unwrap();
let a =
s.execute("text.create", &json!({"x": 10, "y": 10, "text": "First", "area": {"width": 150, "height": 60}})).unwrap()["id"].as_u64().unwrap();
let b = s.execute("shape.rectangle", &json!({"x": 200, "y": 10, "width": 150, "height": 60})).unwrap()["id"].as_u64().unwrap();
let c = s.execute("shape.rectangle", &json!({"x": 400, "y": 10, "width": 150, "height": 60})).unwrap()["id"].as_u64().unwrap();
s.execute("select.set", &json!({"ids": [a, b, c]})).unwrap();
s.execute("text.thread.create", &json!({})).unwrap();
assert_eq!([text(&s, a), text(&s, b), text(&s, c)], ["First", "", ""]);
s.execute("text.setFormat", &json!({"ids": [a], "hyphenate": true})).unwrap();
let hyphenates = |id| match &s.doc().unwrap().doc.node(NodeId(id)).unwrap().kind {
NodeKind::Text(t) => t.para_at(0).hyphenate,
_ => panic!("not text"),
};
assert_eq!([hyphenates(a), hyphenates(b), hyphenates(c)], [true, true, true]);
}
#[test]
fn thread_flows_reflows_on_edit_and_survives_delete() {
let (mut s, a, b) = setup();
+2 -2
View File
@@ -5,7 +5,7 @@ use serde_json::{Value, json};
use vectorcraft_doc::SavedView;
use vectorcraft_geom::Point;
use super::{CommandSpec, Result, Session, always, bad, bool_or, cmd, f64_req, finite_numbers, has_doc, str_param};
use super::{CommandSpec, Result, Session, always, bad, bool_or, cmd, f64_req, finite_numbers, has_doc, str_param, switch_or};
pub fn specs() -> Vec<CommandSpec> {
vec![
@@ -64,7 +64,7 @@ fn caps_lock(s: &mut Session, p: &Value) -> Result<Value> {
fn transparency_grid(s: &mut Session, p: &Value) -> Result<Value> {
let st = s.doc_mut()?;
st.transparency_grid = p.get("on").and_then(Value::as_bool).unwrap_or(!st.transparency_grid);
st.transparency_grid = switch_or(p, "on", !st.transparency_grid, "view.transparencyGrid")?;
Ok(json!({ "on": st.transparency_grid }))
}
+33
View File
@@ -981,3 +981,36 @@ fn removing_shared_and_unshared_rows_removes_only_the_shared_ones_elsewhere() {
assert!(node(&s, a).appearance.items.is_empty(), "a loses both");
assert_eq!(node(&s, b).appearance.items, fills_b, "b loses only its stroke, keeping both fills");
}
#[test]
fn invalid_aligned_flags_leave_the_appearance_alone() {
let mut s = session();
let id = rect(&mut s, 100.0);
run(&mut s, "effect.apply", json!({"effect": "distort.twist"}));
let before = node(&s, id);
let before_undo = s.doc().unwrap().history.undo.len();
for (command, params) in [
("appearance.setItem", json!({"index": 0, "opacity": 50, "aligned": "true"})),
("appearance.removeItem", json!({"index": 0, "aligned": 1})),
("appearance.duplicateItem", json!({"index": 0, "aligned": "false"})),
("appearance.moveItem", json!({"from": 0, "to": 1, "aligned": 0})),
("stroke.set", json!({"item": 1, "weight": 5, "aligned": "true"})),
("stroke.set", json!({"weight": 5, "aligned": "true"})),
("transparency.set", json!({"item": 0, "opacity": 50, "aligned": "true"})),
("effect.apply", json!({"effect": "distort.roughen", "item": 0, "aligned": "true"})),
("effect.remove", json!({"index": 0, "aligned": "true"})),
] {
assert!(s.execute(command, &params).is_err(), "{command} accepted {params}");
assert_eq!(node(&s, id), before, "{command} changed the object");
assert_eq!(s.doc().unwrap().history.undo.len(), before_undo, "{command} recorded an undo step");
}
// Null, as for every command, is the same as leaving `aligned` out.
run(&mut s, "appearance.removeItem", json!({"index": 0, "aligned": null}));
assert_eq!(node(&s, id).appearance.items.len(), before.appearance.items.len() - 1);
// A Pathfinder effect on loose objects groups them first: the flag is checked before that.
let other = rect(&mut s, 250.0);
run(&mut s, "select.set", json!({"ids": [id.0, other.0]}));
let before_undo = s.doc().unwrap().history.undo.len();
assert!(s.execute("effect.apply", &json!({"effect": "pathfinder.add", "aligned": "true"})).is_err());
assert_eq!(s.doc().unwrap().history.undo.len(), before_undo, "grouped the objects");
}
+23
View File
@@ -70,6 +70,29 @@ fn effects_move_and_copy_between_the_object_and_its_items() {
assert!(s.execute("effect.move", &json!({"from": 0, "fromItem": 1, "to": 0, "toItem": 7})).is_err());
}
#[test]
fn invalid_effect_move_flags_leave_the_effects_alone() {
let (mut s, id) = session_with_rect();
run(&mut s, "effect.apply", json!({"effect": "distort.twist"}));
let before_undo = s.doc().unwrap().history.undo.len();
let to_fill = json!({"from": 0, "fromItem": null, "to": 0, "toItem": 0});
for (key, value) in [("copy", json!("true")), ("copy", json!(1)), ("aligned", json!("false"))] {
let mut params = to_fill.clone();
params[key] = value;
assert!(s.execute("effect.move", &params).is_err(), "accepted {params}");
assert_eq!(fx(&s, id, None), ["distort.twist"], "moved the effect for {params}");
assert!(fx(&s, id, Some(0)).is_empty(), "copied the effect for {params}");
assert_eq!(s.doc().unwrap().history.undo.len(), before_undo, "recorded undo for {params}");
}
// Null, as for every command, is the same as leaving the flag out: a move.
let mut params = to_fill;
params["copy"] = Value::Null;
params["aligned"] = Value::Null;
run(&mut s, "effect.move", params);
assert!(fx(&s, id, None).is_empty());
assert_eq!(fx(&s, id, Some(0)), ["distort.twist"]);
}
/// `effect.duplicate` copies a fill's effect right after it.
#[test]
fn duplicate_selected_works_for_effects() {
+20
View File
@@ -69,3 +69,23 @@ fn view_opacity_mask_shows_its_luminance_and_hides_the_artwork() {
assert!(s.execute("transparency.viewOpacityMask", &json!({"on": true, "id": other.0})).is_err());
assert!(s.doc().unwrap().mask_view.is_none());
}
#[test]
fn invalid_view_opacity_mask_parameters_leave_the_view_unchanged() {
let mut s = Session::new();
s.execute("file.new", &json!({"width": 300, "height": 300})).unwrap();
let obj = rect(&mut s, 0.0, 200.0, "#ff0000");
let m = rect(&mut s, 0.0, 100.0, "#00ff00");
s.execute("select.set", &json!({"ids": [obj.0, m.0]})).unwrap();
s.execute("transparency.makeOpacityMask", &json!({})).unwrap();
let undo = s.doc().unwrap().history.undo.len();
for params in [json!({"on": "true"}), json!({"on": 1})] {
assert!(s.execute("transparency.viewOpacityMask", &params).is_err(), "accepted {params}");
let st = s.doc().unwrap();
assert!(st.doc.mask_edit.is_none() && st.shown_mask().is_none(), "showed the mask for {params}");
assert_eq!(st.history.undo.len(), undo, "recorded undo for {params}");
}
// Left out, or null as for every command, it toggles.
assert_eq!(s.execute("transparency.viewOpacityMask", &json!(null)).unwrap(), json!({"on": true, "id": obj.0}));
assert_eq!(s.execute("transparency.viewOpacityMask", &json!({"on": null})).unwrap(), json!({"on": false, "id": obj.0}));
}
+41
View File
@@ -3539,6 +3539,23 @@ fn ruler_guides_and_lock() {
assert!(s.execute("guide.remove", &json!({"index": 0})).is_err());
}
#[test]
fn invalid_guide_lock_parameters_keep_guides_selected() {
let mut s = session();
s.execute("guide.add", &json!({"vertical": false, "pos": 50})).unwrap();
s.execute("guide.select", &json!({"indexes": [0]})).unwrap();
let before_undo = s.doc().unwrap().history.undo.len();
for params in [json!({"locked": "false"}), json!({"locked": 1})] {
assert!(s.execute("view.guides.lock", &params).is_err(), "accepted {params}");
assert!(!s.guides_locked(), "locked guides for {params}");
assert_eq!(s.doc().unwrap().selection.guides, vec![0], "cleared selection for {params}");
assert_eq!(s.doc().unwrap().history.undo.len(), before_undo, "recorded undo for {params}");
}
// Left out, or null as for every command, it toggles.
assert_eq!(s.execute("view.guides.lock", &json!(null)).unwrap(), json!({"locked": true}));
assert_eq!(s.execute("view.guides.lock", &json!({"locked": null})).unwrap(), json!({"locked": false}));
}
/// #1534: Lock Guides locks the paths made into guides too: they can't be selected (so neither
/// moved, reshaped nor deleted), by a click, a marquee or Select All, and locking lets them go.
#[test]
@@ -3810,6 +3827,30 @@ fn guides_and_art_are_shift_selected_together() {
assert_eq!(guides(&s).len(), 2);
}
#[test]
fn invalid_clear_guides_parameters_delete_nothing() {
let mut s = session();
let a = rect(&mut s, 10.0, 10.0, 40.0, 20.0);
s.execute("guide.add", &json!({"vertical": true, "pos": 200})).unwrap();
sel(&mut s, &[a]);
s.execute("guide.select", &json!({"indexes": [0], "toggle": true})).unwrap();
let n = undo_len(&s);
for params in [json!({"ids": [a.0], "guides": "true"}), json!({"guides": 1})] {
assert!(s.execute("edit.clear", &params).is_err(), "accepted {params}");
assert!(s.doc().unwrap().doc.node(a).is_some(), "deleted the art for {params}");
assert_eq!((guides(&s).len(), undo_len(&s)), (1, n), "changed the document for {params}");
}
// Direct-selected anchors take the same check.
s.execute("select.anchors", &json!({"id": a.0, "anchors": [[0, 1]], "mode": "set"})).unwrap();
assert!(s.execute("edit.clear", &json!({"guides": "false"})).is_err());
assert!(!s.doc().unwrap().selection.anchors.is_empty());
assert_eq!(undo_len(&s), n);
// Null, as for every command, is the same as leaving `guides` out: with ids, the guides stay.
s.execute("edit.clear", &json!({"ids": [a.0], "guides": null})).unwrap();
assert!(s.doc().unwrap().doc.node(a).is_none());
assert_eq!(guides(&s).len(), 1);
}
/// When ruler guides and art are selected together, moving the art moves the guides as well;
/// copy leaves both in place and moves the copies; single undo reverts both.
#[test]
+14
View File
@@ -29,6 +29,20 @@ fn undo_len(s: &Session) -> usize {
s.doc().unwrap().history.undo.len()
}
#[test]
fn invalid_new_art_basic_parameters_keep_the_preference_unchanged() {
let mut s = session();
let undo = undo_len(&s);
for params in [json!({"on": "false"}), json!({"on": 1})] {
assert!(s.execute("appearance.setNewArtBasic", &params).is_err(), "accepted {params}");
assert!(s.prefs.new_art_basic, "changed the preference for {params}");
assert_eq!(undo_len(&s), undo, "recorded undo for {params}");
}
// Left out, or null as for every command, it toggles.
assert_eq!(s.execute("appearance.setNewArtBasic", &json!(null)).unwrap(), json!({"on": false}));
assert_eq!(s.execute("appearance.setNewArtBasic", &json!({"on": null})).unwrap(), json!({"on": true}));
}
#[test]
fn stroke_options_set_with_nothing_selected_carry_to_the_next_object() {
let mut s = session();
+30
View File
@@ -493,6 +493,36 @@ fn a_heavy_filter_installs_once_the_user_agrees() {
assert!(install(&mut s, DESATURATE).get("budget").is_none());
}
#[test]
fn invalid_install_flags_are_refused() {
let mut s = session();
let id = "test.engine.heavy.flags";
let data = vectorcraft_format::base64_encode(&heavy(id, 1));
for allow in [json!("true"), json!(1)] {
let e = s.execute("plugin.install", &json!({"dataBase64": data, "allowHeavy": allow})).unwrap_err().to_string();
assert!(e.contains("`allowHeavy` must be true or false"), "allowHeavy {allow}: {e}");
assert!(vectorcraft_plugins::registry::get(id).is_none(), "installed with allowHeavy {allow}");
}
// Null, as for every command, is the same as leaving the flag out.
let e = s.execute("plugin.install", &json!({"dataBase64": data, "allowHeavy": null})).unwrap_err().to_string();
assert!(e.contains("heavy budget"), "{e}");
run(&mut s, "plugin.install", json!({"dataBase64": data, "allowHeavy": true}));
for replace in [json!("false"), json!(0)] {
let e = s.execute("plugin.install", &json!({"dataBase64": data, "allowHeavy": true, "replace": replace})).unwrap_err().to_string();
assert!(e.contains("`replace` must be true or false"), "replace {replace}: {e}");
}
run(&mut s, "plugin.install", json!({"dataBase64": data, "allowHeavy": true, "replace": null}));
assert!(vectorcraft_plugins::registry::get(id).is_some());
// A plug-in with the usual budget is refused too.
let light = "test.engine.light.flags";
let manifest = format!(r#"{{"id":"{light}","name":"Test {light}","version":"1","kind":"filter"}}"#);
let output = json!({"objects": [{"path": triangle(), "name": "Plug-in"}]});
let data = vectorcraft_format::base64_encode(&wat::parse_str(tpl::spinning(&manifest, 1, &output.to_string())).unwrap());
let e = s.execute("plugin.install", &json!({"dataBase64": data, "allowHeavy": "false"})).unwrap_err().to_string();
assert!(e.contains("`allowHeavy` must be true or false"), "{e}");
assert!(vectorcraft_plugins::registry::get(light).is_none());
}
/// The user agreed once: a heavy filter kept in the plug-in store is installed again at the next
/// start without asking, with its budget.
#[test]
+15
View File
@@ -182,3 +182,18 @@ fn settings_saved_before_the_tile_origin_still_load() {
assert_eq!((set["copies"].clone(), set["tileOrigin"]["placed"].clone()), (json!(2), json!(false)));
assert_eq!(tiling(&mut s, json!({}))["pages"].as_array().unwrap().len(), 1);
}
#[test]
fn invalid_print_tiling_parameters_leave_the_view_unchanged() {
let mut s = session();
let undo = s.doc().unwrap().history.undo.len();
for params in [json!({"on": "true"}), json!({"on": 1})] {
assert!(s.execute("view.printTiling", &params).is_err(), "accepted {params}");
let st = s.doc().unwrap();
assert!(!st.print_tiling, "showed the tiling for {params}");
assert_eq!(st.history.undo.len(), undo, "recorded undo for {params}");
}
// Left out, or null as for every command, it toggles.
assert_eq!(s.execute("view.printTiling", &json!(null)).unwrap(), json!({"on": true}));
assert_eq!(s.execute("view.printTiling", &json!({"on": null})).unwrap(), json!({"on": false}));
}
+24
View File
@@ -593,3 +593,27 @@ fn slice_commands_check_their_params() {
assert!(s.doc().unwrap().doc.node(NodeId(a)).is_some(), "deleting an object slice keeps its object");
assert_eq!(run(&mut s, "object.slice.select", json!({}))["selected"], json!([]));
}
#[test]
fn invalid_slice_toggle_flags_do_not_change_state_or_selection() {
for (command, params) in [
("object.slice.clipToArtboard", json!({"on": "false"})),
("view.slices.hide", json!({"hidden": 0})),
("view.slices.lock", json!({"locked": 1})),
] {
let mut s = session();
let id = user_slice(&mut s, [10.0, 10.0, 20.0, 20.0]);
run(&mut s, "select.object.slices", json!({}));
let before_undo = s.doc().unwrap().history.undo.len();
assert!(s.execute(command, &params).is_err(), "{command} accepted {params}");
assert!(s.doc().unwrap().doc.slices_clip_to_artboard, "{command} changed the document");
assert!(!s.slices_hidden(), "{command} hid slices");
assert!(!s.slices_locked(), "{command} locked slices");
assert_eq!(s.doc().unwrap().selection.slices, vec![NodeId(id)], "{command} cleared the selection");
assert_eq!(s.doc().unwrap().history.undo.len(), before_undo, "{command} recorded an undo step");
}
// Left out, or null as for every command, the flag toggles.
let mut s = session();
assert_eq!(run(&mut s, "view.slices.hide", Value::Null)["hidden"], true);
assert_eq!(run(&mut s, "view.slices.hide", json!({"hidden": null}))["hidden"], false);
}
@@ -26,3 +26,18 @@ fn transparency_grid_is_per_document_view_state() {
s.execute("document.activate", &json!({"index": 1})).unwrap();
assert!(!grid(&s));
}
#[test]
fn invalid_transparency_grid_parameters_leave_the_view_unchanged() {
let mut s = Session::new();
s.execute("file.new", &json!({})).unwrap();
for params in [json!({"on": "false"}), json!({"on": 1})] {
assert!(s.execute("view.transparencyGrid", &params).is_err(), "accepted {params}");
let st = s.doc().unwrap();
assert!(!st.transparency_grid, "changed the grid for {params}");
assert!(st.history.undo.is_empty() && !st.is_dirty(), "recorded an edit for {params}");
}
// Left out, or null as for every command, it toggles.
assert_eq!(s.execute("view.transparencyGrid", &json!(null)).unwrap(), json!({"on": true}));
assert_eq!(s.execute("view.transparencyGrid", &json!({"on": null})).unwrap(), json!({"on": false}));
}
+108 -11
View File
@@ -30,6 +30,13 @@ const MAX_FONTS: usize = 4096;
const MAX_TABS: usize = 1024;
/// Largest tab stop position read (points), as `text.tabs.set` takes it.
const MAX_TAB_POSITION: f64 = 100_000.0;
/// Most tab stops copied in one text object into its runs of paragraphs with the same attributes
/// while it is read, and again, counted apart, into each of its paragraphs when it has more than one
/// run and into the frames of its linked areas after the first. The runs, paragraphs and frames past
/// it take the default stops, with a warning.
const MAX_STORY_TABS: usize = 1 << 20;
/// The warning when [`MAX_STORY_TABS`] leaves tab stops out.
const TABS_LEFT_OUT: &str = "tab stops past VectorCraft's limits were left out";
/// Most values read before one operator in a re-encoding section.
const MAX_ENCODING_VALUES: usize = 1024;
/// Most text paths read in one text object (its linked areas); the frames of others are left out,
@@ -56,6 +63,17 @@ struct TextPath {
path: Option<(BezPath, Vec<AnchorKind>)>,
}
/// Paragraphs in a row that start with the same attributes.
#[derive(Debug)]
struct ParaRun {
/// The attributes, as they were at the first character of each paragraph.
style: ParaStyle,
/// How many paragraphs.
count: usize,
/// [`TypeState::tabs_version`] when the last of them started.
tabs_version: u64,
}
/// A text object being read.
#[derive(Debug, Default)]
pub(super) struct LegacyText {
@@ -69,8 +87,13 @@ pub(super) struct LegacyText {
past_limit: bool,
/// The story: the characters after every text path, in file order.
runs: Vec<TextRun>,
/// Each paragraph's attributes, as they were at its first character.
paras: Vec<ParaStyle>,
/// The paragraphs' attributes, as they were at the first character of each, by runs of
/// paragraphs with the same attributes.
paras: Vec<ParaRun>,
/// The tab stops that the runs in `paras` hold.
tab_stops: usize,
/// [`MAX_STORY_TABS`] left tab stops out.
tabs_left_out: bool,
/// The current paragraph's attributes are in `paras`.
para_taken: bool,
/// An overflow paragraph break (`(\r) TX`) not yet followed by type: the story's end.
@@ -83,11 +106,74 @@ pub(super) struct LegacyText {
hidden: bool,
}
impl LegacyText {
/// A paragraph starts, with the attributes `para` at [`TypeState::tabs_version`]
/// `tabs_version`. When they are those of the paragraph before it, it joins that paragraph's
/// run; else a new run starts, with the tab stops that [`MAX_STORY_TABS`] leaves room for.
fn begin_para(&mut self, para: &mut ParaStyle, tabs_version: u64) {
if let Some(run) = self.paras.last_mut() {
// No tab definition since the run's last paragraph started: the stops are the same.
let same = if run.tabs_version == tabs_version { same_but_tabs(&mut run.style, para) } else { run.style == *para };
if same {
run.count += 1;
run.tabs_version = tabs_version;
return;
}
}
let style = within_tabs(para, &mut self.tab_stops, &mut self.tabs_left_out);
self.paras.push(ParaRun { style, count: 1, tabs_version });
}
}
/// Are `a` and `b` the same, leaving their tab stops out?
fn same_but_tabs(a: &mut ParaStyle, b: &mut ParaStyle) -> bool {
let (a_tabs, b_tabs) = (std::mem::take(&mut a.tabs), std::mem::take(&mut b.tabs));
let same = a == b;
(a.tabs, b.tabs) = (a_tabs, b_tabs);
same
}
/// A copy of `para`, with its tab stops when `copied` (the tab stops copied so far) has room for
/// them within [`MAX_STORY_TABS`], else with the default stops and `left_out` set.
fn within_tabs(para: &ParaStyle, copied: &mut usize, left_out: &mut bool) -> ParaStyle {
let mut style = para.clone();
if MAX_STORY_TABS.saturating_sub(*copied) >= style.tabs.len() {
*copied += style.tabs.len();
} else {
*left_out = true;
style.tabs = Vec::new();
}
style
}
/// The attributes of each paragraph of the runs `runs`, in order. A paragraph keeps its tab stops
/// while `copied` (the tab stops copied so far) has room for them within [`MAX_STORY_TABS`]; the
/// paragraphs past it take the default stops, and `left_out` is set.
fn each_paragraph(runs: Vec<ParaRun>, copied: &mut usize, left_out: &mut bool) -> Vec<ParaStyle> {
let mut each = Vec::with_capacity(runs.iter().map(|r| r.count).sum());
for run in runs {
let stops = run.style.tabs.len();
let room = MAX_STORY_TABS.saturating_sub(*copied);
let kept = room.checked_div(stops).map_or(run.count, |n| run.count.min(n));
*copied += kept * stops;
let bare = (kept < run.count).then(|| ParaStyle { tabs: Vec::new(), ..run.style.clone() });
each.extend(std::iter::repeat_n(run.style, kept));
if let Some(bare) = bare {
*left_out = true;
each.extend(std::iter::repeat_n(bare, run.count - kept));
}
}
each
}
/// The modal type attributes of the legacy format, which last from one text object to the next.
#[derive(Debug)]
pub(super) struct TypeState {
style: CharStyle,
para: ParaStyle,
/// How many tab definitions set `para`'s tab stops: paragraphs that start at the same count
/// start with the same stops.
tabs_version: u64,
/// `Tr`.
render: i64,
/// The encoding strings are in, by code (`TE`); None where it says nothing.
@@ -109,6 +195,7 @@ impl Default for TypeState {
Self {
style: CharStyle::default(),
para: ParaStyle::default(),
tabs_version: 0,
render: 0,
encoding: vec![None; 256],
fonts: vec![],
@@ -488,6 +575,7 @@ impl Reader<'_> {
tabs.sort_by(|a, b| a.position.total_cmp(&b.position));
tabs.dedup_by(|a, b| (a.position - b.position).abs() < 1e-6);
st.para.tabs = tabs;
st.tabs_version = st.tabs_version.wrapping_add(1);
}
}
_ => {}
@@ -538,13 +626,13 @@ impl Reader<'_> {
}
for c in decoded.chars() {
if c != '\n' && !t.para_taken {
t.paras.push(st.para.clone());
t.begin_para(&mut st.para, st.tabs_version);
t.para_taken = true;
}
text.push(c);
if c == '\n' {
if !t.para_taken {
t.paras.push(st.para.clone());
t.begin_para(&mut st.para, st.tabs_version);
}
t.para_taken = false;
}
@@ -562,7 +650,7 @@ impl Reader<'_> {
/// Point type is read at its first text path; area type and type on a path at the first one
/// that has a frame or path (else at the first one, as point type).
pub(super) fn end_text(&mut self, hidden: bool) -> Result<(), String> {
let Some(t) = self.text.take() else { return Ok(()) };
let Some(mut t) = self.text.take() else { return Ok(()) };
if t.runs.is_empty() {
return Ok(());
}
@@ -581,13 +669,15 @@ impl Reader<'_> {
if t.kind == 1 && (t.past_limit || all_areas > placed.len()) {
self.warn(LINKED_AREAS_LEFT_OUT);
}
let mut paras = t.paras;
let mut paras = std::mem::take(&mut t.paras);
if paras.is_empty() {
paras.push(self.type_state.para.clone());
paras.push(ParaRun { style: self.type_state.para.clone(), count: 1, tabs_version: 0 });
}
let last_para = paras.last().cloned().unwrap_or_default();
let last_para = paras.last().map(|r| r.style.clone()).unwrap_or_default();
let last_style = t.runs.last().map(|r| r.style.clone()).unwrap_or_default();
let mut story = Some((t.runs, paras));
let mut story = Some((std::mem::take(&mut t.runs), paras));
// The tab stops copied into the paragraphs and frames.
let mut copied = 0;
let mut nodes = Vec::with_capacity(placed.len());
for (m, kind) in placed {
let mut obj = TextObject::point(kurbo::Point::ZERO, "", last_style.clone());
@@ -596,12 +686,19 @@ impl Reader<'_> {
match story.take() {
Some((runs, paras)) => {
obj.runs = runs;
obj.set_paragraph_styles(paras);
// Paragraphs that all have the same attributes share one copy of them.
match <[ParaRun; 1]>::try_from(paras) {
Ok([one]) => obj.set_all_paras(one.style),
Err(paras) => obj.set_paragraph_styles(each_paragraph(paras, &mut copied, &mut t.tabs_left_out)),
}
}
None => obj.set_paragraph_styles(vec![last_para.clone()]),
None => obj.set_all_paras(within_tabs(&last_para, &mut copied, &mut t.tabs_left_out)),
}
nodes.push(self.new_node(NodeKind::Text(Box::new(obj)), &t.gs));
}
if t.tabs_left_out {
self.warn(TABS_LEFT_OUT);
}
let frames: Vec<NodeId> = nodes.iter().map(|n| n.id).collect();
// Type used as a mask clips the objects of its clipping group, as a `W` path does. A
// clipping path is one object, and wraparound text and compound paths don't clip their
@@ -377,7 +377,9 @@ impl<'a> Reader<'a> {
sub.global_names = std::mem::take(&mut self.global_names);
sub.nodes = self.nodes;
sub.template = self.template;
self.lend_budgets(&mut sub);
let read = sub.open(Kind::Group, false).and_then(|()| sub.run());
self.take_back_budgets(&mut sub);
self.nodes = sub.nodes;
self.gradients = std::mem::take(&mut sub.gradients);
self.global_names = std::mem::take(&mut sub.global_names);
@@ -402,6 +404,7 @@ impl<'a> Reader<'a> {
sub.global_names = std::mem::take(&mut self.global_names);
sub.nodes = self.nodes;
sub.template = self.template;
self.lend_budgets(&mut sub);
let mut read = sub.open(Kind::Group, false);
for layer in &def.layers {
if read.is_err() {
@@ -409,6 +412,7 @@ impl<'a> Reader<'a> {
}
read = sub.pattern_layer(layer, def.tile);
}
self.take_back_budgets(&mut sub);
self.nodes = sub.nodes;
self.gradients = std::mem::take(&mut sub.gradients);
self.global_names = std::mem::take(&mut sub.global_names);
@@ -543,7 +547,9 @@ impl<'a> Reader<'a> {
sub.pattern_tiles = std::mem::take(&mut self.pattern_tiles);
sub.v7_patterns.clone_from(&self.v7_patterns);
sub.nodes = self.nodes;
self.lend_budgets(&mut sub);
let read = sub.open(Kind::Group, false).and_then(|()| sub.run());
self.take_back_budgets(&mut sub);
self.nodes = sub.nodes;
self.gradients = std::mem::take(&mut sub.gradients);
self.global_names = std::mem::take(&mut sub.global_names);
@@ -723,7 +729,9 @@ impl<'a> Reader<'a> {
sub.global_names = std::mem::take(&mut self.global_names);
sub.nodes = self.nodes;
sub.template = self.template;
self.lend_budgets(&mut sub);
let read = sub.open(Kind::Group, false).and_then(|()| sub.run());
self.take_back_budgets(&mut sub);
self.nodes = sub.nodes;
self.gradients = std::mem::take(&mut sub.gradients);
self.pattern_tiles = std::mem::take(&mut sub.pattern_tiles);
@@ -749,6 +757,21 @@ impl<'a> Reader<'a> {
self.brush_art.insert(name, node);
}
/// Lend `sub`, a reader of a definition, what this import may still spend on laying out blends
/// and checking envelopes ([`Reader::take_back_budgets`] takes back what is left).
fn lend_budgets(&mut self, sub: &mut Reader<'_>) {
sub.blend_budget = self.blend_budget;
sub.envelope_checks = self.envelope_checks;
sub.envelope_spent = std::mem::take(&mut self.envelope_spent);
}
/// Take back from `sub` what [`Self::lend_budgets`] lent it, less what it spent.
fn take_back_budgets(&mut self, sub: &mut Reader<'_>) {
self.blend_budget = sub.blend_budget;
self.envelope_checks = sub.envelope_checks;
self.envelope_spent = std::mem::take(&mut sub.envelope_spent);
}
/// In a pattern's definition, the operands of its first operator start with its head,
/// `(name) llx lly urx ury`: taken off them.
pub(super) fn take_head(&mut self, mut vals: Vec<V>) -> Vec<V> {
@@ -1107,4 +1130,66 @@ mod tests {
assert!(reader.brush_art.is_empty(), "{placed:?}");
}
}
/// A blend of two keys along a straight spine, with its drawn steps and its record.
fn blend() -> String {
use crate::import::ai::tests::{blend_file, blend_record};
blend_file("%_10 50 m\n%_110 50 L\n", [Some("A"), Some("B")], &blend_record(&['A', 'B']))
}
/// A symbol's definition named `name` whose art is `art`.
fn symbol_section(name: &str, art: &str) -> String {
format!("({name})\n0 A\n0 Xw\n0 Ae\nu\n{art}U\n")
}
/// Whether `n` or an object in it is a live blend.
fn holds_blend(n: &Node) -> bool {
matches!(n.kind, NodeKind::Blend { .. }) || n.children().is_some_and(|c| c.iter().any(|k| holds_blend(k)))
}
/// Blends in symbols' definitions lay out their objects from the import's one budget: once a
/// definition has spent it, the next definition's blend keeps its drawn steps.
#[test]
fn blends_in_symbol_definitions_spend_the_imports_budget() {
let mut reader = Reader::new(b"");
reader.define_symbol(symbol_section("One", &blend()).as_bytes());
let one = super::super::types::BLEND_BUDGET - reader.blend_budget;
assert!(one > 0, "the definition's blend spends from the reader's budget");
let mut reader = Reader::new(b"");
reader.blend_budget = one;
reader.define_symbol(symbol_section("One", &blend()).as_bytes());
reader.define_symbol(symbol_section("Two", &blend()).as_bytes());
assert_eq!(reader.blend_budget, 0);
let live: Vec<bool> = reader.doc.symbols.iter().map(|s| holds_blend(&s.art)).collect();
assert_eq!(live, [true, false]);
}
/// Blends in patterns' and brushes' art spend from the same budget.
#[test]
fn blends_in_pattern_and_brush_art_spend_the_imports_budget() {
let mut reader = Reader::new(b"");
reader.define_pattern(format!("(P) 0 0 200 100\n0 A\n0 Xw\n0 Ae\n{}E\n", blend()).as_bytes());
assert!(reader.blend_budget < super::super::types::BLEND_BUDGET, "a pattern's blend");
let mut reader = Reader::new(b"");
reader.define_brush_art(format!("(A)\n0 A\n{}", blend()).as_bytes());
assert!(reader.blend_budget < super::super::types::BLEND_BUDGET, "a brush's blend");
}
/// Envelopes in symbols' definitions are checked within the import's one count of checks.
#[test]
fn envelopes_in_symbol_definitions_spend_the_imports_checks() {
use crate::import::ai::tests::{drawn_content, envelope_content, envelope_of, straight_mesh, warp_keys};
use vectorcraft_doc::live::EnvelopeKind;
let want = EnvelopeKind::Warp { style: "arc".into(), bend: 50.0, h: 0.0, v: 0.0, horizontal: true };
let envelope =
envelope_of(&straight_mesh(1, 1, (120.0, 60.0)), &warp_keys(1, 0.5, 0.0, 0.0, 0), &envelope_content(), 1, &drawn_content(&want));
let mut reader = Reader::new(b"");
reader.define_symbol(symbol_section("One", &envelope).as_bytes());
assert_eq!(reader.envelope_checks, crate::import::ai::envelope::MAX_CHECKED - 1);
let mut reader = Reader::new(b"");
reader.envelope_checks = 1;
reader.define_symbol(symbol_section("One", &envelope).as_bytes());
reader.define_symbol(symbol_section("Two", &envelope).as_bytes());
assert_eq!(reader.envelope_checks, 0);
}
}
+62 -7
View File
@@ -3313,6 +3313,44 @@ fn legacy_tab_definitions_skipped_capped_and_left_open() {
assert!(texts[1].para_at(0).tabs.is_empty(), "the next object's `To` ends the open definition");
}
/// Point type whose 1024 tab stops are followed by 2048 paragraph breaks, each after `attrs(i)`.
fn paragraphs_after_many_tabs(attrs: impl Fn(usize) -> String) -> String {
let many: String = (0..1024).map(|i| format!("0 0 1 {i} Xe\n")).collect();
let breaks: String = (0..2048).map(|i| format!("{}(x\\r) Tx\n", attrs(i))).collect();
point_type(&format!("36 1024 Xb\n{many}XB"), "A").replace("TO\n", &format!("{breaks}TO\n"))
}
/// Paragraphs that start with the same attributes all keep the same tab stops, however many
/// there are, also when an attribute is set again to the value it has.
#[test]
fn legacy_tab_stops_last_through_many_paragraphs() {
for again in ["", "0 Ta\n"] {
let r = legacy_read(&paragraphs_after_many_tabs(|_| again.to_string()));
let texts = art_texts(&r.doc);
let [t] = texts.as_slice() else { panic!("{texts:?}") };
assert_eq!(t.paragraph_count(), 2049);
assert!((0..2049).all(|i| t.para_at(i).tabs.len() == 1024), "{again}");
assert!(r.warnings.is_empty(), "{again}: {:?}", r.warnings);
}
}
/// Each paragraph whose attributes differ from the paragraph before it holds its own copy of its
/// tab stops, and a text object's paragraphs hold no more than 1,048,576 stops: the paragraphs
/// past them take the default stops and keep their other attributes, with a warning.
#[test]
fn legacy_tab_stops_copied_into_paragraphs_are_capped() {
let r = legacy_read(&paragraphs_after_many_tabs(|i| format!("{} Ta\n", i % 2)));
let texts = art_texts(&r.doc);
let [t] = texts.as_slice() else { panic!("{texts:?}") };
let paras = t.paragraph_styles();
assert_eq!(paras.len(), 2049);
assert_eq!(paras.iter().map(|p| p.tabs.len()).sum::<usize>(), 1 << 20);
assert!(paras[..1024].iter().all(|p| p.tabs.len() == 1024));
assert!(paras[1024..].iter().all(|p| p.tabs.is_empty()));
assert_eq!((paras[2046].justify, paras[2047].justify), (vectorcraft_doc::Justify::Left, vectorcraft_doc::Justify::Center));
assert_eq!(r.warnings, ["tab stops past VectorCraft's limits were left out"]);
}
/// `Te` (end render, §22.6) reads in a text object with no operands and with four, inside a tab
/// definition too, and keeps nothing; so does `TM` (pop text matrix, §22.6).
#[test]
@@ -3625,6 +3663,23 @@ fn legacy_area_type_reads_up_to_its_limit_of_linked_areas() {
assert_eq!(r.warnings, [LINKED_AREAS_LEFT_OUT]);
}
/// The frames of linked areas after the first copy the story's last paragraph attributes, and
/// those copies hold no more than 1,048,576 tab stops: the frames past them take the default
/// stops, with a warning.
#[test]
fn legacy_linked_area_frames_cap_their_copied_tab_stops() {
let many: String = (0..1024).map(|i| format!("0 0 1 {i} Xe\n")).collect();
let area = format!("1 0 0 1 0 0 0 Tp\n{}n\nTP\n", rect_path(0.0, 0.0, 50.0, 40.0));
let text = format!("1 To\n{}0 Tr\n36 1024 Xb\n{many}XB\n(a) Tx\nTO\n", area.repeat(4096));
let r = legacy_read(&text);
let frames = art_frames(&r.doc);
assert_eq!(frames.len(), 4096);
let stops: Vec<usize> = frames.iter().map(|(_, f)| f.para_at(0).tabs.len()).collect();
assert_eq!(stops.iter().filter(|&&n| n == 1024).count(), 1025);
assert_eq!(stops.iter().filter(|&&n| n == 0).count(), 3071);
assert_eq!(r.warnings, ["tab stops past VectorCraft's limits were left out"]);
}
/// The warning when linked areas are left out.
const LINKED_AREAS_LEFT_OUT: &str = "linked type areas past VectorCraft's limits were left out";
@@ -5495,7 +5550,7 @@ fn envelope_parts(before: &str, keys: &str, block: &str, kind: u32, drawn: &str)
/// An envelope of `content` (in the plain group the editing data puts round it) shaped by the mesh
/// `shape`.
fn envelope_of(shape: &str, keys: &str, content: &str, kind: u32, drawn: &str) -> String {
pub(super) fn envelope_of(shape: &str, keys: &str, content: &str, kind: u32, drawn: &str) -> String {
envelope_parts(shape, keys, &format!("u\n{content}U\n9 () XW\n"), kind, drawn)
}
@@ -5527,7 +5582,7 @@ fn mesh_text(cols: usize, rows: usize, at: MeshAt<'_>, handle: MeshHandle<'_>, a
}
/// A grid in art space, its points `step` apart from (40, 20), handles a third of the way.
fn straight_mesh(cols: usize, rows: usize, step: (f64, f64)) -> String {
pub(super) fn straight_mesh(cols: usize, rows: usize, step: (f64, f64)) -> String {
let at = move |(i, j): (usize, usize)| (40.0 + i as f64 * step.0, 20.0 + j as f64 * step.1);
let third = move |p: (usize, usize), q: (usize, usize)| {
let ((x, y), (u, v)) = (at(p), at(q));
@@ -5537,13 +5592,13 @@ fn straight_mesh(cols: usize, rows: usize, step: (f64, f64)) -> String {
}
/// The red rectangle 40 20 160 80 in art space, which is the same box in the document's.
fn envelope_content() -> String {
pub(super) fn envelope_content() -> String {
format!("{RED}{}f\n", rect_path(40.0, 20.0, 160.0, 80.0))
}
/// What envelope `kind` draws of [`envelope_content`]: the rectangle's edges, many points to a
/// side, mapped as VectorCraft maps them, as a red path in art space.
fn drawn_content(kind: &vectorcraft_doc::live::EnvelopeKind) -> String {
pub(super) fn drawn_content(kind: &vectorcraft_doc::live::EnvelopeKind) -> String {
let rect = Rect::new(40.0, 20.0, 160.0, 80.0);
let map = vectorcraft_doc::live::envelope_mapper(kind, rect);
let corners = [Point::new(40.0, 20.0), Point::new(160.0, 20.0), Point::new(160.0, 80.0), Point::new(40.0, 80.0)];
@@ -5571,7 +5626,7 @@ fn live_envelope(n: &Node) -> (&[Arc<Node>], &vectorcraft_doc::live::EnvelopeKin
/// A warp's dictionary keys: style number `style`, bend, horizontal and vertical distortion as
/// fractions, and the orientation (vertical with `rotate` 1).
fn warp_keys(style: u32, bend: f64, h: f64, v: f64, rotate: u32) -> String {
pub(super) fn warp_keys(style: u32, bend: f64, h: f64, v: f64, rotate: u32) -> String {
format!(
"{ENVELOPE_KEYS}{style} /Int (DeformStyle) ,\n{h} /Real (DeformHoriz) ,\n{bend} /Real (DeformValue) ,\n{v} /Real (DeformVert) ,\n{rotate} /Bool (Rotate) ,\n(Warp) /UnicodeString (DisplayString) ,\n"
)
@@ -6209,7 +6264,7 @@ fn layer_options_of_nine_to_twelve_operands() {
/// A blend's record as the editing data writes it after `(Adobe Path Blends) 1 0 n XP`: `DCBA`,
/// Specified Steps, then (as far as the reader reads it) the number of keys at word 10 and a record
/// of six words per key starting with its id. Hand-written; the other words are zero.
fn blend_record(ids: &[char]) -> String {
pub(super) fn blend_record(ids: &[char]) -> String {
blend_record_spaced(ids, 1, 0.0, 0)
}
@@ -6241,7 +6296,7 @@ fn blend_part(kind: &str, id: Option<&str>) -> String {
/// A blend of two 20 pt squares, red on the left (key `A`) and blue on the right (`B`), along
/// `spine` (path operators, `%_` lines), with its drawn steps (three between the keys) and the
/// record `record`.
fn blend_file(spine: &str, ids: [Option<&str>; 2], record: &str) -> String {
pub(super) fn blend_file(spine: &str, ids: [Option<&str>; 2], record: &str) -> String {
blend_file_colored(spine, ids, record, [1.0, 0.0, 0.0], [0.0, 0.0, 1.0])
}
+1 -1
View File
@@ -816,7 +816,7 @@ impl<'a> Interp<'a> {
},
Bitshift => {
let (s, v) = (self.pop_int()?, self.pop_int()?);
let r = if s >= 0 { v.checked_shl(s.min(63) as u32) } else { v.checked_shr((-s).min(63) as u32) };
let r = if s >= 0 { v.checked_shl(s.min(63) as u32) } else { v.checked_shr(s.saturating_neg().min(63) as u32) };
self.push(Obj::Int(r.unwrap_or(0)))?;
}
True => self.push(Obj::Bool(true))?,
+15 -3
View File
@@ -103,7 +103,8 @@ fn layer_tree(nodes: &[Arc<Node>]) -> Vec<Arc<Node>> {
/// data was decompressed but its layers can't be read, and its swatches, brushes, graphic styles and
/// variables those of the editing data's palette ([`use_palette`]), brushes ([`use_brushes`]), styles
/// ([`use_styles`]) and variable library ([`use_variables`]) when it was decompressed: a graphic
/// style library, which has no layers, opens with its styles. `outlined`: the PDF part's type was
/// style library, which has no layers, opens with its styles, and editing data with no layers opens
/// on the page of its active artboard under the checks of `place_pages`. `outlined`: the PDF part's type was
/// read as outlines (a file whose type shows then comes in as its PDF part).
/// `trust`: layers that draw differently from the PDF part are used all the same, with a warning.
/// `unit`: the size in points of a unit of the PDF part's user space, its first page's `UserUnit`,
@@ -134,10 +135,14 @@ pub fn layered_ai_from(
};
if !has_layers(&data) {
let (mut visible, mut warnings) = (visible, warnings);
let (boards, active) = ai::artboards(&data);
if board_scale(&boards, &visible, unit).is_some() {
visible.opened_artboard = active_page(active, &visible);
}
let have = visible.patterns.len();
use_palette(&data, &mut visible);
use_brushes(&data, &mut visible, have, &mut warnings);
use_styles(&data, &mut visible, false, unit, None);
use_styles(&data, &mut visible, false, unit, Some(&boards));
use_variables(&data, &mut visible, &mut warnings);
return (visible, warnings, false);
}
@@ -347,7 +352,7 @@ fn place_pages(boards: &[(String, Rect)], active: Option<usize>, doc: &mut Docum
for ((name, _), a) in boards.iter().zip(&mut doc.artboards) {
a.name.clone_from(name);
}
doc.opened_artboard = active.filter(|i| *i > 0).and_then(|i| doc.artboards.get(i)).map(|a| a.id);
doc.opened_artboard = active_page(active, doc);
let [(_, first), _, ..] = boards else { return };
// Art space (y up) → the document, the first artboard's top left at the origin, as `read` has it,
// `k` points a unit.
@@ -362,6 +367,13 @@ fn place_pages(boards: &[(String, Rect)], active: Option<usize>, doc: &mut Docum
}
}
/// The id of the page of `doc` (a `.ai` read as its PDF part: a page per artboard) for the artboard
/// at `active` among those of its editing data, to open the file on: `None` for the first, which a
/// file opens on anyway, or when `doc` has no such page.
fn active_page(active: Option<usize>, doc: &Document) -> Option<u32> {
active.filter(|i| *i > 0).and_then(|i| doc.artboards.get(i)).map(|a| a.id)
}
/// The objects in `layer` (and its sublayers) moved by the move of the page they are on.
fn place_art(layer: &mut Node, pages: &[Rect], moves: &[Vec2]) {
let Some(children) = layer.children_mut() else { return };
+7
View File
@@ -1400,3 +1400,10 @@ fn stored_graphics_states_use_up_the_memory_budget() {
assert!(r.warnings.iter().any(|w| w.contains("uses too much memory")), "{body}: {:?}", r.warnings);
}
}
/// `bitshift` by the most negative integer shifts right by everything, not a negation overflow.
#[test]
fn bitshift_by_the_most_negative_integer_does_not_panic() {
let r = read("0 0 10 10 rectfill 1 -9223372036854775808 bitshift pop -1 -9223372036854775808 bitshift pop");
assert_eq!(objects(&r.document).len(), 1, "{:?}", r.warnings);
}
+43
View File
@@ -2335,6 +2335,49 @@ fn an_ai_file_read_as_its_pdf_part_keeps_its_active_artboard() {
assert_eq!(d.opened_artboard, Some(2));
}
/// A `.ai` whose editing data has artboards and no layers comes in as its PDF part, open on the
/// page of the artboard the editing data names as the active one when there is a page per artboard
/// of its size.
#[test]
fn an_ai_file_with_no_layers_keeps_its_active_artboard() {
let board = |x0: i32| {
format!(
"%_/Dictionary :\n%_{x0} 100 /RealPointRelToROrigin\n%_ (PositionPoint1) ,\n%_{} 0 /RealPointRelToROrigin\n%_ (PositionPoint2) ,\n%_; ,\n",
x0 + 100
)
};
let no_layers = |active: &str| {
native(&format!(
"%_/Document :\n%_/Dictionary :\n%_/Array :\n{}{}%_; (ArtboardArray) ,\n{active}%_; /NotRecorded ,\n%_;\n",
board(0),
board(120)
))
};
let mut pdf = pdf_part(10.0, 10.0);
let mut page = pdf.artboards[0].clone();
(page.id, page.rect) = (2, vectorcraft_geom::Rect::new(120.0, 0.0, 220.0, 100.0));
pdf.artboards.push(page.clone());
let opened = |pdf: &Document, active: &str| {
let data = no_layers(active);
assert!(!data.contains("%AI5_BeginLayer"));
let (d, w, read) = crate::layered_ai(&private(&data), pdf.clone(), vec![], false, false, 1.0);
assert!(!read && !w.iter().any(|w| w.contains("layers weren't read")), "{w:?}");
assert_eq!(d.artboards.iter().map(|a| a.rect).collect::<Vec<_>>(), pdf.artboards.iter().map(|a| a.rect).collect::<Vec<_>>());
d.opened_artboard
};
assert_eq!(opened(&pdf, "%_1 /Int (CropAreaActive) ,\n"), Some(2));
assert_eq!(opened(&pdf, "%_0 /Int (CropAreaActive) ,\n"), None);
assert_eq!(opened(&pdf, ""), None);
// Not a page per artboard, or a page of another size: the pages aren't the artboards.
let mut three = pdf.clone();
(page.id, page.rect) = (3, vectorcraft_geom::Rect::new(240.0, 0.0, 340.0, 100.0));
three.artboards.push(page);
assert_eq!(opened(&three, "%_1 /Int (CropAreaActive) ,\n"), None);
let mut other_size = pdf.clone();
other_size.artboards[1].rect = vectorcraft_geom::Rect::new(120.0, 0.0, 320.0, 100.0);
assert_eq!(opened(&other_size, "%_1 /Int (CropAreaActive) ,\n"), None);
}
#[test]
fn art_moved_with_its_page_moves_its_pattern_tile() {
// Two 100-point artboards, the second 50 below the first; an operator this doesn't know, so
+3
View File
@@ -53,6 +53,9 @@ pub use vello_cpu;
pub struct Renderer {
/// Glyph geometry per text object, keyed by `Arc` identity like `geom` (see [`Self::text_geom_of`]).
texts: FrameCache<usize, (Arc<Node>, Arc<TextGeom>)>,
/// The latest cached glyph geometry for each text object id. A move changes the node's Arc
/// but not its glyphs in text space, so the old geometry can still be used after comparison.
text_ids: PtrMap<NodeId, usize>,
/// The [`vectorcraft_text::FontDb::generation`] `texts` was laid out with: type lays out
/// again when fonts are added or rescanned.
text_fonts: u64,
+27 -1
View File
@@ -101,6 +101,33 @@ impl<K: Hash + Eq + Clone, V, S: BuildHasher + Default> FrameCache<K, V, S> {
Some(&s.value)
}
/// Read an entry only when it matches `accept`; rejected entries keep their previous age so
/// another document's object with the same id cannot prevent their eviction.
pub(crate) fn get_if<Q>(&mut self, k: &Q, stamp: u64, accept: impl FnOnce(&V) -> bool) -> Option<&V>
where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
{
let s = self.map.get_mut(k)?;
if !accept(&s.value) {
return None;
}
self.clock += 1;
(s.stamp, s.used) = (stamp, self.clock);
Some(&s.value)
}
/// Drop the entry for `k`.
pub(crate) fn remove<Q>(&mut self, k: &Q)
where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
{
if let Some(s) = self.map.remove(k) {
self.bytes -= s.bytes;
}
}
/// Keep `value` (about `bytes` bytes) as `k`, used in frame `stamp`, replacing any entry for
/// `k`. Least recently used entries of earlier frames make room; returns false when they can't
/// (the value isn't kept then).
@@ -196,7 +223,6 @@ impl<K: Hash + Eq + Clone, V, S: BuildHasher + Default> FrameCache<K, V, S> {
self.bytes
}
#[cfg(test)]
pub(crate) fn contains_key<Q>(&self, k: &Q) -> bool
where
K: Borrow<Q>,
+2
View File
@@ -33,6 +33,7 @@ impl Renderer {
pub fn new() -> Self {
Self {
texts: FrameCache::new(lru::TEXT_BUDGET, 1024),
text_ids: PtrMap::default(),
text_fonts: 0,
clips: FrameCache::new(lru::CLIP_BUDGET, 256),
threads: default_threads(),
@@ -208,6 +209,7 @@ impl Renderer {
// Filtered rasters are large: only those of the last frame stay.
self.pixel_fx.retain(|_, e| e.stamp == g);
self.texts.sweep(g);
self.text_ids.retain(|_, key| self.texts.contains_key(key));
self.char_strokes.sweep(g);
self.clips.sweep(g);
self.clip_paints.sweep(g);
+17 -3
View File
@@ -313,11 +313,25 @@ impl Renderer {
}
#[cfg(test)]
STROKES_OUTLINED.with(|n| n.set(n.get() + 1));
// A long stroke without a width profile is outlined only in and around the view, with a
// margin of the view's own size on each side ([`crop_dashed`] for a dashed one,
// [`crop_line`] otherwise).
// A long stroke is outlined only in and around the view, with a margin of the view's
// own size on each side. Width profiles keep their positions on the whole path.
let region = v.inflate(v.width(), v.height());
let tol = 2f64.powi(level);
if crops()
&& line.elements().len() > CROP_ELEMENTS
&& st.dash.is_none()
&& width >= tol * 4.0
&& let Some(profile) = &st.profile
&& profile.points.iter().all(|(t, l, r)| t.is_finite() && l.is_finite() && r.is_finite())
{
let side = profile.points.iter().flat_map(|&(_, l, r)| [l, r]).fold(1.0_f64, f64::max);
let reach = crop_reach(st, width * side, f.px, tol);
if let Some(outline) = effects::stroke::line_outline_profile_near(line, st, width, tol, region.inflate(reach, reach)) {
let outline = Arc::new(outline);
self.keep_stroke(key, StrokeEntry { node, outline: outline.clone(), stamp: self.stamp, crop: Some(region), own }, moved);
return Some(outline);
}
}
if crops()
&& line.elements().len() > CROP_ELEMENTS
&& st.dash.is_some()
+37 -4
View File
@@ -151,20 +151,53 @@ impl Renderer {
let fonts = vectorcraft_text::FontDb::global().generation();
if fonts != self.text_fonts {
self.texts.clear();
self.text_ids.clear();
self.char_strokes.clear();
self.text_fonts = fonts;
}
let key = Arc::as_ptr(a) as usize;
if let Some((node, g)) = self.texts.get(&key, self.stamp)
&& Arc::ptr_eq(node, a)
{
if let Some((_, g)) = self.texts.get_if(&key, self.stamp, |(node, _)| Arc::ptr_eq(node, a)) {
return (g.clone(), true);
}
if let Some(&previous) = self.text_ids.get(&a.id)
&& let Some(g) = self
.texts
.get_if(&previous, self.stamp, |(node, _)| {
let NodeKind::Text(old) = &node.kind else { return false };
// Shrink Text to Fit searches document-point sizes, so a scale change can
// alter layout. Translation leaves the glyphs in text space unchanged.
if old.xf.as_coeffs()[..4] != t.xf.as_coeffs()[..4] {
return false;
}
let mut comparable = (**old).clone();
comparable.xf = t.xf;
comparable == *t
})
.map(|(_, g)| g.clone())
{
// Kept under this node from here on: the next frames find it without comparing.
self.texts.remove(&previous);
let kept = self.keep_text(a, g.clone());
return (g, kept);
}
let g = Arc::new(text_geom(t));
let kept = self.texts.insert(key, (a.clone(), g.clone()), g.bytes(), self.stamp);
let kept = self.keep_text(a, g.clone());
(g, kept)
}
/// Keep glyph geometry `g` of text node `a`, as the latest of its id. Whether it was kept.
fn keep_text(&mut self, a: &Arc<Node>, g: Arc<TextGeom>) -> bool {
let key = Arc::as_ptr(a) as usize;
let bytes = g.bytes();
let kept = self.texts.insert(key, (a.clone(), g), bytes, self.stamp);
if kept {
self.text_ids.insert(a.id, key);
} else {
self.text_ids.remove(&a.id);
}
kept
}
/// Draw type `n` (`t`, laid out in `g`). The outlines of its character strokes are cached
/// when `g` is kept in `texts` (`kept`).
pub(super) fn draw_text_geom(&mut self, ctx: &mut RenderContext, f: &Frame, n: &Node, t: &TextObject, g: &Arc<TextGeom>, kept: bool) {
+68 -3
View File
@@ -2,9 +2,9 @@
//! take every stroke option, as path strokes do.
use vectorcraft_color::{Color, Paint};
use vectorcraft_doc::text::{CharStyle, TextObject};
use vectorcraft_doc::{AppearanceItem, Dash, LineJoin, Node, NodeKind};
use vectorcraft_geom::Point;
use vectorcraft_doc::text::{CharStyle, TextKind, TextObject};
use vectorcraft_doc::{AppearanceItem, AreaFit, Dash, LineJoin, Node, NodeKind};
use vectorcraft_geom::{PathData, Point};
use crate::tests_fontchange::fonts_steady;
use crate::*;
@@ -164,6 +164,71 @@ fn character_stroke_outlines_are_kept_between_frames() {
assert!(changed.len() == 1 && !Arc::ptr_eq(&changed[0], &first[0]), "the changed text is expanded again");
}
#[test]
fn moving_type_reuses_character_strokes_without_changing_pixels() {
let _fonts = fonts_steady();
let (mut d, id) = stroked_text_doc("Type");
let opts = RenderOptions::default();
let mut r = Renderer::new();
r.render(&d, SIZE, SIZE, Affine::IDENTITY, &opts);
let first = character_outlines(&r);
assert_eq!(first.len(), 1);
if let Some(Node { kind: NodeKind::Text(t), .. }) = d.node_mut(id) {
t.xf = Affine::translate((10.0, 0.0)) * t.xf;
}
let moved = r.render(&d, SIZE, SIZE, Affine::IDENTITY, &opts);
let again = character_outlines(&r);
assert!(again.len() == 1 && Arc::ptr_eq(&again[0], &first[0]), "a move reuses the character stroke outline");
assert_eq!(moved.pixels, Renderer::new().render(&d, SIZE, SIZE, Affine::IDENTITY, &opts).pixels);
// The entry moved to the node shown, so the next frames find it without comparing the text.
let node = d.node_arc(id).unwrap();
assert!(r.texts.contains_key(&(Arc::as_ptr(node) as usize)), "kept under the moved node");
assert_eq!(r.texts.len(), 1, "and not also under the old one");
}
#[test]
fn scaling_fitted_area_type_rebuilds_its_glyph_geometry() {
let _fonts = fonts_steady();
// 2 pt type, drawn 20× zoomed in. Shrink Text to Fit steps the size in tenths of a document
// point, so at 2 pt and at 3 pt it fits the same words at different fractions of full size.
let (mut d, id) = stroked_text_doc("Type");
if let Some(Node { kind: NodeKind::Text(t), .. }) = d.node_mut(id) {
t.xf = Affine::IDENTITY;
t.runs[0].style.size = 2.0;
t.runs[0].style.stroke_width = 0.05;
t.kind = TextKind::Area { frame: PathData::from_bezpath(&Rect::new(0.0, 0.0, 3.0, 3.0).to_path(0.1)) };
t.area.fit = AreaFit::ShrinkText { min_percent: 30.0 };
}
let text = |d: &Document| match d.node(id).map(|n| &n.kind) {
Some(NodeKind::Text(t)) => (**t).clone(),
_ => panic!("the text object"),
};
let fit = |d: &Document| vectorcraft_text::layout(vectorcraft_text::FontDb::global(), &text(d)).fit_scale;
let view = Affine::scale(20.0);
let opts = RenderOptions::default();
let mut r = Renderer::new();
r.render(&d, SIZE, SIZE, view, &opts);
let first = r.texts.used_in(r.stamp).next().unwrap().1.clone();
let before = fit(&d);
if let Some(Node { kind: NodeKind::Text(t), .. }) = d.node_mut(id) {
t.xf = Affine::scale(1.5) * t.xf;
}
let after = fit(&d);
assert!(before > 0.3 && before < 1.0 && after > 0.3 && after < 1.0, "it fits above the minimum both times: {before}, {after}");
assert!((before - after).abs() > 0.01, "the scale changes the fitted size: {before}, {after}");
let scaled = r.render(&d, SIZE, SIZE, view, &opts);
let again = r.texts.used_in(r.stamp).next().unwrap().1.clone();
assert!(!Arc::ptr_eq(&first, &again), "changing area type's scale lays it out again");
assert_eq!(scaled.pixels, Renderer::new().render(&d, SIZE, SIZE, view, &opts).pixels);
// The words set at the earlier fit, which reusing the earlier layout would draw, draw other pixels.
let mut stale = d.clone();
if let Some(Node { kind: NodeKind::Text(t), .. }) = stale.node_mut(id) {
**t = vectorcraft_text::scaled(t, before);
}
assert_eq!(fit(&stale), 1.0, "the earlier fit's words fit as they are");
assert_ne!(scaled.pixels, Renderer::new().render(&stale, SIZE, SIZE, view, &opts).pixels, "the new fit changes the pixels");
}
/// Frames that draw character strokes from the cache draw the same pixels, and what a renderer
/// draws whose glyph cache has no room, so that it expands them in every frame: exactly at 100%,
/// where both take a tolerance of 1/4 device pixel, and within antialiasing at 105% and 150%,
+42 -1
View File
@@ -2,7 +2,7 @@
//! and for dashes `dash_kept`), and draws the same pixels as when it is outlined whole.
use vectorcraft_color::{Color, Paint};
use vectorcraft_doc::{Appearance, AppearanceItem, LineCap, LineJoin, Node, StrokeLayer};
use vectorcraft_doc::{Appearance, AppearanceItem, LineCap, LineJoin, Node, StrokeLayer, WidthProfile};
use vectorcraft_geom::{PathData, Point, Vec2};
use crate::renderer::{CROP_STROKES, crop_line};
@@ -66,6 +66,47 @@ fn zigzag() -> BezPath {
bp
}
#[test]
fn a_long_profile_stroke_keeps_its_widths_when_outlined_near_the_view() {
let mut lens = stroke(16.0, LineJoin::Miter, LineCap::Square);
lens.profile = WidthProfile::preset("lens");
let mut taper = stroke(12.0, LineJoin::Round, LineCap::Round);
taper.profile = WidthProfile::preset("taperEnd");
let mut asymmetric = stroke(12.0, LineJoin::Miter, LineCap::Square);
asymmetric.profile = Some(WidthProfile { points: vec![(0.0, 2.0, 0.1), (1.0, 0.1, 2.0)] });
let mut two = zigzag();
two.move_to(Point::new(0.0, 100.0));
for i in 1..3000 {
two.line_to(Point::new(i as f64 * 8.0, 100.0));
}
for (name, d, at, cropped) in [
("open zigzag, lens at middle", doc(&zigzag(), lens), Point::new(12_000.0, 15.0), true),
("open zigzag, taper at start", doc(&zigzag(), taper.clone()), Point::new(0.0, 15.0), true),
("open zigzag, taper at end", doc(&zigzag(), taper.clone()), Point::new(23_990.0, 15.0), true),
("open zigzag, asymmetric profile", doc(&zigzag(), asymmetric), Point::new(12_000.0, 15.0), true),
("two open subpaths", doc(&two, taper.clone()), Point::new(12_000.0, 60.0), true),
("closed ring at seam", doc(&ring(4000, 5000.0), taper.clone()), Point::new(5000.0, 0.0), false),
("closed ring away from seam", doc(&ring(4000, 5000.0), taper), Point::new(0.0, 5000.0), false),
] {
let mut renderer = Renderer::new();
let near = render(&mut renderer, &d, at);
assert_eq!(renderer.strokes.values().any(|e| e.crop.is_some()), cropped, "{name}: crop choice");
let full = whole(&d, at);
let mismatched: Vec<_> = near
.pixels
.as_chunks::<4>()
.0
.iter()
.zip(full.pixels.as_chunks::<4>().0.iter())
.enumerate()
.filter(|(_, (a, b))| a != b)
.take(8)
.map(|(i, (a, b))| (i % SIZE as usize, i / SIZE as usize, a.to_vec(), b.to_vec()))
.collect();
assert!(mismatched.is_empty(), "{name}: pixels differ at {mismatched:?}");
}
}
/// A closed polygon of `n` anchors round a circle of radius `r` about the origin.
fn ring(n: usize, r: f64) -> BezPath {
let mut bp = BezPath::new();
+18 -1
View File
@@ -27,7 +27,7 @@ pub const THAI_FAMILIES: &[&str] = &[
];
/// The families tried first for character `c`, in a script whose text only fonts made for it set
/// well (Thai, Lao, Khmer, Myanmar); none for other characters.
/// well (Thai, Lao, Khmer, Myanmar, Devanagari); none for other characters.
pub(super) fn script_families(c: char) -> &'static [&'static str] {
use unicode_script::{Script, UnicodeScript};
match c.script() {
@@ -35,6 +35,15 @@ pub(super) fn script_families(c: char) -> &'static [&'static str] {
Script::Lao => &["Lao UI", "Leelawadee UI", "Lao Sangam MN", "Noto Sans Lao", "Noto Sans Lao UI", "Phetsarath OT"],
Script::Khmer => &["Khmer UI", "Khmer Sangam MN", "Noto Sans Khmer", "Noto Sans Khmer UI", "Khmer OS"],
Script::Myanmar => &["Myanmar Text", "Myanmar Sangam MN", "Noto Sans Myanmar", "Noto Sans Myanmar UI", "Padauk"],
Script::Devanagari => &[
"Nirmala UI",
"Kohinoor Devanagari",
"Devanagari Sangam MN",
"Noto Sans Devanagari",
"Noto Sans Devanagari UI",
"Lohit Devanagari",
"Mangal",
],
_ => &[],
}
}
@@ -138,6 +147,14 @@ pub(super) fn norm(s: &str) -> String {
mod tests {
use super::*;
/// Devanagari takes a font made for it, not whichever face covering it loaded first.
#[test]
fn devanagari_prefers_fonts_made_for_it() {
assert_eq!(script_families('ह').first(), Some(&"Nirmala UI"));
assert!(script_families('ह').contains(&"Noto Sans Devanagari"));
assert!(script_families('a').is_empty());
}
#[test]
fn a_name_table_of_many_records_is_cut_short() {
let many: Vec<(u16, &str)> = (0..2000).map(|_| (1, "Short")).collect();
+5 -1
View File
@@ -34,7 +34,11 @@ pub fn story_paras(frames: &[&TextObject], later_wins: &[bool]) -> Vec<ParaStyle
}
out.extend(styles);
let text = f.plain_text();
prev_empty_tail = text.is_empty() || text.ends_with('\n') || out.is_empty();
// An empty frame has no paragraph boundary of its own. Keep the preceding frame's
// boundary state so another empty frame cannot replace a paragraph's edited style.
if !text.is_empty() {
prev_empty_tail = text.ends_with('\n') || out.is_empty();
}
}
out
}
+19
View File
@@ -144,6 +144,25 @@ fn paragraph_styles_flow_with_their_paragraphs() {
assert_eq!(story_paras(&[&fa, &fb], &[false, false])[0].justify, Left);
}
#[test]
fn empty_frames_do_not_replace_an_earlier_paragraph_style() {
let mut first = frame(0.0);
first.runs = vec![TextRun { text: "First".into(), style: CharStyle::default(), inline: None }];
first.set_all_paras(ParaStyle { justify: Justify::Right, ..Default::default() });
let middle = frame(200.0);
let last = frame(400.0);
assert_eq!(story_paras(&[&first, &middle, &last], &[true, false, false])[0].justify, Justify::Right);
// An empty frame between two parts of the same paragraph changes no style either.
let mut last_with_text = last.clone();
last_with_text.runs = vec![TextRun { text: "Tail".into(), style: CharStyle::default(), inline: None }];
assert_eq!(story_paras(&[&first, &middle, &last_with_text], &[true, false, false])[0].justify, Justify::Right);
let mut restyled_middle = middle.clone();
restyled_middle.set_all_paras(ParaStyle { justify: Justify::Center, ..Default::default() });
assert_eq!(story_paras(&[&first, &restyled_middle, &last], &[false, true, false])[0].justify, Justify::Center);
}
/// Numbered list paragraphs count on from one frame to the next: the second frame's first
/// whole paragraph takes the next number. A paragraph split between the frames has its number
/// in the first frame only, and the paragraph after it takes the next number.
+10 -5
View File
@@ -50,7 +50,7 @@ use std::borrow::Cow;
use std::collections::{BTreeMap, BTreeSet};
use serde_json::{Value, json};
use vectorcraft_doc::hit::{HitKind, compound_part_at, hit_test, selected_hidden_at};
use vectorcraft_doc::hit::{Hit, HitKind, compound_part_at, hit_test, selected_hidden_at};
use vectorcraft_doc::{AnchorRef, Node, NodeId, NodeKind, Selection};
use vectorcraft_geom::{Anchor, PathData, PathSeg, Point, Rect, Vec2};
@@ -1061,7 +1061,8 @@ impl DirectSelectionTool {
}
// A selected path's anchors or the anchors of the path under the pointer, as Highlight
// anchors on mouse over finds them: walking every path on each hover is too slow.
if let Some((id, _)) = hovered_anchor(cx, p) {
let hit = hit_test(cx.doc, p, cx.selection_hit_options());
if let Some((id, _)) = hovered_anchor_with_hit(cx, p, hit.as_ref()) {
return Some(if cx.selection.contains(id) { Cursor::DirectAnchorSelected } else { Cursor::DirectAnchor });
}
if hit_frame_edge(cx, p, tol).is_some() {
@@ -1073,7 +1074,7 @@ impl DirectSelectionTool {
if m.shift || self.guide.cursor(cx, p).is_some() {
return None;
}
let h = hit_test(cx.doc, p, cx.selection_hit_options())?;
let h = hit?;
let whole = cx.selection.contains(h.leaf) && cx.selection.partial(h.leaf).is_none();
let curved = matches!(h.kind, HitKind::Stroke | HitKind::Outline) && segment_at(cx, h.leaf, p).is_some_and(|s| s.curved);
(!whole && curved).then_some(Cursor::ReshapeSegment)
@@ -1083,9 +1084,13 @@ impl DirectSelectionTool {
/// The anchor within a press's reach of `p` ([`ToolContext::point_tol`]), of a selected path or the
/// path under `p`: what Highlight anchors on mouse over marks (a press there picks it).
fn hovered_anchor(cx: &ToolContext, p: Point) -> Option<(NodeId, Point)> {
let hit = hit_test(cx.doc, p, cx.selection_hit_options());
hovered_anchor_with_hit(cx, p, hit.as_ref())
}
fn hovered_anchor_with_hit(cx: &ToolContext, p: Point, hit: Option<&Hit>) -> Option<(NodeId, Point)> {
let tol = cx.point_tol();
let under =
hit_test(cx.doc, p, cx.selection_hit_options()).map(|h| cx.doc.node(h.leaf).and_then(|n| compound_part_at(n, p, tol)).unwrap_or(h.leaf));
let under = hit.map(|h| cx.doc.node(h.leaf).and_then(|n| compound_part_at(n, p, tol)).unwrap_or(h.leaf));
cx.selection.objects.iter().copied().filter(|id| in_scope(cx.doc, cx.isolation, *id)).chain(under).find_map(|id| {
let path = cx.doc.node(id).and_then(editable_path)?;
nearest_anchor(&path, p, tol).map(|(.., a)| (id, a))
+8 -2
View File
@@ -1059,10 +1059,16 @@ impl Tool for SelectionTool {
if self.guide.busy() {
return self.guide.cursor(cx, p).unwrap_or_default();
}
if over_widget(cx, p, false) {
// Corner widgets sit inside selected art, and pie widgets extend at most 17 screen
// pixels beyond it. A distant pointer cannot take either one, so avoid building their
// widgets for every selected object on each cursor move.
let near_selected = cx.selection.objects.len() <= 128
|| cx.preview_bounds
|| selection_bounds(cx).is_none_or(|b| b.inflate(cx.tol(32.0), cx.tol(32.0)).contains(p));
if near_selected && over_widget(cx, p, false) {
return Cursor::CornerRadius;
}
if pie::over_widget(cx, p) {
if near_selected && pie::over_widget(cx, p) {
return Cursor::ArrowHollow;
}
if over_rotate_all(cx, p) {
+59
View File
@@ -545,6 +545,65 @@ fn the_rotate_cursor_wraps_the_corner_it_is_at() {
assert_eq!(Cursor::rotate_about(Point::ORIGIN, Point::new(0.0, -5.0)), Cursor::RotateToward(0), "straight up");
}
#[test]
fn a_rotated_large_selection_keeps_handles_outside_its_axis_aligned_bounds() {
use vectorcraft_doc::{Appearance, Node};
use vectorcraft_geom::shapes;
let mut d = vectorcraft_doc::Document::new(4000.0, 500.0);
let layer = d.layers[0].id;
let mut ids = vec![];
for i in 0..129 {
let id = d.alloc_id();
let x = 100.0 + i as f64 * 25.0;
let mut node = Node::path(id, shapes::rectangle(Rect::new(x, 100.0, x + 20.0, 120.0)), Appearance::default_art());
node.bbox_angle = 45.0;
d.insert(Some(layer), usize::MAX, node).unwrap();
ids.push(id);
}
let mut selection = Selection::default();
selection.set(ids);
let paint = paint();
let cx = cx(&d, &selection, &paint);
let bx = selection_box(&cx).unwrap();
let bounds = selection_bounds(&cx).unwrap().inflate(cx.tol(32.0), cx.tol(32.0));
let p = [Point::new(bx.rect.x0, bx.rect.y0), Point::new(bx.rect.x1, bx.rect.y0), Point::new(bx.rect.x1, bx.rect.y1)]
.into_iter()
.map(|q| bx.to_doc() * q)
.find(|q| !bounds.contains(*q))
.unwrap();
assert!(matches!(box_hit(&cx, &bx, p), Some(BoxHit::Handle(_))));
assert_ne!(SelectionTool::default().cursor(&cx, p, Mods::default()), Cursor::Arrow);
}
#[test]
fn a_large_selection_keeps_a_pie_widget_just_outside_the_art() {
use vectorcraft_doc::{Appearance, LiveShape, Node, NodeKind};
use vectorcraft_geom::{Affine, shapes};
let mut d = vectorcraft_doc::Document::new(500.0, 500.0);
let layer = d.layers[0].id;
let live = LiveShape::Ellipse { w: 200.0, h: 100.0, pie: (0.0, 360.0), xf: Affine::translate((100.0, 100.0)) };
let id = d.alloc_id();
let mut ellipse = Node::path(id, live.to_path(), Appearance::default_art());
if let NodeKind::Path { live: slot, .. } = &mut ellipse.kind {
*slot = Some(Box::new(live));
}
d.insert(Some(layer), 0, ellipse).unwrap();
let mut ids = vec![id];
for _ in 0..128 {
let id = d.alloc_id();
d.insert(Some(layer), usize::MAX, Node::path(id, shapes::rectangle(Rect::new(120.0, 120.0, 140.0, 140.0)), Appearance::default_art()))
.unwrap();
ids.push(id);
}
let mut selection = Selection::default();
selection.set(ids);
let paint = paint();
let cx = cx(&d, &selection, &paint);
assert_eq!(SelectionTool::default().cursor(&cx, Point::new(312.0, 150.0), Mods::default()), Cursor::ArrowHollow);
}
#[test]
fn turned_cursors_step_with_the_view() {
assert_eq!(Cursor::ResizeH.turned(90.0), Cursor::ResizeV);
+2 -1
View File
@@ -9287,7 +9287,8 @@ fn direct_selection_shows_the_bounding_box_while_cmd_is_held() {
let handle_drawn = |app: &mut VectorcraftApp, modifiers: egui::Modifiers| {
let screen = Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0)));
let raw = egui::RawInput { screen_rect: screen, events: vec![egui::Event::ModifiersChanged(modifiers)], ..Default::default() };
let out = ctx.run_ui(raw, |ui| show(app, ui));
let mut out = ctx.run_ui(raw, |ui| show(app, ui));
out.textures_delta.clear(); // the render worker's frame can land in any of these
fn flat(s: Shape, out: &mut Vec<Shape>) {
match s {
Shape::Vec(v) => v.into_iter().for_each(|s| flat(s, out)),
+12 -2
View File
@@ -66,7 +66,7 @@ fn plural_czech(n: u64) -> usize {
}
}
/// French: 0 and 1 are `one` (« 0 calque »), everything else `other`.
/// French and Hindi integer counts: 0 and 1 are `one`, everything else `other`.
fn plural_french(n: u64) -> usize {
usize::from(n > 1)
}
@@ -97,8 +97,18 @@ fn plural_polish(n: u64) -> usize {
}
/// The registry. English first: it is the fallback and the source language.
pub static LANGUAGES: [LangInfo; 27] = [
pub static LANGUAGES: [LangInfo; 28] = [
LangInfo { code: "en", name: "English", source: "", plural: plural_one_other, complete_menus: false, catalog: OnceLock::new() },
// Hindi shares the integer zero/one rule with French. Desktop UI fonts are loaded lazily
// from installed faces by ui_fonts; the web needs a Devanagari font in its font set.
LangInfo {
code: "hi",
name: "हिन्दी",
source: include_str!("i18n/hi.tsv"),
plural: plural_french,
complete_menus: true,
catalog: OnceLock::new(),
},
// Greek: the whole interface and the status and error messages, keeping the same names in
// English as Spanish; every `el-*` locale (including `el-GR` and `el-CY`) resolves here.
LangInfo {
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+46 -5
View File
@@ -3,6 +3,35 @@ use super::*;
const ZH: fn() -> Lang = || Lang::from_code("zh-hant").expect("zh-hant registered");
#[test]
fn hindi_resolves_locales_and_uses_zero_one_plurals() {
let hi = Lang::from_code("hi").expect("hi registered");
for tag in ["hi", "hi-IN", "hi_IN.UTF-8", "HI-in", "hi-Deva-IN"] {
assert_eq!(lang_from_tag(tag), Some(hi), "{tag}");
}
assert_eq!(hi.name(), "हिन्दी");
assert_eq!([0, 1, 2, 21, u64::MAX].map(hi.0.plural), [0, 0, 1, 1, 1]);
assert_eq!(tr(hi, "Save"), "सेव");
assert_eq!(tr(hi, "Save As…"), "सेव ऐज़…");
assert_eq!(tr(hi, "Path"), "पाथ");
assert_eq!(tr(hi, "Selection"), "सिलेक्शन");
assert_eq!(tr(hi, "Properties"), "प्रॉपर्टीज़");
assert_eq!(tr(hi, "Options"), "ऑप्शन्स");
assert_eq!(tr(hi, "Open"), "ओपन");
let (entries, errors) = parse_entries(hi.0.source);
assert!(errors.is_empty(), "{errors:?}");
for (ctx, src, translation) in entries.iter().filter(|(ctx, _, _)| ctx == "@plural" || ctx == "@msgplural") {
let (one, other) = src.split_once('|').expect("one|other source");
let forms: Vec<_> = translation.split('|').collect();
assert_eq!(forms.len(), 2, "{ctx}: {src}");
if ctx == "@plural" {
for (n, index) in [(0, 0), (1, 0), (2, 1), (21, 1)] {
assert_eq!(trn(hi, n, one, other), forms[index].replace("{n}", &n.to_string()));
}
}
}
}
/// Locale tags name their language by region or script (in either case, with an encoding or
/// modifier), and a tag that names no language resolves to none.
#[test]
@@ -404,6 +433,11 @@ fn is_georgian(c: char) -> bool {
matches!(c as u32, 0x10A0..=0x10FF | 0x1C90..=0x1CBF | 0x2D00..=0x2D2F)
}
#[cfg(feature = "interface-fonts")]
fn is_devanagari(c: char) -> bool {
matches!(c as u32, 0x0900..=0x097F | 0x1CD0..=0x1CFF | 0xA8E0..=0xA8FF)
}
/// The UI fonts draw every character the catalogs use, in every family the UI draws text with
/// (the web build has no system fonts to fall back to). Chinese and Japanese characters come from
/// the craft-fonts build input, which is optional: without it they are left to the installed
@@ -416,6 +450,7 @@ fn is_georgian(c: char) -> bool {
fn bundled_fonts_cover_the_catalogs() {
let japanese_ui_font = vectorcraft_text::CRAFT_FONTS.iter().any(|f| f.is_japanese());
let georgian_ui_font = vectorcraft_text::CRAFT_FONTS.iter().any(|f| f.is_georgian());
let devanagari_ui_font = vectorcraft_text::CRAFT_FONTS.iter().any(|f| f.scripts.contains(&"Deva"));
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let mut output = ctx.run_ui(egui::RawInput::default(), |_| {});
@@ -434,7 +469,12 @@ fn bundled_fonts_cover_the_catalogs() {
let chars: std::collections::BTreeSet<char> = entries
.iter()
.flat_map(|(_, _, tr)| tr.chars())
.filter(|c| !c.is_whitespace() && (cjk_checked || !is_cjk(*c)) && (georgian_ui_font || !is_georgian(*c)))
.filter(|c| {
!c.is_whitespace()
&& (cjk_checked || !is_cjk(*c))
&& (georgian_ui_font || !is_georgian(*c))
&& (devanagari_ui_font || !is_devanagari(*c))
})
.collect();
for family in &families {
let font = egui::FontId::new(13.0, family.clone());
@@ -1082,8 +1122,8 @@ fn cs() -> Lang {
}
/// Languages whose catalogs leave [`MENU_KEEP_AS_IS`] in English.
const KEEPS_MENU_NAMES: [&str; 19] =
["cs", "de", "el", "es", "fr", "hu", "it", "ja", "ka", "ko", "pl", "pt-br", "ru", "sv", "uk", "vi", "fi", "tr", "ca"];
const KEEPS_MENU_NAMES: [&str; 20] =
["cs", "de", "el", "es", "fr", "hi", "hu", "it", "ja", "ka", "ko", "pl", "pt-br", "ru", "sv", "uk", "vi", "fi", "tr", "ca"];
/// Menu labels the menu-complete catalogs (Czech, German, Spanish, Italian, Japanese, Brazilian Portuguese) show as they are: the product name, a format name, the built-in workspace
/// names and the perspective grid presets (names, shown untranslated wherever else they appear).
@@ -2024,8 +2064,9 @@ fn shared_param_check_errors_show_their_values_as_given() {
/// Languages whose catalogs translate status and error messages; [`untranslated_report`] lists
/// the messages each one lacks.
const COMPLETE_MESSAGES: &[&str] =
&["cs", "de", "el", "es", "fr", "hu", "it", "ja", "ka", "ko", "pl", "pt-br", "ru", "sv", "uk", "vi", "zh-hans", "zh-hant", "fi", "tr", "ca"];
const COMPLETE_MESSAGES: &[&str] = &[
"cs", "de", "el", "es", "fr", "hi", "hu", "it", "ja", "ka", "ko", "pl", "pt-br", "ru", "sv", "uk", "vi", "zh-hans", "zh-hant", "fi", "tr", "ca",
];
/// 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"];
+17 -36
View File
@@ -467,20 +467,27 @@ fn multi_color(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool {
}
}
/// Edit Artboards (the Artboard tool): the active artboard's name, which can be edited to rename
/// it, and the Artboard Options icon; its position and size, its preset and
/// orientation (#671) (with Scale Artwork with Artboard on, a new size scales its art, #602; a new
/// W or H, preset or orientation goes to every selected artboard, in one undo step), its Fill (background color, also for every selected artboard), Move
/// and Scale Artwork with Artboard, New Artboard and Delete Artboard, and Quick Actions: Rearrange All (#681) and
/// Exit back to the Selection tool (#530).
/// Edit Artboards (the Artboard tool), as in the reference app (#5219): a Transform section with
/// the active artboard's reference point, position and size (as in the Transform panel: X and Y
/// are the reference point's, and a new W or H keeps it in place, with the Constrain Width and
/// Height Proportions link; with Scale Artwork with Artboard on, a new size scales its art, #602;
/// a new W or H, preset or orientation goes to every selected artboard, in one undo step), its
/// preset and orientation (#671), and Move and Scale Artwork with Artboard; then an Artboards
/// section with its name, which can be edited to rename it, the Artboard Options icon, its Fill
/// (background color, also for every selected artboard), New Artboard and Delete Artboard; and
/// Quick Actions: Rearrange All (#681) and Exit back to the Selection tool (#530).
fn artboard_sections(app: &mut VectorcraftApp, ui: &mut Ui) {
let units = app.session.general_unit();
let origin = app.ruler_origin();
let n = app.session.active().map_or(0, |d| d.doc.artboards.len());
let i = super::artboards::selected(app, n);
let scale_art = super::artboards::scale_art(app);
let move_art = super::artboards::move_art(app);
if let Some(ab) = app.session.active().and_then(|d| d.doc.artboards.get(i)).cloned() {
section_header(ui, tl!("Transform"));
let fw = super::field_width(ui);
super::transform::artboard_fields(app, ui, i, ab.rect, fw);
artboard_size_row(app, ui, i, ab.rect.width(), ab.rect.height());
ui.add_space(2.0);
super::artboards::art_options(app, ui);
divider(ui);
section_header(ui, tl!("Artboards"));
// The field shows the artboard's name as it is (names are never translated). Typing a new
// name and pressing Enter or clicking elsewhere renames the artboard as the Artboards panel's
// rename does; pressing Escape or leaving the field empty keeps the old name. A click on
@@ -495,33 +502,7 @@ fn artboard_sections(app: &mut VectorcraftApp, ui: &mut Ui) {
app.run("tool.options", json!({"tool": "artboard"})).ok();
}
});
let fw = super::field_width(ui);
egui::Grid::new("ab-grid").num_columns(4).spacing([4.0, 6.0]).min_col_width(0.0).show(ui, |ui| {
let r = ab.rect;
for (row, [(l1, k1, v1), (l2, k2, v2)]) in
[[("X:", "x", r.x0), ("W:", "width", r.width())], [("Y:", "y", r.y0), ("H:", "height", r.height())]].into_iter().enumerate()
{
for (label, key, v) in [(l1, k1, v1), (l2, k2, v2)] {
dim_label(ui, label);
let offset = match key {
"x" => origin.x,
"y" => origin.y,
_ => 0.0,
};
if let Some(v) = widgets::num_field_named(ui, ("ab", key, row), Some(tl!(label)), Some(v - offset), units, fw) {
// A new X or Y moves the active artboard; a new W or H goes to every selected one.
let indices = if matches!(key, "width" | "height") { super::artboards::resized_with(app, i) } else { vec![i] };
let common = json!({"scaleArt": scale_art, "moveArt": move_art});
super::artboards::set_props(app, &indices, common, |j, _| Some(json!({"index": j, key: v + offset}))).ok();
}
}
ui.end_row();
}
});
artboard_size_row(app, ui, i, ab.rect.width(), ab.rect.height());
artboard_fill_row(app, ui, i, ab.color);
ui.add_space(2.0);
super::artboards::art_options(app, ui);
}
ui.add_space(4.0);
let w = (ui.available_width() - 6.0) / 2.0;
+28 -3
View File
@@ -433,11 +433,11 @@ fn boards(app: &VectorcraftApp) -> Vec<(f64, f64, f64, f64)> {
}
/// #1482: with Artboards 1 and 3 selected, a W typed into Properties or the Transform panel
/// resizes both in one undo step, and Artboard 2 keeps its size. Properties keeps each top-left
/// corner; the Transform panel resizes each about its own center, its default reference point.
/// resizes both in one undo step, and Artboard 2 keeps its size. Both resize each about its own
/// center, their shared default reference point (#5219).
#[test]
fn artboard_width_resizes_every_selected_artboard_in_properties_and_transform() {
for (draw, centered) in [(show as fn(&mut VectorcraftApp, &mut Ui), false), (super::super::transform::show, true)] {
for (draw, centered) in [(show as fn(&mut VectorcraftApp, &mut Ui), true), (super::super::transform::show, true)] {
let mut app = two_selected_artboards();
let before = boards(&app);
let undo = app.session.doc().unwrap().history.undo.len();
@@ -499,6 +499,31 @@ fn properties_variable_font_button_for_variable_type() {
assert!(frame(&mut app, &ctx, vec![]).iter().any(|(t, _)| t == "Variable Font"));
}
/// #5219: Edit Artboards starts with a Transform section (the reference point, X, Y, W and H, the
/// preset and orientation) above the Artboards section (the name, Artboard Options and Fill), as in
/// the reference app; X and Y are the reference point's, which the Transform panel shares.
#[test]
fn edit_artboards_shows_transform_above_the_artboard_options() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.run("file.new", json!({"width": 200, "height": 100})).unwrap();
app.select_tool("artboard");
let ctx = egui::Context::default();
frame(&mut app, &ctx, vec![]);
let texts = frame(&mut app, &ctx, vec![]);
let y = |label: &str| texts.iter().find(|(t, _)| t == label).map(|(_, r)| r.center().y).unwrap_or_else(|| panic!("{label} in {texts:?}"));
let (transform, artboards) = (y("Transform"), y("Artboards"));
assert!(transform < artboards, "{texts:?}");
for label in ["X:", "Y:", "W:", "H:"] {
assert!((transform..artboards).contains(&y(label)), "{label} is in the Transform section: {texts:?}");
}
for label in ["Artboard 1", "Fill:"] {
assert!(y(label) > artboards, "{label} is in the Artboards section: {texts:?}");
}
// X and Y read the shared reference point, the center by default, as the Transform panel does.
// (100 pt is X and H, 50 pt is Y.)
assert!(texts.iter().filter(|(t, _)| t == "100 pt").count() == 2 && texts.iter().any(|(t, _)| t == "50 pt"), "{texts:?}");
}
#[test]
fn edit_artboards_adds_artboards_and_exits() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
+9 -7
View File
@@ -178,8 +178,10 @@ pub fn set_artboard(app: &mut VectorcraftApp, index: usize, refi: usize, xywh: [
}
}
/// The Artboard tool's view of the panel: the active artboard's position and size ([`set_artboard`]).
fn artboard_fields(app: &mut VectorcraftApp, ui: &mut Ui, index: usize, r: Rect) {
/// The Artboard tool's view of the panel, and the Properties panel's Transform section in Edit
/// Artboards: the reference point, artboard `index`'s position and size at `r` in fields
/// `fw` wide ([`set_artboard`]), and the Constrain Width and Height Proportions link.
pub(crate) fn artboard_fields(app: &mut VectorcraftApp, ui: &mut Ui, index: usize, r: Rect, fw: f32) {
let units = app.session.general_unit();
let origin = app.ruler_origin();
let refi = reference_index(ui);
@@ -191,20 +193,20 @@ fn artboard_fields(app: &mut VectorcraftApp, ui: &mut Ui, index: usize, r: Rect)
ui.add_space(4.0);
egui::Grid::new("xfp-ab-grid").num_columns(4).spacing([4.0, 6.0]).min_col_width(0.0).show(ui, |ui| {
widgets::dim_label(ui, "X:");
if let Some(v) = widgets::num_field_named(ui, "xfp-ab-x", Some(crate::i18n::t("X:")), Some(rp.x - origin.x), units, 80.0) {
if let Some(v) = widgets::num_field_named(ui, "xfp-ab-x", Some(crate::i18n::t("X:")), Some(rp.x - origin.x), units, fw) {
set(app, Some(v + origin.x), None, None, None);
}
widgets::dim_label(ui, "W:");
if let Some(v) = widgets::size_field_named(ui, "xfp-ab-w", Some(tl!("W:")), Some(r.width()), units, 80.0) {
if let Some(v) = widgets::size_field_named(ui, "xfp-ab-w", Some(tl!("W:")), Some(r.width()), units, fw) {
set(app, None, None, Some(v), None);
}
ui.end_row();
widgets::dim_label(ui, "Y:");
if let Some(v) = widgets::num_field_named(ui, "xfp-ab-y", Some(crate::i18n::t("Y:")), Some(rp.y - origin.y), units, 80.0) {
if let Some(v) = widgets::num_field_named(ui, "xfp-ab-y", Some(crate::i18n::t("Y:")), Some(rp.y - origin.y), units, fw) {
set(app, None, Some(v + origin.y), None, None);
}
widgets::dim_label(ui, "H:");
if let Some(v) = widgets::size_field_named(ui, "xfp-ab-h", Some(tl!("H:")), Some(r.height()), units, 80.0) {
if let Some(v) = widgets::size_field_named(ui, "xfp-ab-h", Some(tl!("H:")), Some(r.height()), units, fw) {
set(app, None, None, None, Some(v));
}
ui.end_row();
@@ -254,7 +256,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
return;
}
if let Some((i, r)) = tool_artboard(app) {
artboard_fields(app, ui, i, r);
artboard_fields(app, ui, i, r, 80.0);
return;
}
if let Some(guides) = selected_guides(app) {
+3 -2
View File
@@ -563,18 +563,19 @@ pub(crate) fn craft_font_name(f: &vectorcraft_text::CraftFont) -> String {
format!("craft-fonts {} {}", f.family, f.style)
}
/// The Japanese and Georgian craft-fonts faces (when built with `CRAFT_FONTS_DIR`) as fallbacks at
/// The Japanese, Georgian and Devanagari craft-fonts faces (when built with `CRAFT_FONTS_DIR`) as fallbacks at
/// the end of every family, after the app's own fonts and before the installed fonts `ui_fonts`
/// adds: BIZ UDPGothic first (bold first in the semibold family), then the Mincho faces, then Noto
/// Sans Georgian.
fn add_craft_fonts(fonts: &mut FontDefinitions) {
for f in vectorcraft_text::CRAFT_FONTS.iter().filter(|f| f.is_japanese() || f.is_georgian()) {
for f in vectorcraft_text::CRAFT_FONTS.iter().filter(|f| f.is_japanese() || f.is_georgian() || f.scripts.contains(&"Deva")) {
fonts.font_data.insert(craft_font_name(f), Arc::new(FontData::from_static(f.bytes)));
}
for (family, stack) in fonts.families.iter_mut() {
let bold = *family == FontFamily::Name(FONT_UI_SEMIBOLD.into());
stack.extend(vectorcraft_text::craft_fonts::japanese_ui_fonts(bold).into_iter().map(craft_font_name));
stack.extend(vectorcraft_text::craft_fonts::georgian_ui_fonts().into_iter().map(craft_font_name));
stack.extend(vectorcraft_text::CRAFT_FONTS.iter().filter(|f| f.scripts.contains(&"Deva")).map(craft_font_name));
}
}
+25
View File
@@ -173,6 +173,31 @@ mod tests {
assert!(fonts.pending.is_none() && fonts.added.is_empty());
}
#[test]
fn hindi_ui_loads_a_devanagari_fallback_in_every_family() {
if FontDb::global().face_covering('ह').is_none() {
eprintln!("skipped: install a Devanagari font to check the native Hindi UI fallback");
return;
}
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let mut fonts = UiFonts::default();
// Conjuncts, pre-base matras, reph, nukta and mixed Latin/numeric labels.
let text = "हिन्दी क्षि त्रि क्रि प्रिंट फ़ाइल लेयर RGB 123";
frame(&ctx, &mut fonts, text);
fonts.finish(&ctx);
frame(&ctx, &mut fonts, text);
let families: Vec<_> = ctx.fonts(|f| f.definitions().families.keys().cloned().collect());
for family in families {
let id = FontId::new(13.0, family.clone());
for c in text.chars().filter(|c| !c.is_whitespace()) {
assert!(ctx.fonts_mut(|f| f.has_glyph(&id, c)), "{family:?}: missing {c}");
}
let galley = ctx.fonts_mut(|f| f.layout_no_wrap(text.into(), id, egui::Color32::WHITE));
assert!(galley.rect.width().is_finite() && galley.rect.width() > 0.0);
}
}
#[test]
fn japanese_renders_with_the_craft_fonts_without_installed_fonts() {
if !vectorcraft_text::CRAFT_FONTS.iter().any(|f| f.is_japanese()) {
+7
View File
@@ -1,5 +1,6 @@
# Development
> **Last updated:** 2026-11-06 · **Change:** Hindi catalog and zero/one plural rule; desktop Devanagari fallback and optional craft-fonts UI face; native review pending.
> **Last updated:** 2026-11-01 · **Change:** Linux: Automatic Linux Display Server opens the window through XWayland when a pen is attached on a Wayland session, so the pen draws (#4967); `VECTORCRAFT_NATIVE_WAYLAND=1` keeps Wayland.
> **Last updated:** 2026-10-31 · **Change:** files opened while the app runs open in its window on Windows and Linux (#4892); `--new-instance`.
> **Last updated:** 2026-10-29 · **Change:** Linux clipboard: the Flatpak on GNOME copies and pastes text through the core Wayland protocol.
@@ -232,6 +233,11 @@ another craft-fonts face on the web, add a line to `web-fonts.txt`.
## Localisation
Hindi (`hi`, हिन्दी): complete machine-assisted catalog; every `hi-*` locale resolves here, with
0 and 1 singular and 2+ plural. Desktop text uses an installed Devanagari font or an embedded
craft-fonts face tagged `Deva`. The web needs that font supplied separately. Native wording
review is pending; see [Hindi terminology and checks](localization-hi.md).
Strings in code stay English and are the default lookup keys. `crates/ui-egui/src/i18n` maps them to display
text at render time from one catalog per language (`i18n/<code>.tsv`; the format is documented in the header of
`zh-hant.tsv`). Command ids, menu paths used for logic, `ui.menu.list`, the control channel, the CLI and MCP
@@ -500,6 +506,7 @@ Scores and hour estimates are unchanged.
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | minor | Localisation: Hindi catalog, zero/one plurals, desktop and web font requirements; AI/MT draft, native review pending. |
| 2026-10-31 | minor | Files opened while the app runs open in its window on Windows and Linux (#4892); `--new-instance` opts out. |
| 2026-10-29 | minor | Linux clipboard: core Wayland protocol text fallback where arboard has neither data-control nor X11 (the Flatpak on GNOME).; its reads wait 2 s at most. |
| 2026-10-29 | minor | Linux clipboard: a clipboard arboard can't open is retried after 1 s doubling to 60 s and logged once, instead of every 250 ms. |
+19 -29
View File
@@ -104,39 +104,30 @@ private editing data. VectorCraft:
opens a file with that prolog from its program, as the format.
- **Known failures in users' files:** layer structure flattened or multiplied (#951: 109 layers instead of
14; #868: round trip with Illustrator 2018 loses layers and groups), some files 4× slower to open since the
editing data is read whole (#758), live effects and brushes come in as their drawn look (#637;
pattern fills are read since #1025, and symbols and their instances open live); legacy `.ai` without the
prolog opens since #1027, its legacy type (`To` … `TO`) since #868; guides open as ruler guides and guide paths since #5057 (#779).
14; #868: round trip with Illustrator 2018 loses layers and groups), guides and non-printing construction
lines lost (#779), some files 4× slower to open since the editing data is read whole (#758), unmapped live
effects and brushes come in as their drawn look (#637; pattern fills are read since #1025); legacy `.ai`
without the prolog opens since #1027, its legacy type (`To` … `TO`) since #868.
lines lost (#779), some files 4× slower to open since the editing data is read whole (#758), live effects
that are not read or have settings that are not read, and brushes come in as their drawn look (#637; pattern fills are read since #1025); legacy `.ai`
without the prolog opens since #1027, its legacy type (`To` … `TO`) since #868.
lines lost (#779), some files 4× slower to open since the editing data is read whole (#758), live effects
and brushes come in as their drawn look (#637; pattern fills are read since #1025); legacy `.ai`
without the prolog opens since #1027, its legacy type (`To` … `TO`) since #868, and its placed EPS files
in the version 7 form (`` ` `` … `~` with no `%AI5_BeginPlace`) are read like other placed files without a
preview: as the page's art in their box.
without the prolog opens since #1027, its legacy type (`To` … `TO`) since #868. Graphs (`%_Gs` … `%_GS`)
come in as their drawn art, as plain groups, paths and type, without their data or settings, with a note.
without the prolog opens since #1027, its legacy type (`To` … `TO`) since #868, with its paragraphs' letter
and word spacing (`TC`, `TW`), hanging punctuation (`Tq`) and hyphenation (`Th`). Its type in a font
re-encoded with encoding pairs of its own (`TZ`) is decoded with those pairs, and with the file's encoding
(`TE`) for the codes they leave out unless the `TZ` sets `useDefault` to 0. Its patterns in
and word spacing (`TC`, `TW`), hanging punctuation (`Tq`) and hyphenation (`Th`); its tab definitions
(`Xb` … `XB`) set its paragraphs' tab stops; its special characters (`TS`) join the story, and end render
(`Te`) and pop text matrix (`TM`) are read and ignored. Its patterns in
the version 7 form (a list of `@` and `&` layers, `_ &` for the tile's background) open as pattern swatches,
with a fill's offset, scale, rotation, reflection and shear applied before its matrix.
editing data is read whole (#758), live effects that are not read or have settings that are not read, and
brushes come in as their drawn look (#637; pattern fills are read since #1025, and symbols and their instances
open live); legacy `.ai` without the prolog opens since #1027, its legacy type (`To` … `TO`) since #868; guides
open as ruler guides and guide paths since #5057 (#779).
Legacy `.ai` type keeps its paragraphs' letter and word spacing (`TC`, `TW`), hanging punctuation (`Tq`) and
hyphenation (`Th`); its tab definitions (`Xb` … `XB`) set its paragraphs' tab stops. Paragraphs in a row with
the same attributes share one copy of them while the text object is read, and those copies hold at most
1,048,576 stops. The paragraphs and linked frames of one text object then get at most 1,048,576 more copied
stops. Paragraphs and frames past either limit take the default stops, with a warning. Its special characters
(`TS`) join the story, and end render (`Te`) and pop text matrix (`TM`) are read and ignored. Its type in a
font re-encoded with encoding pairs of its own (`TZ`) is decoded with those pairs, and with the file's encoding
(`TE`) for the codes they leave out unless the `TZ` sets `useDefault` to 0.
Its area type with several linked areas opens as threaded frames, one for each area with its own matrix,
and the story flows through them.
Legacy `.ai` type set in rendering modes 4 to 7 (`Tr`, text used as a mask) is a clipping path of its
clipping group, as a `W` path is, and the mode lasts into later text objects. Type in linked areas, in
wraparound text or in a compound path doesn't clip, with a warning. A `Tr` operand that is not a whole number
from 0 to 9 leaves the mode as it was.
with a fill's offset, scale, rotation, reflection and shear applied before its matrix. Its linked images in
Legacy `.ai` placed EPS files in the version 7 form (`` ` `` … `~` with no `%AI5_BeginPlace`) are read like
other placed files without a preview: as the page's art in their box. Graphs (`%_Gs` … `%_GS`) come in as their
drawn art, as plain groups, paths and type, without their data or settings, with a note.
Legacy `.ai` patterns in the version 7 form (a list of `@` and `&` layers, `_ &` for the tile's background)
open as pattern swatches, with a fill's offset, scale, rotation, reflection and shear applied before its
matrix. Legacy `.ai` linked images in
the version 7 form (`(path) modified XG`, then `XF` with no samples) come in as linked images of their files,
showing a placeholder where the image goes until the file is relinked in the Links panel. A path stored in
the classic Mac OS form (`Disk:Folder:file.tif`, with a colon and no `/` or `\`) is named by its last part, and
@@ -150,8 +141,7 @@ private editing data. VectorCraft:
### Illustrator's private editing data
the app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke or Convert to Shape comes in as itself with them and their saved settings; one with more, other effects, an effect setting that is not read (an unknown key, a missing or out-of-range value, a Scribble with a color of its own), dashes aligned to corners, a brush other than a Calligraphic one, or a Calligraphic brush with settings of its own or an angle that follows the path comes in as its drawn look (a group named after it). A path with a Calligraphic brush otherwise comes in as the path, the brush on its stroke at the stroke's weight, which scales the brush (#372). A Calligraphic brush's Pressure, Tilt, Bearing and Rotation come in as those channels (a 6D Art Pen's brushes vary with the pressure, the bearing and the barrel's rotation); its Stylus Wheel varies at random. The file's Calligraphic, Scatter, Art and Bristle brushes replace the default ones in the Brushes panel, in the file's order, also when the file comes in as its PDF part (a brush library has no layers); pattern brushes and brushes it can't read are left out with a note. Type keeps its art style as a live appearance whatever its stack, so it can be retyped: each fill and stroke of the style's stack (solid colours, gradients and pattern fills, placed as the drawn look places them) with its own opacity, blend mode and effects, the effects on the whole object, and where the characters paint among them; the effects read are Warp, Offset Path, Outline Object, Outline Stroke, Transform (with copies, Line truncated
the app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing) or Pucker & Bloat at 0 comes in as itself with them and their saved settings. A path, compound path or group (not a clipping group) whose only effect is Transform (not with copies or Random) or a Free Distort whose corners make a parallelogram comes in as itself with it too, when neither it nor anything in it paints with a gradient or pattern and everything in it is a path, compound path or group with no opacity mask and no effects of its own; Transform that scales, rotates or reflects needs nothing in it to be stroked. Twist as the only effect is read the same way on an unstroked path or compound path whose segments are all straight. One with more, other effects (Zig Zag, a Pucker & Bloat of another amount, a Free Distort with other corners), an effect setting that is not read (an unknown key, a missing or out-of-range value, a Scribble with a color of its own), dashes aligned to corners, a brush other than a Calligraphic one, or a Calligraphic brush with settings of its own or an angle that follows the path comes in as its drawn look (a group named after it). A path with a Calligraphic brush otherwise comes in as the path, the brush on its stroke at the stroke's weight, which scales the brush (#372). A Calligraphic brush's Pressure, Tilt, Bearing and Rotation come in as those channels (a 6D Art Pen's brushes vary with the pressure, the bearing and the barrel's rotation); its Stylus Wheel varies at random.Line truncated
the app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing) or Pucker & Bloat at 0 comes in as itself with them and their saved settings. A path, compound path or group (not a clipping group) whose only effect is Transform (not with copies or Random) or a Free Distort whose corners make a parallelogram comes in as itself with it too, when neither it nor anything in it paints with a gradient or pattern and everything in it is a path, compound path or group with no opacity mask and no effects of its own; Transform that scales, rotates or reflects needs nothing in it to be stroked. Twist as the only effect is read the same way on an unstroked path or compound path whose segments are all straight. One with more, other effects (Zig Zag, a Pucker & Bloat of another amount, a Free Distort with other corners), an effect setting that is not read (an unknown key, a missing or out-of-range value, a Scribble with a color of its own), dashes aligned to corners, a brush other than a Calligraphic one, or a Calligraphic brush with settings of its own or an angle that follows the path comes in as its drawn look (a group named after it). A path with a Calligraphic brush otherwise comes in as the path, the brush on its stroke at the stroke's weight, which scales the brush (#372). A Calligraphic brush's Pressure, Tilt, Bearing and Rotation come in as those channels (a 6D Art Pen's brushes vary with the pressure, the bearing and the barrel's rotation); its Stylus Wheel varies at random.Line truncated
## Format by format
+40 -4
View File
@@ -1,6 +1,6 @@
# Gaps
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-05 · **Change:** minor (an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
## Feature submission evidence
@@ -36,6 +36,11 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
| Date | Change | Summary |
|---|---|---|
| 2026-11-05 | minor | G15: long open strokes with an undashed width profile are outlined near the view while keeping profile positions on the full path; a 200,000-segment outline took 59.95 ms before and 8.44 ms after in local median runs. Closed and dashed profile strokes remain whole; estimate unchanged. |
| 2026-11-05 | minor | G15: Direct Selection reuses one document hit result when choosing the cursor over a path; a 200,000-anchor path's segment cursor took 58.15 ms before and 29.33 ms after in local median runs. Cursor behavior is unchanged; estimate unchanged. |
| 2026-11-05 | minor | G15: Selection skips building corner and pie widgets when the pointer is well outside a large selection; empty-canvas hover with 20,000 selected paths took 28.72 ms before and 16.41 ms after in local median runs. Other cursor targets remain active; estimate unchanged. |
| 2026-11-05 | minor | G15: Direct Selection reuses one document hit result when choosing the cursor over a path; after the path hit-test improvement, a 200,000-anchor path's segment cursor took 3.72 ms before and 2.66 ms after in local median runs. Cursor behavior is unchanged; estimate unchanged. |
| 2026-11-05 | minor | G15: large-selection transforms reuse object locations found during command validation; a 20,000-object nudge took 58.07 ms before and 51.26 ms after in paired median runs. Estimate unchanged. |
| 2026-11-05 | minor | G9, G14: `.ai` paths with a Calligraphic brush open brushed (the brush on the stroke, at its weight) where the object's settings are the brush's own, and the brush's Tilt, Bearing and Rotation codes come in as those channels; Windows reads the pen's tilt and barrel rotation from Windows Ink (#372). Checked against a user's file of 6D Art Pen strokes, used locally; not tried with a pen. Scores and estimates unchanged. |
| 2026-11-04 | minor | Contour add-on (beyond Illustrator): drag away from a selected shape's edge to grow a live copy of it, or toward the inside to shrink it; the copy carries a live Offset Path effect, so it stays editable until Bake (Expand Appearance), a second drag changes the same Contour instead of nesting one, and a floating bar sets the distance and the Sharp, Round or Square corners. `addon.contour.set` is the command behind it. It is a built-in add-on: Object › Plug-ins › Contour, and its own heading in All Tools, with no default shortcut or toolbar slot. A VectorCraft design built on Offset Path; no other application was inspected. Scores and estimates unchanged. |
| 2026-11-04 | minor | Contour tool (beyond Illustrator): drag away from a selected shape's edge to grow a live copy of it, or toward the inside to shrink it; the copy carries a live Offset Path effect, so it stays editable until Bake (Expand Appearance), a second drag changes the same Contour instead of nesting one, and a floating bar sets the distance and the Sharp, Round or Square corners. `object.contour` is the command behind it. A VectorCraft design built on Offset Path; no other application was inspected. Scores and estimates unchanged. |
@@ -650,6 +655,32 @@ from G14 and the budget run of G15: **~170–270 h** one agent, ~50–80 h wall
## G15 Performance budgets and a GPU renderer
- **Improved (2026-11-05):** after an edit, a long open stroke with an undashed width profile
outlines the part near the view and keeps each point's original position along the profile.
A 200,000-segment outline took 59.95 ms whole and 8.44 ms cropped in local median runs; this
measures outline construction, not a complete frame. Closed and dashed profile strokes still
use their full outline. Pixel comparisons cover curved and straight open paths, their ends,
asymmetric profiles, two subpaths, and the closed-path fallback. The idle budget remains open.
- **Improved (2026-11-05):** when more than 128 objects are selected, Selection skips making
corner and pie widgets if the pointer is farther than their reach from the selected art.
Empty-canvas hover with 20,000 selected paths took 28.72 ms before and 16.41 ms after in
local median runs. Pie widgets just beyond the art and rotated bounding-box handles still
take the cursor. This is a directional measurement, not an idle performance-budget result.
- **Improved (2026-11-05):** Direct Selection reuses its document hit result when choosing the
cursor over a path. With the path hit-test improvement below, the cursor over a segment of a
200,000-anchor path took 3.72 ms before and 2.66 ms after in local median runs; a nearby point
took 4.04 ms before and 2.98 ms after.
Anchor, segment and plain cursor choices remain the same. The idle-frame budget remains open.
- **Improved (2026-11-05):** hovering over a nearby plain stroke or path outline checks the
candidate segments directly. On a 200,000-anchor open path, a hit near its middle took about
11–13 ms before and 1.0–1.4 ms after in paired runs on a busy Windows machine. A miss between
two long strokes, inside their box, took 18.7 ms before and 1.6 ms after; a distant miss stayed
about 0.7 ms. Other stroke styles and fill hits retain the full-path check; the idle
performance-budget run is still open.
- **Improved (2026-11-05):** moving a large selection reuses the object locations found while
validating the transform command. A 20,000-object nudge took 58.07 ms before and 51.26 ms after
in paired median runs on a busy Windows machine; copies and active typing still look up their
current objects. Selection, object positions and undo behavior remain the same.
- **Improved (#4155):** an image zoomed in on has its colours separated, colorized or proofed only for the
1,024-pixel tiles in view: zooming in to 100% on the file of #4155 went from 8.6 s to 0.05 s (measured in the app,
M3 Pro, one run). A CMYK image painting its own inks is still made whole.
@@ -682,11 +713,14 @@ from G14 and the budget run of G15: **~170–270 h** one agent, ~50–80 h wall
## G16 Localization: the three missing key languages
- **Evidence (2026-11-06):** Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged. See [Hindi notes](localization-hi.md).
- **Evidence:** Brazilian Portuguese catalog complete under the tests (menus, literals, messages; one|other plurals; #1914). Vietnamese catalog complete under the tests (menus, literals, messages; one plural form). Czech render-site bypasses reduced in file dialogs, diagnostics, preset names and contributor tooltips; gradient grammar and printer-mark context corrected (see [localization-parity.md](localization-parity.md)). Native review and the remaining missing-language work remain.
- **Missing:** Hindi, Arabic, Indonesian catalogs; a Korean UI font for the web build; a right-to-left interface and interface
shaping for Arabic and Devanagari; messages for Simplified Chinese; native review of
every catalog. Measured in [localization-parity.md](localization-parity.md).
- **Missing:** Arabic catalog and right-to-left layout; current gaps in other catalogs and native
review; Hindi wording/layout review and a web Devanagari font; a Korean UI font for the web.
Hindi now has a catalog and the pinned egui fork shapes Devanagari. Indonesian already has a
catalog (see [localization-parity.md](localization-parity.md)); it is not an absent language.
- **Estimate:** 50–85 h plus human review (Brazilian Portuguese completed 2026-10-14).
## G17 Ecosystem: third-party plug-ins
@@ -770,6 +804,8 @@ trap, and the defaults (0.25 pt, 100%, 40%) are VectorCraft's own, the pages giv
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | minor | Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged |
| 2026-11-05 | minor | G15: nearby hits on plain long strokes and outlines check their candidate segments directly; a 200,000-anchor middle hit took about 11–13 ms before and 1.0–1.4 ms after in paired runs. An inside-bounds miss fell from 18.7 ms to 1.6 ms. Estimate unchanged; idle budget run still open. |
| 2026-11-05 | minor | G15: an image zoomed in on is separated, colorized or proofed only for the tiles in view (#4155); 100% zoom on that file 8.6 s → 0.05 s. Estimate unchanged. |
| 2026-11-05 | minor | G15: a document's first frame renders on the render worker (#4155); the longest UI-thread stall opening that file went from 8.7 s to 64 ms. Estimate unchanged. |
| 2026-11-05 | minor | G15: a reduced image is shrunk before it is separated into ink planes (#4155); first frame 9.2 s → 1.6 s, sharp frame after a pan 3.9 s → 8 ms on that file. Estimate unchanged. |
+93
View File
@@ -0,0 +1,93 @@
# Hindi interface terminology and verification
The `hi` catalog is a machine-assisted Hindi draft written from VectorCraft's English strings.
It starts from matching entries in PhotoCraft's clean-room Hindi catalog. VectorCraft's current
loanword preferences below take precedence over that starting vocabulary.
The remaining drafts used the local Argos English–Hindi 1.1 model, followed by an agent wording
pass on commands, vector vocabulary, counted messages, warnings and diagnostic identifiers.
The contributor is a native Hindi speaker and approved the loanword preferences below. This
records terminology feedback, not an independent native proofread of every row. No proprietary
localization resources were used; coverage tests alone do not establish translation quality.
## Style
Prefer familiar design-app loanwords, as requested by the contributor: Save is सेव, Save As is
सेव ऐज़…, a vector path is पाथ (never पाठ), text is टेक्स्ट, a document is डॉक्यूमेंट,
preview is प्रीव्यू and workspace is वर्कस्पेस. The contributor also approved सिलेक्शन,
प्रॉपर्टीज़, ऑप्शन्स and ओपन. Keep Hindi sentence structure and auxiliaries;
use सेव करें within a sentence. Keep nukta in फ़ाइल/फ़ॉन्ट/ज़ूम and -एँ in हटाएँ/दिखाएँ.
Retain ASCII digits, unit symbols, keyboard shortcuts and product/format names. Command IDs,
parameter names, enum values and numbers in diagnostics must stay exactly as supplied.
Keep fragment edge spaces: the hint bar assembles sentences from separately translated pieces.
The built-in workspace and perspective preset names stay in English, as in the other catalogs.
Hindi integer counts use the first plural form for 0 and 1 and the second for 2+ (`plural_french`).
Both `@plural` and `@msgplural` rows have two forms. The latter translate status messages when
displayed; the engine, control channel and MCP continue to return English messages.
## Terminology
| English | Hindi |
|---|---|
| Layer / Layers | लेयर / लेयर्स |
| Object | ऑब्जेक्ट |
| Selection / Select | सिलेक्शन / सिलेक्ट |
| Properties / Options / Open | प्रॉपर्टीज़ / ऑप्शन्स / ओपन |
| Shape (vector) | शेप |
| Shape (generic form) | आकार |
| Artboard | आर्टबोर्ड |
| Artwork | आर्टवर्क |
| Path / Anchor point / Handle | पाथ / एंकर पॉइंट / हैंडल |
| File path on disk | फ़ाइल पाथ |
| Fill / Stroke | फ़िल / स्ट्रोक |
| Gradient / Mesh / Blend | ग्रेडिएंट / मेश / ब्लेंड |
| Pattern / Swatch | पैटर्न / स्वॉच |
| Appearance / Graphic style | अपीयरेंस / ग्राफ़िक स्टाइल |
| Symbol / Envelope | सिंबल / एन्वेलप |
| Clipping mask / Opacity mask | क्लिपिंग मास्क / ओपेसिटी मास्क |
| Image Trace / Live Paint | इमेज ट्रेस / लाइव पेंट |
| Shape Builder / Pathfinder | शेप बिल्डर / पाथफ़ाइंडर |
| Kerning / Leading / Tracking | कर्निंग / लीडिंग / ट्रैकिंग |
| Character / Paragraph | कैरेक्टर / पैराग्राफ़ |
| Save / Save As | सेव / सेव ऐज़… |
| Document / Text | डॉक्यूमेंट / टेक्स्ट |
| Preferences / Workspace | प्रेफ़रेंसेज़ / वर्कस्पेस |
| Preview / Opacity | प्रीव्यू / ओपेसिटी |
| W / H / X / Y | W / H / X / Y |
## Scope and checks (2026-11-06)
The draft has 7,877 unique rows, including 2,537 `@msg`, 45 `@msgplural` and 38 `@plural` rows.
Its source set combines the sibling catalogs with the current test scanner's UI/undo and error
message dumps, so it includes runtime labels outside the literal scanner. Row count is not a
percentage of the application's entire interface.
The comparison covers release `v0.21.1` (`f6aa4309`) and current `main` (`3c7d9e1f`). Their
non-English catalogs have no missing Hindi keys except the names deliberately kept in English.
A separate scan of the release's `tl!` literals checks strings beyond its catalogs. Current
main added paragraph labels, spine-index validation and two error messages: six rows in total.
Main's workspace version is still 0.21.0; this PR does not change release versioning.
`cargo test -p vectorcraft-ui-egui --lib i18n::tests` passes all 55 tests in Ubuntu 24.04 (WSL).
The untranslated report has no Hindi section, meaning it found no missing Hindi rows among the
categories it checks. This does not check dynamically assembled strings that the scanners miss.
Additional checks compare placeholders, backtick-delimited identifiers and numeric values.
The native Hindi UI fallback test also passes with the installed Nirmala UI font. A running
desktop preview was checked in Hindi, including the New Document dialog and File menu.
The final `cargo xtask ci` passed all 12 stages in Ubuntu 24.04 (WSL): formatting, workspace
clippy, workspace tests, doctests, no-bundled-fonts, PDF dependencies, assets, brands, cursors,
the translation report, layers and WebAssembly. The language picker keeps each language's own
name, including English; its native-menu regression passed with the final catalog.
## Fonts and remaining review
The pinned egui fork shapes Devanagari with HarfRust. The desktop's existing `UiFonts` loader
finds an installed covering face, such as Nirmala UI, Kohinoor Devanagari or Noto Sans Devanagari.
If a `CRAFT_FONTS_DIR` build includes a face tagged `Deva`, it is also installed at the end of
each UI font family. No font binaries are added to this repository. Without either an embedded
or installed covering face, Hindi cannot display correctly. The web has no system fonts and
needs a Devanagari face supplied through craft-fonts; this catalog alone does not supply one.
Before release: native-speaker review of the draft (especially less common labels and error
messages), visual checks for clipped labels and matras at different UI scales, and a web-font
build. Reviewers should use this glossary to make terminology corrections consistently.
+9 -7
View File
@@ -1,6 +1,6 @@
# Localization parity
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** minor (Brazilian Portuguese: 154 rows for the strings the sibling catalogs translate — smart-filter and print presets, dimension lines, swatches, canvas messages; previously minor: Bosnian (`bs`): complete catalog; previously minor: Vietnamese text: stacked diacritics tested and attach in every form, #4491; previously: Catalan (`ca`) catalog added, complete under the tests)
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Brazilian Portuguese: 154 rows for the strings the sibling catalogs translate — smart-filter and print presets, dimension lines, swatches, canvas messages; previously minor: Bosnian (`bs`): complete catalog; previously minor: Vietnamese text: stacked diacritics tested and attach in every form, #4491; previously: Catalan (`ca`) catalog added, complete under the tests)
Per-language status of VectorCraft's interface. How the catalogs work and how to add a language:
[`development.md` › Localisation](development.md#localisation). Part of
@@ -29,7 +29,7 @@ Chinese by `imachus`). Only Georgian is recorded as reviewed by a native speaker
| English | `en` | source, 100% | all | Latin | — | full | — |
| Simplified Chinese (Mandarin) | `zh-hans` | 5,102 rows, 791 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | all | CJK UI font from craft-fonts (BIZ UDPGothic) when embedded, else a system font; IME with marked text at the caret; vertical type partial ([type-parity.md](type-parity.md)) | no | full | — (review) |
| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (604 messages) | Latin | no | full | — (review) |
| Hindi | `hi` | 0 | none | Devanagari: the document's text shapes (HarfRust), with tests of conjuncts, reph, pre-base matras, nukta forms and caret stops that run when an OpenType Devanagari font is installed, but the egui interface does no complex shaping | no | none | 20–30 |
| Hindi | `hi` | 7,877 rows (2026-11-06): 2,537 `@msg`, 45 `@msgplural`, 38 `@plural`; no gaps in the untranslated report | menus, dialogs, tooltips and scanned messages; contributor-approved loanword terminology; agent wording pass | UI and document text shape with HarfRust; installed desktop Devanagari fallback, or a `Deva` craft-fonts face; web font still needed | contributor terminology review; wider proofread welcome | complete catalog, machine-assisted draft | native review, layout and web font |
| Arabic | `ar` | 0 | none | document text: bidi layout and Paragraph Direction; interface: no right-to-left layout, no Arabic shaping in egui | no | none | 25–40 |
| French | `fr` | 4,020 / 4,020 (100%) | all | Latin | no | full | — (review) |
| Portuguese | `pt-br` | 6,106 catalog entries (counted 2026-10-31 on `main` at `d26dd933a`): menus, `tl!` literals and messages complete when counted; one/other plurals | all | Latin | contributor is a Brazilian Portuguese speaker; further native review welcome | full | — (review) |
@@ -39,9 +39,10 @@ Chinese by `imachus`). Only Georgian is recorded as reviewed by a native speaker
| Korean | `ko` | 4,870 rows (counted 2026-10-21): menus, `tl!` literals and messages complete when counted; one plural form | all | Hangul from an installed system font on the desktop (Apple SD Gothic Neo, Malgun Gothic, Noto Sans CJK KR…); the web build has no Korean UI font yet (craft-fonts); IME path exists | no (AI-drafted) | full | — (review; web font) |
| Vietnamese | `vi` | 4,886 rows (counted 2026-10-21): menus, `tl!` literals and messages complete when counted; one plural form; 4,046 plain + 18 `@plural` + 28 contextual + 794 `@msg` | all | Latin with Vietnamese diacritics (stacked marks attach in precomposed, decomposed and keyboard forms, #4491; glyph tests pass) | contributor is a Vietnamese speaker; AI-assisted draft, further native review welcome | full | — (review) |
**12-language score: ~82%** (equal weights: 100 + 85 + 100 + 0 + 0 + 100 + 100 + 100 + 100 + 98 + 100 + 100, over 12).
**To `full` for all twelve: ~50–85 h**, most of it Arabic (right-to-left interface) and Hindi (interface
shaping). Each new Latin-script catalog is ~4,000 rows; the existing ones were written in a few agent hours each
**Historical 12-language score: ~82%** (equal weights: 100 + 85 + 100 + 0 + 0 + 100 + 100 + 100 + 100 + 98 + 100 + 100, over 12).
**To `full` for all twelve: ~50–85 h** (historical estimate, not re-scored here). Hindi now has
a complete catalog and UI shaping; its remaining work is native review, layout checking and the
web font. Arabic still needs its catalog and right-to-left interface. Each new Latin-script catalog is ~4,000 rows; the existing ones were written in a few agent hours each
plus review. Native-speaker review is human work and isn't in the hours.
## Other shipped languages
@@ -67,7 +68,7 @@ plus review. Native-speaker review is human work and isn't in the hours.
| Indonesian | `id` | 5,531 rows, 788 of them `@msg` (counted 2026-10-28): menus and `tl!` literals complete when counted; its messages are partial; one plural form | full |
| Catalan | `ca` | 5,626 rows, 881 of them `@msg` (counted 2026-10-28): menus, `tl!` literals and messages complete when counted; one/other plurals; every `ca-*` locale resolves here | full; AI-drafted, native review welcome |
Twenty-five non-English catalogs in all. Illustrator, as its public documentation lists, ships around two dozen
Twenty-seven non-English catalogs in all (registry count, 2026-11-06). Illustrator, as its public documentation lists, ships around two dozen
interface languages (including Polish, Dutch, Turkish, the Nordic languages, Hungarian, and Middle East
editions with Arabic and Hebrew); it doesn't ship Hindi, Indonesian or Vietnamese.
@@ -96,6 +97,7 @@ font for the web build.
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | minor | Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged |
| 2026-10-30 | minor | Bosnian (`bs`, Latin, Ijekavian): complete catalog of 5,841 rows, every `bs-*` locale, one/few/other plurals; AI-assisted, not yet native-reviewed |
| 2026-10-29 | minor | Vietnamese text: letters with two marks (Ể, Ứ, Ự) attach in precomposed, decomposed and keyboard forms, and a font lacking the marks falls back for the whole letter (#4491); scores unchanged |
| 2026-10-28 | minor | Catalan (`ca`): complete catalog under the tests (menus, literals, messages; one/other plurals); every `ca-*` locale resolves here; AI-drafted, native review welcome. Added the Turkish and Indonesian rows the table was missing. Scores and estimates unchanged |
@@ -105,7 +107,7 @@ font for the web build.
| 2026-10-15 | minor | Swedish (`sv`) catalog added, complete under the tests (menus, literals, messages; one/other plurals); every `sv-*` locale resolves to it; AI-drafted, native review welcome; scores and estimates unchanged |
| 2026-10-14 | minor | Brazilian Portuguese (`pt-br`, #1914): catalog completed under the tests (menus, literals, messages); 12-language score 71% → 74%, hours 55–90 → 50–85 |
| 2026-10-13 | minor | The Polish translator confirmed the Polish rows the maintainers had added after the catalog was written (#1614); Tool flyouts are as wide as their longest translated name and shortcut need, so names no longer run into shortcuts in Spanish and other languages (#1650, fixes #1616); scores and estimates unchanged |
| 2026-10-13 | minor | Polish (`pl`, #1498): the row count is corrected to the 4,510 rows in `pl.tsv` (it said 4,492), 654 of them `@msg` rows; AI-drafted, native review pending; scores and estimates unchanged |
| 2026-10-13 | minor | Polish (`pl`, #1498): the row count is corrected to the 4,510 rows in `pl.tsv` (it said 4,492), 654 of them `@msg` rows; AI-drafted, contributor loanword terminology reviewed; wider proofreading welcome; scores and estimates unchanged |
| 2026-10-13 | minor | French: the 423 strings added since the catalog was last complete are translated, and 188 entries are reworded to the feature names French users know (#1511); Hungarian: one message uses the informal address like the rest of the interface (#1474); the entry counts in the tables are the earlier measurements; native review still pending; scores and estimates unchanged |
| 2026-10-12 | minor | Vietnamese (`vi`) catalog added, complete under the tests (menus, literals, messages; one plural form); 12-language score 63% → 71%, hours 60–100 → 55–90 |
| 2026-10-13 | minor | Czech: 128 more strings translated (tool names, PDF and Image Trace presets, pie graph options and others added since the catalog was completed; #1461); the entry count in the table is the 2026-10-11 measurement; native review still pending; scores and estimates unchanged |
+11
View File
@@ -1349,6 +1349,7 @@ then composite against the art below it). SVG has no non-isolated groups, so the
(default: the mask being edited, else the first selected masked object) as greyscale coverage (white = opaque) and the
mask is edited; called again it shows the artwork, still editing. It is view state of the open document: the canvas
(and `ui.screenshot`) shows it, exports never do, and it ends when mask editing ends.
The command rejects an `on` value that is not a boolean. Omitting `on` toggles the current value.
Isolation mode and mask editing exclude each other. In isolation mode `transparency.editOpacityMask` and
`transparency.viewOpacityMask` are off, and `transparency.makeOpacityMask` refuses one target, an object or a layer,
@@ -1359,6 +1360,7 @@ mask first". Pattern editing mode does not count as isolation mode here.
`view.transparencyGrid {on?}` (View → Show Transparency Grid; default: toggle) is view state of each open document,
like the mask view: the grid shows behind the artboards of the documents that turn it on, on the canvas and in
`ui.screenshot`, never in exports. It returns `{on}`, isn't undoable and doesn't mark the document changed.
The command rejects an `on` value that is not a boolean. Omitting `on` toggles the current value.
`view.globalRulers {global?}` (View → Rulers → Change to Global / Artboard Rulers, Cmd+Alt+R; default: toggle) is
saved with the document and undoable. With artboard rulers (a new document's) the rulers count from the active
@@ -1432,6 +1434,8 @@ or unknown id leaves the document unchanged. An empty `ids` array does nothing.
are kept, and selecting an ancestor together with its descendants deletes that subtree once.
Without `ids`, direct-selected anchors or selected ruler guides retain their usual Clear behavior.
Cut still removes the objects it copied, including a whole compound when a member is selected.
With `ids`, `guides: true` also deletes the selected ruler guides. The command rejects a `guides` value that is not a
boolean.
`object.setProps` with `visible: false` or `locked: true` deselects every selected object that is hidden or
locked after the call: the selected objects it hides or locks, selected objects inside them, and selected objects
@@ -1630,6 +1634,7 @@ step. With guides selected, `edit.clear` (Delete) deletes them and `object.nudge
View › Guides › Lock Guides (`view.guides.lock`) deselects them and the paths made into guides, in every open
document, and refuses these commands until unlocked. While it is on, a command that selects art, such as `edit.undo`,
`edit.redo`, `object.exitIsolation`, `object.unlockAll`, `object.showAll` or `edit.paste`, leaves the guides out.
`view.guides.lock` rejects a `locked` value that is not a boolean. Omitting `locked` toggles the current value.
`view.guides.release {index?, ids?}` (View › Guides › Release Guides) turns guides into paths → `{count}`. With
`index` it releases that ruler guide, and with `ids` it releases those guide paths (and the guide paths inside them).
@@ -2056,6 +2061,8 @@ it (Alt-drag). `appearance.duplicateItem {index, to?}` / `{indices}` and `appear
act on several fills/strokes at once, and `appearance.showAllHidden` makes every hidden fill, stroke and effect
visible again. In remote mode, `effect.dialog {effect, index, item}` opens an applied effect's dialog prefilled
(`ui.dialog.confirm` runs `effect.setParams`); see the control protocol for the "already applied" question.
`effect.move` rejects a `copy` value that is not a boolean, and every command that takes `aligned` rejects an `aligned`
value that is not a boolean.
Effect dialogs use the targeted object, group, or layer shown in Appearance. The Transform dialog previews valid
numbers as they are typed, including Copies, distances with units, and rotation. With Preview off, changes apply
@@ -3719,6 +3726,7 @@ style; `add: true` stacks it) set that template instead of editing art. With the
Appearance off (`appearance.setNewArtBasic {on: false}`, the preference `newArtBasic`) new art takes the whole
appearance of the last selected object. `appearance.newArt` reports what the next object gets; `paint.default`
resets it.
`appearance.setNewArtBasic` rejects an `on` value that is not a boolean. Omitting `on` toggles the current preference.
```json
{"name":"run_command","arguments":{"command":"select.none","params":{}}}
@@ -4466,6 +4474,7 @@ deselects the slices in every open document; unlocking or showing them again lea
restore the selection that was cleared. While the slices are locked or hidden, a command that selects slices, such as
`select.object.slices` (which replies `count: 0`), `object.slice.select`, `object.slice.create`, `edit.undo` or
`edit.redo`, leaves them out; a selected object that is an object slice stays selected.
`object.slice.clipToArtboard`, `view.slices.hide`, and `view.slices.lock` reject a flag that is not a boolean. Omitting the flag toggles its current value.
```json
{"name":"run_command","arguments":{"command":"object.slice.make","params":{}}}
@@ -4936,6 +4945,7 @@ outside `tileRange` dimmer). The Print Tiling tool (`printTiling`) shows them to
what is drawn, from the layout `print.preview` and both writers (PDF and PostScript) use, so the canvas and the
printed job agree: `{tileOrigin, pages: [{artboard, number, printed, page, imageable}]}` (`[x0, y0, x1, y1]` in document space; every tile when tiling, else
each page once, not once per ink).
`view.printTiling` rejects an `on` value that is not a boolean. Omitting `on` toggles the current value.
Dragging with the tool puts the top-left corner of the first page's imageable area where the pointer is (snapping to
the artboard's edges): `print.tiling.set {origin: [x, y], artboard?}` saves it with the print settings as
@@ -5830,6 +5840,7 @@ that no built-in format has. A failing plug-in returns an error and leaves the d
no file). A filter whose manifest asks for a heavy budget (minutes rather than a minute, `budget: "heavy"` in its
`plugin.inspect {path | dataBase64}` entry) installs only with `allowHeavy: true`: ask the user first. `plugin.run`
runs it where it is called, so the call may take minutes; `notifications/cancelled` stops it.
`plugin.install` rejects a `replace` or `allowHeavy` value that is not a boolean.
```json
{"name":"run_command","arguments":{"command":"plugin.install","params":{"path":"/plugins/desaturate.wasm"}}}
+5 -1
View File
@@ -1,6 +1,6 @@
# Roadmap: milestones and what's next
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-05 · **Change:** minor (Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
## Feature submission evidence
@@ -90,6 +90,9 @@ Checked 2026-10-10 from the code, tests and open issues; no workflow fails, so V
| Print production: CMYK and spot colour, bleed and marks, PDF/X out, separations preview | yes | PDF/X-1a/3/4, presets, marks and bleed, ICC output intent, Separations Preview, Print with PostScript output | 0 |
| Exchange files with Illustrator users: open their `.ai`/EPS/PDF, hand back a file they can open | partial (doesn't block alpha) | `.ai`, EPS and PDF open as editable art, but real files can get the wrong layer structure (#951); Save As `.ai` is PDF-compatible, which Illustrator opens without its own editing data (#868), or legacy version 7, which keeps layers, groups and type as text, one artboard per file, and waits for users' testing. EPS legacy mesh corners, vector opacity masks and raster print-page comparison now preserve editable art under synthetic regressions. This is the beta main-format gap ([gaps.md](gaps.md) G9) | 10–20 (for beta) |
Hindi interface follow-up (2026-11-06): the catalog and zero/one plural rule are implemented;
native wording review, layout checks and a web Devanagari font remain. [Notes](localization-hi.md).
## Current focus
1. **Interaction-fidelity pass** (G1) by tool, from [ui-parity.md](ui-parity.md): Pen and Curvature, Direct
@@ -175,6 +178,7 @@ separate. Scores and hours unchanged. [Behavior and command details](development
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | minor | Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged |
| 2026-11-04 | minor | New Document: the units chosen in Preset Details belong to the chosen preset; Recent and Saved cards keep their own units; scores and estimates unchanged. |
| 2026-11-03 | minor | M7: the OpenType panel offers the selected font's available Stylistic Sets with custom or numbered names; estimates unchanged. |
| 2026-11-03 | minor | M1: Enclosing Lasso adds freehand whole-object selection under Object › Plug-ins; estimates unchanged. |
+10 -3
View File
@@ -1,6 +1,6 @@
# Parity with Adobe Illustrator
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (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); scores and estimates unchanged; 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; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026)
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (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)
## Feature submission evidence
@@ -31,6 +31,9 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
| Date | Change | Summary |
|---|---|---|
| 2026-11-05 | minor | A nearby hit on a plain long stroke or outline avoids assembling its whole path. A hit near the middle of a 200,000-anchor path took about 11–13 ms before and 1.0–1.4 ms after in paired runs on a busy Windows machine; a miss inside the path's box fell from 18.7 ms to 1.6 ms, while a distant miss was unchanged. Other stroke styles and fill hits keep their existing checks. Scores and estimates unchanged; idle performance budgets remain unverified. |
| 2026-11-05 | minor | Translating a type object without changing its text or formatting reuses glyph geometry and expanded character-stroke outlines between frames. The text appears at its new position with unchanged pixels. Scaling the type, editing its content or formatting, or changing installed fonts rebuilds the geometry; scores and estimates unchanged. |
| 2026-11-05 | minor | Moving a large selection reuses the object locations found during command validation. A 20,000-object nudge took 58.07 ms before and 51.26 ms after in paired median runs; object positions, selection, and undo behavior stay the same. Scores and estimates unchanged. |
| 2026-11-05 | minor | Canvas: an image drawn larger than 1,024 pixels at the size it shows, with its colours made again (separated into ink planes, colorized or shown through Separations Preview), has them made only for the 1,024-pixel tiles in view, each kept for later frames (#4155). Zooming in to 50%, 100% and 200% on the file of #4155 went from 8.6–9.0 s to 0.78 s, 0.05 s and 0.05 s (measured, M3 Pro, one run each), with the same pixels. Scores and estimates unchanged. |
| 2026-11-05 | minor | Canvas: a document's first frame (opened, or its tab chosen) renders on the render worker instead of the UI thread; the window shows the document's paper and artboards until the art lands, and a frame ready within 16 ms shows at once. Opening the file of #4155 kept the UI thread busy for 8.7 s at a stretch, now at most 64 ms; a 50,000-path SVG 1.4 s, now 62 ms (measured, M3 Pro, one run each). Scores and estimates unchanged. |
| 2026-11-05 | minor | Canvas: an image drawn reduced in a CMYK document is shrunk to the size it shows before it is separated into ink planes, not separated at full size and then shrunk (#4155). On the 141-megapixel image of #4155 the first frame went from 9.2 s to 1.6 s, and the sharp frame after a pan from 3.9 s to 8 ms (measured, M3 Pro, one run each). The same pixels show within 5 levels; fine detail such as 1-pixel lines now shows its true average. Scores and estimates unchanged. |
@@ -358,7 +361,7 @@ what keeps it from beta, not from alpha.
| File formats | 75% | 15–30 | estimated | [file-format-parity.md](file-format-parity.md) |
| Hardware (GPU, pen, touch, displays) | 35% | 25–45 | estimated | [hardware-parity.md](hardware-parity.md) |
| Localization (the 12 key languages, equally weighted) | 74% | 50–85 | measured from catalogs | [localization-parity.md](localization-parity.md) |
| Performance | ~60% | 15–25 | estimated (unverified budgets) | [gaps.md](gaps.md) |
| Performance | ~60% | 15–25 | estimated (unverified budgets; measured long-path hits and large-selection nudges) | [gaps.md](gaps.md) |
| Stability | ~60% | 30–50 | estimated | [gaps.md](gaps.md) |
| Platforms (macOS, Windows x64/arm64, Linux, FreeBSD, web) | 80% | 15–25 | estimated | [gaps.md](gaps.md) |
| Ecosystem and plug-ins (scripting, third-party plug-ins) | 15% | 30–60 | estimated | [gaps.md](gaps.md) |
@@ -595,7 +598,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Pattern names and swatch names:** `pattern.options` refuses a new name that another pattern, a swatch or a color group has. It takes a name that only the pattern's own swatches have. The reference page does not say what happens when the new name is taken; the refusal follows VectorCraft's rule that swatches and color groups share one namespace (`Document::swatch_name_taken`), which `swatch.new` and `swatch.edit` also follow. A rename gives the new name only to the pattern's swatches that had the old one; any other swatch with the old name keeps it, and art linked to that swatch stays linked. `object.pattern.make` and `object.pattern.saveCopy` number a color group's name as they number a swatch's. Tests in `tests/pattern.rs` cover each command. Public reference: [Create and edit patterns](https://web.archive.org/web/20211031180358/https://helpx.adobe.com/illustrator/using/create-edit-patterns.html) (archived copy).
- **A clip group in Properties:** with one clip group selected, the panel has Edit Clipping Path and Edit Contents at its top, under the Clip Group heading, which select the clipping path or the clipped art for the selection tools to transform alone, as Object › Clipping Mask does (<https://www.adobe.com/learn/illustrator/web/crop-using-masks>: with a clip group selected, the tutorial uses Edit Clipping Path at the top of the Properties panel to select the mask for editing, and uses Edit Contents to select the masked art). Edit Contents shows only when the group clips something. Not checked against the reference app: whether Properties keeps the buttons while the clipping path or the contents is selected; the Control bar has no clip-group buttons here. Evidence: `panels::properties::tests::one_clip_group_has_edit_clipping_path_and_edit_contents_at_the_top`.
- **Contextual controls in Properties:** the [Properties panel overview](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/properties-panel-overview.html) lists controls that appear for particular selections and tools; Properties has them, each running the existing command. Quick Actions has Blend Options for one selected blend, with the Blend tool or any other, as the [blending page](https://helpx.adobe.com/illustrator/using/blending-objects.html) describes (#4817) (the Blend Options dialog, OK one undo step) and Merge Live Paint when a Live Paint group is selected with more paths and nothing Live Paint refuses (`livePaint.merge`). Appearance has the stroke's Variable Width Profile list, the Control bar's, with the Width tool or when the stroke has a variable width (`stroke.set {profile}`), and beside fx the Delete icon: with one effect on the one selected object (its own or a fill's or stroke's) its name and an icon that removes it (`effect.remove`), with several an icon that opens the Appearance panel, as the overview describes. With Direct Selection and corners of one path selected, Corner and Corner Radius set the kind and radius of those corners (`object.setLiveShape`); a live rectangle's and polygon's own rows already do. Each edit is one undo step. The overview's Variable Font icon was already in Character. Not checked against the reference app: whether Merge needs two Live Paint groups (the overview speaks of several selected groups; `livePaint.merge` takes a group and paths), and where exactly each control sits in its section. Evidence: `panels::properties::tests::{blend_options_is_a_quick_action_for_one_blend_with_the_blend_tool, merge_live_paint_is_a_quick_action_for_a_live_paint_group_and_more, the_width_profile_shows_for_a_variable_width_or_the_width_tool, direct_selected_corners_show_their_kind_and_radius, one_effect_has_a_delete_icon_in_appearance}`.
- **Edit Artboards in Properties:** the active artboard's name is a field. Typing a new name and pressing Enter or clicking elsewhere renames that artboard in one undo step, as the Artboards panel's rename does (`artboard.setProps {index, name}`); pressing Escape or leaving the field empty keeps the old name. A click on the Artboard Options icon beside the field opens Artboard Options for the active artboard, as double-clicking the Artboard tool's button does (`tool.options {tool: "artboard"}`). Pointer and key tests in `panels/properties.rs` cover both. Public references: [Resize artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/resize-artboards.html) and [Create and add new artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/add-new-artboards.html).
- **Edit Artboards in Properties:** a Transform section comes first (#5219): the reference point the Transform panel and Control bar share, the active artboard's X and Y (of that point) and W and H with the Constrain Width and Height Proportions link, its preset and orientation, and Move and Scale Artwork with Artboard. The Artboards section follows, with the name field, Artboard Options and Fill. The active artboard's name is a field. Typing a new name and pressing Enter or clicking elsewhere renames that artboard in one undo step, as the Artboards panel's rename does (`artboard.setProps {index, name}`); pressing Escape or leaving the field empty keeps the old name. A click on the Artboard Options icon beside the field opens Artboard Options for the active artboard, as double-clicking the Artboard tool's button does (`tool.options {tool: "artboard"}`). Pointer and key tests in `panels/properties.rs` cover both. Public references: [Resize artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/resize-artboards.html) and [Create and add new artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/add-new-artboards.html).
- **Artboard background colors:** each artboard can have a background color (`artboard.setProps {index, color}`, `color: null` removes it). With the Artboard tool, Properties has a Fill row: its list sets None, White or Black, and its chip and its Color Picker… item open the Color Picker for the artboard. Artboard Options has a Background Color row with a list that sets None, White or Black, and a color button. The canvas draws the artboard's paper in the color, multiplied with the paper color while Simulate Colored Paper is on, and the transparency grid still covers it. The native format saves the color, and a document without colors saves as before. Exports draw it behind each exported artboard's art, inside the artboard and in the color's own model: raster formats (on a transparent background too), PDF, SVG and EPS pages, `.ai` files' PDF pages, Export for Screens and print, whose preview shows it; files with editing data keep it as the artboard's color, not as art. Export for Screens has Include Artboard Fill beside Include Bleed (on by default and remembered; `includeArtboardFill: false`, which `document.export` and `file.print` take too, leaves it out) (#4937). Not done: `.ai` files the reference app reads keep it only in VectorCraft's editing data, and `.ai`/PDF import doesn't read a background color from the reference app's own data. Engine, canvas, Properties, Color Picker, Artboard Options, export (`fileio::tests_artboard_fill`) and Export for Screens dialog tests cover it. Public reference: [Apply colors to artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/add-background-color-to-artboards.html).
- **Resizing several artboards:** with several artboards selected with the Artboard tool, a new W or H in Properties, the Transform panel or the Control bar, a preset or an orientation in Properties or the Control bar, and a new Width or Height in Artboard Options resize every selected artboard in one undo step (`artboard.setProps {artboards}`), and a Fill chosen in Properties colors each of them (#5698); a Shift- or Ctrl/Cmd-click on an Artboards panel row with another tool in use switches to the Artboard tool and selects as it does; with Scale Artwork with Artboard on, Properties, the Transform panel and the Control bar scale each object once, with the artboard it was inside before the change. The Transform panel, the Control bar and Artboard Options resize each one about its own reference point, a preset sizes each one in its own orientation, and X and Y still move the active artboard alone. Pointer and key tests in `panels/properties.rs`, dialog tests in `dialogs/tests.rs` and an engine test in `tests/xform.rs` cover them. Public references: [Artboard Enhancements In Illustrator CC](https://blog.adobe.com/en/publish/2017/11/10/artboard-enhancements-in-illustrator-cc) (a height and a width entered once resize every selected artboard) and [Using multiple artboards](https://helpx.adobe.com/illustrator/using/using-multiple-artboards.html) (2019).
- **Artboard Escape routing:** Escape leaves Artboard editing for Selection; during a drag it first cancels the gesture. Headless egui key events cover idle Escape, active-drag cancellation and a subsequent Escape in `tests/distortkeys.rs`.
@@ -667,6 +670,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- The dock's double arrow collapses Properties, Layers and Libraries to icons at the top of the icon column, popping out like the other icon panels, and expands them again (`window.collapseDock`, kept with the preferences and in saved workspaces). The icon column's own arrow (expanding the icon panels into a full column) is not done.
- Window › Toolbars › New Toolbar… and New Toolbar… in the All Tools drawer's menu ask for a name and make a blank toolbar that floats on its own, moved by its title bar and listed under Window › Toolbars, whose item shows or hides it. The title bar's × hides it, and its double arrow shows its tools in one column or two. Its ••• button opens the All Tools drawer beside it, and tools dragged from the drawer fill it. The toolbars are kept with the workspace they were made in: switching workspaces shows that workspace's toolbars, Reset Workspace keeps them, and New Workspace starts the new workspace with a copy of them (<https://helpx.adobe.com/illustrator/using/tools.html>; `window.toolbar.new`, `window.toolbar.custom`, the `toolbar` param of `window.editToolbar` and `toolbar.addTool`/`removeTool`/`reset`; `tools_added_to_a_new_toolbar_survive_a_workspace_reload`).
- Window › Toolbars › Manage Toolbars… and Manage Toolbars… in the All Tools drawer's menu open a dialog that lists the toolbars made with New Toolbar: a new name typed for the selected toolbar renames it, + copies it with its tools (with none selected, + makes a blank toolbar), and the trash can deletes it. Each change shows under Window › Toolbars and stays in the workspace (<https://helpx.adobe.com/illustrator/using/tools.html>; `window.toolbar.manage`, `window.toolbar.rename`, `window.toolbar.duplicate`, `window.toolbar.delete`; `manage_toolbars_renames_duplicates_and_deletes`).
- Hindi (2026-11-06): Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged. [Terminology and limitations](localization-hi.md).
- Czech render-site labels: desktop/web file filters, diagnostics, suggested preset names and contributor tooltips/plurals now use catalog lookups; gradients have Czech adjective agreement and printer marks have a separate context (PDF/Print and Summary). Search, Home, toolbar/panel tooltips and Preferences already look up their labels. Every complete catalog has rows for these labels and for the Roman and Japanese printer mark styles. Evidence: `i18n::tests::czech_render_site_follow_up`, `i18n::tests::complete_catalogs_translate_render_site_labels`, `dialogs::tests_modal::printer_mark_labels_are_distinct_from_language_names`; see [localization-parity.md](localization-parity.md).
- 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`).
- 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).
@@ -1212,6 +1216,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
A `.ai` or EPS opened from its editing data keeps each artboard's center mark, cross hairs, video safe areas and video ruler pixel aspect ratio, and the file's Document Raster Effects Settings; the author comes from the header's `%%For` (the editing data's, else an EPS's own) when the file's File Info gives none, the header's custom colors that no swatch has come in as spot swatches, a named color the file defines takes the place of a default swatch of that name when the file has no palette, and an older file's `%%TemplateBox` places its artboard. A value of another type or out of range keeps its default (`crates/eps/src/import/ai/tests.rs`, `crates/eps/src/import/tests_native.rs`, `crates/engine/src/cmd/fileio/tests_aiimport.rs`).
A `.ai` opened from its editing data opens its Objects on Path groups live, with their path, their objects in order along it, Pivot and Rotate, and their art where the file draws it; a group whose spacing has been dragged, or with options an Objects on Path group doesn't hold, opens as a plain group (`crates/eps/src/import/ai/tests.rs`).
`.ai` symbol definitions and placed instances open as live symbols, in the Symbols panel's order; an instance of a symbol that isn't read, or whose appearance differs from its symbol's, comes in as the page draws it (`crates/eps/src/import/ai/tests.rs`).
Blends and envelopes in the definitions of a `.ai`'s symbols, patterns and brushes' art count against the same per-file limits on blend layout and envelope checks as the layers' art, so a file with many definitions does not get those limits again for each one (`crates/eps/src/import/ai/read/directives.rs`).
A `.ai` or EPS whose editing data has brushes opens with the file's Calligraphic, Scatter, Art and Bristle brushes in the Brushes panel in place of the default ones, in the file's order: the Calligraphic size, roundness and angle with their variation, the Scatter size, spacing, scatter and rotation, the Bristle settings, and the Scatter and Art brushes' art. A brush library `.ai` (brushes and no layers) opens from its PDF part with its brushes, so Other Library lists them. Pattern brushes and brushes that can't be read are left out with a note; brushed paths still come in as their drawn look (part of #372 and #637; `crates/eps/src/import/ai/tests.rs`, `crates/eps/src/import/tests_native.rs`).
In a `.ai` opened from its editing data, a path or type object with Offset Path, Outline Object or Outline Stroke on the whole object opens as itself with those effects live, in their order and shown or hidden; on a fill or stroke of type they stay on that fill or stroke. Offset Path keeps its Offset, Joins and Miter Limit, and Outline Stroke takes its width from the stroke. An Offset Path with a setting missing, out of range or not read keeps the drawn art, as does a path with a Path effect on one fill or stroke (`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, an object with a Tweak that moves nothing or Pucker & Bloat at 0 opens as itself with the effect live. A path, compound path or group whose only effect is Transform without copies, or a Free Distort whose corners make a parallelogram, opens as itself with it live, and so does an unstroked path or compound path with straight segments whose only effect is Twist. A gradient or pattern, an image, type, a clipping group, an opacity mask or effects inside the object, or a stroke with a Transform that scales, rotates or reflects, keep the drawn art (`crates/eps/src/import/ai/style/tests.rs`, `crates/eps/src/import/ai/tests.rs`, `crates/eps/src/import/ai/read/ops.rs`).
@@ -1692,6 +1697,8 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | minor | Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged |
| 2026-11-06 | minor | Properties in Edit Artboards: a Transform section (reference point, X, Y, W, H, preset, orientation, Move and Scale Artwork) above the Artboards section (name, Artboard Options, Fill), X and Y of the shared reference point (#5219); evidence updated; scores unchanged. |
| 2026-11-06 | minor | Scrubby labels: the Control bar's Stroke: and Opacity: links and the Properties panel's Stroke link scrub their fields; a click still opens the panel (#4088); evidence updated; scores unchanged. |
| 2026-11-06 | minor | Control bar: Paragraph: link and Align left/center/right while type is selected, trimmed from the bar's right end after X/Y/W/H and the Align buttons (#5372); evidence added; scores unchanged. |
| 2026-11-04 | minor | Contour add-on (beyond Illustrator): drag away from a selected shape's edge to grow a live copy of it, or toward the inside to shrink it; the copy carries a live Offset Path effect, so it stays editable until Bake (Expand Appearance), a second drag changes the same Contour instead of nesting one, and a floating bar sets the distance and the Sharp, Round or Square corners. `addon.contour.set` is the command behind it. It is a built-in add-on: Object › Plug-ins › Contour, and its own heading in All Tools, with no default shortcut or toolbar slot. A VectorCraft design built on Offset Path; no other application was inspected. Scores and estimates unchanged. |
+2 -1
View File
@@ -38,6 +38,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | minor | Properties panel in Edit Artboards (Shift+O): a Transform section with the shared reference point, X, Y, W and H, the preset and orientation, and Move and Scale Artwork with Artboard, above the Artboards section with the name, Artboard Options and Fill (#5219); scores and estimates unchanged |
| 2026-11-06 | minor | Scrubby labels: the Control bar's Stroke: and Opacity: and the Properties panel's Stroke, links to their panels, scrub the field after them as other labels do; a click still opens the panel (#4088); scores and estimates unchanged |
| 2026-11-05 | minor | Direct Selection: Shift-click picks several points of a blend's spine and dragging one moves them all, with the key objects on them, in one undo step (#5285); scores and estimates unchanged |
| 2026-11-05 | minor | Direct Selection: Cmd/Ctrl held lends the Selection tool, whose bounding box shows while the key is down over objects selected whole; its handles scale and rotate, and a Cmd drag moves the whole object with its direct-selected anchors kept (#3901); scores and estimates unchanged |
@@ -364,7 +365,7 @@ the menu item is dimmed with nothing selected, and the shortcut can be reassigne
| Actions panel: Create New Action (bottom bar, ≡ › New Action…) asks for the name, set, function key and color, and Record adds the action and records into it ([Create new actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/record-actions.html)) | partial | `ui.action.new`, `ui.action.play`; `panels/actions.rs` tests. A function key plays its action, even when a command has the same shortcut, and the command keeps it. Button Mode, which shows the color, remains |
| Actions panel: Delete Selection (bottom bar) deletes the selected set with its actions and keeps the other sets ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `ui.actionSet.delete`; `panels/actions.rs` tests. VectorCraft's own rules, which the overview does not cover: deleting a set asks first (a selected action is still deleted at once), Shift-click on a set's name selects a range of sets, ≡ › Delete does the same as the button, and Default Actions and the last set can be deleted. Undo does not restore a deleted set, and recorded commands cannot be selected or deleted |
| Actions panel: ≡ › Duplicate copies the selected action or set ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `ui.actionSet.duplicate`; `panels/actions.rs` tests. VectorCraft's own rules, which the overview does not cover: the copy goes right after the original, is named after it with " copy" added and is selected, and a copied set holds copies of all its actions. Undo does not remove the copy, and recorded commands cannot be duplicated |
| Properties panel per context (every selection type's Quick Actions) | partial | one clip group: Edit Clipping Path and Edit Contents, at the top of the panel rather than in Quick Actions (G1); the overview's additional controls ([Properties panel overview](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/properties-panel-overview.html)): Blend Options (one blend selected, with any tool, #4817), Repeat Options (one radial, grid or mirror repeat selected: Object › Repeat › Options, #5181; the overview does not list it) and Merge Live Paint (a Live Paint group with more) in Quick Actions, the Width Profile list (Width tool or a variable-width stroke) and an applied effect's Delete icon in Appearance, Corner and Corner Radius for corners selected with Direct Selection; Variable Font was already there |
| Properties panel per context (every selection type's Quick Actions) | partial | one clip group: Edit Clipping Path and Edit Contents, at the top of the panel rather than in Quick Actions (G1); the overview's additional controls ([Properties panel overview](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/properties-panel-overview.html)): Blend Options (one blend selected, with any tool, #4817), Repeat Options (one radial, grid or mirror repeat selected: Object › Repeat › Options, #5181; the overview does not list it) and Merge Live Paint (a Live Paint group with more) in Quick Actions, the Width Profile list (Width tool or a variable-width stroke) and an applied effect's Delete icon in Appearance, Corner and Corner Radius for corners selected with Direct Selection; Variable Font was already there; Edit Artboards: a Transform section (reference point, X, Y, W, H, preset, orientation) above the Artboards section (#5219) |
| Select › Start Global Edit / Stop Global Edit; Properties › Quick Actions with the Global Edit Options popover (Match: Appearance, Size; On Artboards: All Artboards or a range, Include Objects On Canvas; Result(s)); Escape stops it; the matched objects are highlighted in their layer colour while it runs; a Shift-click on a highlighted match leaves it out | partial | #3521, `select.globalEdit` / `select.globalEditOptions` / `select.globalEditExclude`, `crates/engine/src/tests/globaledit.rs`; paths, compound paths, symbol instances and groups of them (similar groups, #4939: edits inside one group reach the same object in the others; [public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/edit-objects/edit-groups-with-similar-objects.html)); Shift-click to leave a match out ([public source](https://helpx.adobe.com/ph_fil/illustrator/how-to/global-editing-sensei.html)); the Control bar's Global Edit Options dropdown opens the same options; rotated copies and highlighting matches before the start remain ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/edit-objects/edit-similar-objects.html)) |
| Contextual task bar | done | |
| Control bar with Transform and Stroke popovers | done | |