Merge pull request #8266 from dotCooCoo/feat/type-show-hidden-characters

Type: Show Hidden Characters marks tabs, nonbreaking spaces, discretionary hyphens and forced line breaks
This commit is contained in:
BFlat
2026-11-18 10:12:25 +07:00
committed by GitHub
6 changed files with 298 additions and 29 deletions
+6 -1
View File
@@ -233,7 +233,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"",
"{} toggle drawing the gaps of the selected Live Paint groups (those livePaint.info lists) in each group's Gap Preview Color while edges show → true when on",
),
("type.hiddenCharacters", "Show Hidden Characters", "Cmd+Alt+I", "{} toggle markers for spaces, paragraph ends and story ends"),
(
"type.hiddenCharacters",
"Show Hidden Characters",
"Cmd+Alt+I",
"{} toggle markers for spaces, tabs, nonbreaking and fixed-width spaces, discretionary hyphens, forced line breaks, paragraph ends and story ends",
),
("type.alignLeft", "Align left", "Cmd+Shift+L", "{} align the selected type's paragraphs (or those the Type tool's selection touches) left"),
(
"type.alignCenter",
+128 -2
View File
@@ -6869,10 +6869,136 @@ fn hidden_char_marks(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec<Shape
let blue = Color32::from_rgb(0x4f, 0x9d, 0xff);
shapes(app, ctx)
.into_iter()
.filter(|s| matches!(s, Shape::Circle(c) if c.fill == blue) || matches!(s, Shape::Text(t) if t.fallback_color == blue))
.filter(|s| match s {
Shape::Circle(c) => c.fill == blue || c.stroke.color == blue,
Shape::Text(t) => t.fallback_color == blue,
Shape::LineSegment { stroke, .. } => stroke.color == blue,
Shape::Path(p) => p.stroke.color == egui::epaint::ColorMode::Solid(blue),
_ => false,
})
.collect()
}
/// Show Hidden Characters marks each tab, nonbreaking space, narrow nonbreaking space, space of
/// a set width and discretionary hyphen with a mark of its kind, a plain space with a dot, and
/// a tab's arrow spans the tab's advance to its stop.
#[test]
fn hidden_characters_mark_tabs_nonbreaking_spaces_and_discretionary_hyphens() {
use super::tool_overlays::CharMark::*;
let text = "a b\tc\u{00A0}d\u{202F}e\u{2003}f\u{2009}g\u{200A}h\u{00AD}i";
let t = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::new(10.0, 50.0), text, vectorcraft_doc::CharStyle::default());
let marks = HiddenMarks::of(&t);
let kinds: Vec<_> = marks.chars.iter().map(|c| c.0).collect();
assert_eq!(kinds, [Tab, NoBreakSpace, NarrowNoBreakSpace, FixedSpace, FixedSpace, FixedSpace, DiscretionaryHyphen]);
assert_eq!(marks.spaces.len(), 1, "only the plain space has a dot");
let lay = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), &t);
let tab = lay.glyphs.iter().find(|g| text[g.byte..].starts_with('\t')).unwrap();
assert!(tab.advance > 1.0, "{}", tab.advance);
let (_, a, b) = marks.chars[0];
let start = t.xf * vectorcraft_geom::Point::new(tab.origin.x, tab.origin.y - 3.0);
assert!((a - start).hypot() < 1e-9 && (b.x - a.x - tab.advance).abs() < 1e-9 && b.y == a.y, "{a:?} {b:?} {start:?}");
}
/// Show Hidden Characters marks a line that a forced line break (U+2028) ends with a bent arrow
/// and no ¶; the line a paragraph return ends gets ¶, and the story's end #.
#[test]
fn hidden_characters_mark_forced_line_breaks() {
let t = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::ZERO, "ab\u{2028}cd\nef", vectorcraft_doc::CharStyle::default());
let marks = HiddenMarks::of(&t);
let lay = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), &t);
assert_eq!(lay.lines.len(), 3);
assert_eq!(marks.breaks.len(), 1);
let (at, along, up) = marks.breaks[0];
let first = &lay.lines[0];
assert_eq!(at, vectorcraft_geom::Point::new(first.x1 + 1.0, first.baseline));
assert_eq!((along - at, up - at), (vectorcraft_geom::Vec2::new(1.0, 0.0), vectorcraft_geom::Vec2::new(0.0, -1.0)));
let ends: Vec<_> = marks.ends.iter().map(|e| (e.1, e.0.y)).collect();
assert_eq!(ends, [("", lay.lines[1].baseline), ("#", lay.lines[2].baseline)]);
// A story that ends with a forced line break: the arrow, and # on the empty line after it.
let t = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::ZERO, "ab\u{2028}", vectorcraft_doc::CharStyle::default());
let marks = HiddenMarks::of(&t);
assert_eq!((marks.breaks.len(), marks.ends.iter().map(|e| e.1).collect::<Vec<_>>()), (1, vec!["#"]));
}
/// A discretionary hyphen gets one ¬ also where the line breaks at it and the layout draws a
/// hyphen there, which stands for no character of the text.
#[test]
fn hidden_characters_mark_a_discretionary_hyphen_at_a_break_once() {
let style = vectorcraft_doc::CharStyle::default();
let db = vectorcraft_text::FontDb::global();
let word = vectorcraft_text::layout(db, &vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::ZERO, "coco-", style.clone()));
let width = word.lines[0].x1 - word.lines[0].x0 + 2.0;
let mut t = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::ZERO, "coco\u{00AD}co", style);
t.kind = vectorcraft_doc::text::TextKind::Area {
frame: vectorcraft_geom::PathData::from_bezpath(&vectorcraft_geom::Rect::new(0.0, 0.0, width, 400.0).to_path(0.1)),
};
let lay = vectorcraft_text::layout(db, &t);
assert_eq!(lay.lines.len(), 2, "the line breaks at the discretionary hyphen");
assert!(lay.glyphs.iter().any(|g| g.len == 0), "the layout draws a hyphen at the break");
let marks = HiddenMarks::of(&t);
assert_eq!(marks.chars.iter().map(|c| c.0).collect::<Vec<_>>(), [super::tool_overlays::CharMark::DiscretionaryHyphen]);
}
/// In vertical type the marks follow the column: a space's dot sits beside the column, halfway
/// down the space, and ¶ goes below the column's last character.
#[test]
fn hidden_characters_follow_vertical_type() {
let mut t = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::ZERO, "a b\nc", vectorcraft_doc::CharStyle::default());
t.vertical = true;
let lay = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), &t);
let space = lay.glyphs.iter().find(|g| g.byte == 1).unwrap();
let marks = HiddenMarks::of(&t);
let dot = marks.spaces[0];
assert!((dot - vectorcraft_geom::Point::new(space.origin.x + 3.0, space.origin.y + space.advance / 2.0)).hypot() < 1e-9, "{dot:?} {space:?}");
let (at, glyph, align) = marks.ends[0];
assert_eq!((glyph, align), ("", egui::Align2::CENTER_TOP));
let b = lay.glyphs.iter().find(|g| g.byte == 2).unwrap();
assert!(at.y > b.origin.y, "{at:?} below {:?}", b.origin);
}
/// In a right-to-left paragraph ¶ goes at the line's left end, where the paragraph ends.
#[test]
fn hidden_characters_end_a_right_to_left_line_at_its_left() {
let t = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::ZERO, "אב גד\nהו", vectorcraft_doc::CharStyle::default());
let lay = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), &t);
assert!(lay.lines[0].rtl);
let marks = HiddenMarks::of(&t);
let (at, glyph, align) = marks.ends[0];
assert_eq!((glyph, align), ("", egui::Align2::RIGHT_BOTTOM));
assert_eq!(at.x, lay.lines[0].x0 - 1.0);
}
/// Type on a path has the marks over its characters and # after its last one.
#[test]
fn hidden_characters_mark_type_on_a_path() {
let mut t = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::ZERO, "a b\tc", vectorcraft_doc::CharStyle::default());
let path = vectorcraft_geom::Line::new((0.0, 100.0), (600.0, 100.0)).to_path(0.1);
t.kind = vectorcraft_doc::text::TextKind::OnPath { path: vectorcraft_geom::PathData::from_bezpath(&path), start: 0.0, end: None };
let marks = HiddenMarks::of(&t);
assert_eq!(marks.spaces.len(), 1);
assert_eq!(marks.chars.iter().map(|c| c.0).collect::<Vec<_>>(), [super::tool_overlays::CharMark::Tab]);
assert_eq!(marks.ends.iter().map(|e| e.1).collect::<Vec<_>>(), ["#"]);
}
/// The overlay draws each kind of mark: a dot, two rings, the tab's arrow, a tick, ¬, the forced
/// line break's bent arrow, ¶ and #.
#[test]
fn show_hidden_characters_draws_every_kind_of_mark() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
let text = "a b\tc\u{00A0}d\u{202F}e\u{2003}f\u{00AD}g\u{2028}h\ni";
app.session.execute("text.create", &json!({"x": 20, "y": 60, "text": text})).unwrap();
let ctx = egui::Context::default();
let xf = Xf { rect: egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0)), zoom: 1.0, center: Point::new(200.0, 150.0), rot: 0.0 };
let shapes = hidden_chars(&mut app, &ctx, &xf);
let count = |f: &dyn Fn(&Shape) -> bool| shapes.iter().filter(|s| f(s)).count();
assert_eq!(count(&|s| matches!(s, Shape::Circle(c) if c.fill != Color32::TRANSPARENT)), 1, "{shapes:?}");
assert_eq!(count(&|s| matches!(s, Shape::Circle(c) if c.fill == Color32::TRANSPARENT)), 2, "{shapes:?}");
assert_eq!(count(&|s| matches!(s, Shape::LineSegment { .. })), 2, "the tab's shaft and the tick: {shapes:?}");
assert_eq!(count(&|s| matches!(s, Shape::Path(_))), 3, "the tab's head and the break's arrow: {shapes:?}");
assert_eq!(count(&|s| matches!(s, Shape::Text(_))), 3, "¬, ¶ and #: {shapes:?}");
}
/// Show Hidden Characters puts a dot over each space of a list paragraph and none over its
/// bullet, which stands for no character.
#[test]
@@ -6890,7 +7016,7 @@ fn hidden_characters_mark_no_space_at_a_bullet() {
fn show_hidden_characters_off_releases_the_text_nodes() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
let text = json!({"x": 20, "y": 60, "text": "one two\nthree four"});
let text = json!({"x": 20, "y": 60, "text": "one\ttwo\u{00A0}x\nthree\u{2028}four"});
let id = vectorcraft_doc::NodeId(app.session.execute("text.create", &text).unwrap()["id"].as_u64().unwrap());
let ctx = egui::Context::default();
app.run("type.hiddenCharacters", json!({})).unwrap();
+155 -23
View File
@@ -2,12 +2,14 @@ use super::grid::{clip_segment, pref_color};
use super::outline::{OVERLAY_MAX_ANCHORS, c32, stroke_path};
use super::{Color32, CornerRadius, Node, NodeKind, Overlay, Point, Pos2, Rect, Shape, Stroke, StrokeKind, Tokens, VectorcraftApp, Xf, pos2, vec2};
/// Type → Show Hidden Characters: spaces as dots, ¶ at paragraph ends, # at the end of a story.
/// The marks of each text object are kept from one frame to the next ([`HiddenChars`]).
/// Type → Show Hidden Characters: the characters that print no ink, and the ends of paragraphs,
/// lines and stories ([`HiddenMarks`]). The marks of each text object are kept from one frame to
/// the next ([`HiddenChars`]).
pub(super) fn hidden_chars_overlay(app: &mut VectorcraftApp, p: &egui::Painter, xf: &Xf) {
let Some(st) = app.session.active() else { return };
let clip = p.clip_rect();
let color = Color32::from_rgb(0x4f, 0x9d, 0xff);
let stroke = Stroke::new(1.0, color);
let font = egui::FontId::proportional(((10.0 * xf.zoom) as f32).clamp(7.0, 18.0));
let kept = &mut app.canvas.hidden_chars;
// `last` holds the marks of the last frame. The marks of the objects this frame doesn't draw
@@ -43,13 +45,62 @@ pub(super) fn hidden_chars_overlay(app: &mut VectorcraftApp, p: &egui::Painter,
for &at in &marks.spaces {
p.circle_filled(xf.to_screen(at), 1.2, color);
}
for &(at, glyph) in &marks.ends {
p.text(xf.to_screen(at), egui::Align2::LEFT_BOTTOM, glyph, font.clone(), color);
for &(mark, a, b) in &marks.chars {
draw_char_mark(p, mark, xf.to_screen(a), xf.to_screen(b), stroke, &font);
}
for &(at, along, up) in &marks.breaks {
let at = xf.to_screen(at);
let u = unit_or(xf.to_screen(along) - at, vec2(1.0, 0.0));
let n = unit_or(xf.to_screen(up) - at, vec2(0.0, -1.0));
// A bent arrow: down from above the line's end, then back along the line.
let corner = at + u * 7.0 + n * 2.0;
let tip = at + u + n * 2.0;
p.add(Shape::line(vec![at + u * 7.0 + n * 8.0, corner, tip], stroke));
p.add(Shape::line(vec![tip + u * 3.0 + n * 3.0, tip, tip + u * 3.0 - n * 3.0], stroke));
}
for &(at, glyph, align) in &marks.ends {
p.text(xf.to_screen(at), align, glyph, font.clone(), color);
}
kept.marks.insert(n.id, (n.clone(), marks));
});
}
/// `v` scaled to length 1, or `or` when `v` has no length.
fn unit_or(v: egui::Vec2, or: egui::Vec2) -> egui::Vec2 {
let len = v.length();
if len > 1e-3 { v / len } else { or }
}
/// Draws the mark of one character on screen. `a` and `b` are the start and end of the
/// character's advance, in the direction the text reads, above its baseline.
fn draw_char_mark(p: &egui::Painter, mark: CharMark, a: Pos2, b: Pos2, stroke: Stroke, font: &egui::FontId) {
let u = unit_or(b - a, vec2(1.0, 0.0));
let mid = a + (b - a) * 0.5;
match mark {
CharMark::Tab => {
// An arrow across the tab's advance, at least 6 px long.
let end = if (b - a).length() < 6.0 { a + u * 6.0 } else { b };
let n = vec2(u.y, -u.x);
p.line_segment([a, end], stroke);
p.add(Shape::line(vec![end - u * 3.0 + n * 2.5, end, end - u * 3.0 - n * 2.5], stroke));
}
CharMark::NoBreakSpace => {
p.circle_stroke(mid, 2.0, stroke);
}
CharMark::NarrowNoBreakSpace => {
p.circle_stroke(mid, 1.4, stroke);
}
CharMark::FixedSpace => {
// A short tick across the baseline's direction.
let n = vec2(u.y, -u.x) * 2.5;
p.line_segment([mid - n, mid + n], stroke);
}
CharMark::DiscretionaryHyphen => {
p.text(mid, egui::Align2::CENTER_BOTTOM, "¬", font.clone(), stroke.color);
}
}
}
/// The Show Hidden Characters marks of the text objects drawn in the last frame
/// ([`crate::CanvasCache::hidden_chars`]). Each is kept with the object it was laid out from: an
/// edited object is a new `Arc` and is laid out again, and all type is laid out again when the
@@ -63,12 +114,51 @@ pub struct HiddenChars {
pub(super) marks: std::collections::HashMap<vectorcraft_doc::NodeId, (std::sync::Arc<Node>, std::sync::Arc<HiddenMarks>)>,
}
/// One text object's marks in document space: a dot over each space, and ¶ or # after the lines
/// that end a paragraph or the story. Type on a path has none.
/// The mark Show Hidden Characters draws over a character other than a plain space.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(super) enum CharMark {
/// A tab (U+0009): an arrow across its advance, to the tab stop.
Tab,
/// A nonbreaking space (U+00A0): a ring.
NoBreakSpace,
/// A narrow nonbreaking space (U+202F): a smaller ring.
NarrowNoBreakSpace,
/// The spaces of a set width (U+2000 to U+200A, U+205F, U+3000): a short tick.
FixedSpace,
/// A discretionary hyphen (U+00AD): ¬, where the word can break.
DiscretionaryHyphen,
}
impl CharMark {
/// The mark of `c`, `None` for a character with no mark of its own.
pub(super) fn of(c: char) -> Option<Self> {
Some(match c {
'\t' => Self::Tab,
'\u{00A0}' => Self::NoBreakSpace,
'\u{202F}' => Self::NarrowNoBreakSpace,
'\u{2000}'..='\u{200A}' | '\u{205F}' | '\u{3000}' => Self::FixedSpace,
'\u{00AD}' => Self::DiscretionaryHyphen,
_ => return None,
})
}
}
/// One text object's marks in document space: a dot over each space, a [`CharMark`] over each
/// tab, nonbreaking space, space of a set width and discretionary hyphen, a bent arrow after
/// each line a forced line break (U+2028) ends, and ¶ or # after the lines that end a paragraph
/// or the story. Type on a path has the marks over characters, ¶ and the bent arrow at its
/// breaks, and # after its last character when all of its text is drawn.
#[derive(Default)]
pub(super) struct HiddenMarks {
pub(super) spaces: Vec<Point>,
ends: Vec<(Point, &'static str)>,
/// Each mark over a character, with the start and end of the character's advance 3 pt above
/// its baseline, in the direction the text reads.
pub(super) chars: Vec<(CharMark, Point, Point)>,
/// Each forced line break: where its arrow starts, a point 1 pt further along the line and a
/// point 1 pt above the baseline from there.
pub(super) breaks: Vec<(Point, Point, Point)>,
/// ¶ and #, where they are drawn and how the text is aligned to that point.
pub(super) ends: Vec<(Point, &'static str, egui::Align2)>,
}
impl HiddenMarks {
@@ -76,29 +166,71 @@ impl HiddenMarks {
pub(super) fn of(tx: &vectorcraft_doc::TextObject) -> Self {
let mut marks = Self::default();
let lay = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), tx);
if lay.on_path {
return marks;
}
let text = tx.plain_text();
let to = |q: Point| tx.xf * q;
// A list marker's glyphs (length 0) stand for no character.
for g in lay.glyphs.iter().filter(|g| g.len > 0) {
if text.get(g.byte..).is_some_and(|s| s.starts_with(' ')) {
marks.spaces.push(to(Point::new(g.origin.x + g.advance / 2.0, g.origin.y - 3.0)));
// The direction a glyph's baseline runs, and up from it (y points down).
let along = |angle: f64| vectorcraft_geom::Vec2::new(angle.cos(), angle.sin());
let up = |angle: f64| {
let d = along(angle);
vectorcraft_geom::Vec2::new(d.y, -d.x)
};
// A list marker's glyphs and a hyphen the layout adds at a break (length 0) stand for no
// character. Glyphs before the start of an open path draw nothing. A character drawn with
// several glyphs gets one mark.
let mut marked = None;
for g in lay.glyphs.iter().filter(|g| g.len > 0 && !g.off_path) {
let Some(c) = text.get(g.byte..).and_then(|s| s.chars().next()) else { continue };
if marked == Some(g.byte) {
continue;
}
let (d, n) = (along(g.angle), up(g.angle));
let start = g.origin + n * 3.0;
let end = start + d * g.advance;
if c == ' ' {
marks.spaces.push(to(start + d * (g.advance / 2.0)));
} else if let Some(mark) = CharMark::of(c) {
let (a, b) = if g.rtl { (end, start) } else { (start, end) };
marks.chars.push((mark, to(a), to(b)));
} else if lay.on_path && (c == '\n' || c == '\u{2028}') {
// Type on a path is one line: its breaks are marked where their glyphs are.
if c == '\n' {
marks.ends.push((to(g.origin), "", egui::Align2::LEFT_BOTTOM));
} else {
marks.breaks.push((to(g.origin), to(g.origin + d), to(g.origin + d + n)));
}
} else {
continue;
}
marked = Some(g.byte);
}
if lay.on_path {
// # after the last character, when the path holds all of the text.
let last = lay.glyphs.iter().filter(|g| g.len > 0 && !g.off_path).max_by_key(|g| g.byte + g.len);
if let Some(g) = last.filter(|g| g.byte + g.len >= text.len() && !lay.overflow) {
let d = along(g.angle);
let at = if g.rtl { g.origin - d } else { g.origin + d * (g.advance + 1.0) };
marks.ends.push((to(at), "#", egui::Align2::LEFT_BOTTOM));
}
return marks;
}
// Lines are in line space: `physical_point` turns them into columns in vertical type.
let at = |x: f64, y: f64| to(lay.physical_point(Point::new(x, y)));
for (i, line) in lay.lines.iter().enumerate() {
let last = i + 1 == lay.lines.len();
let breaks = text.get(line.end..).is_some_and(|s| s.starts_with('\n'));
let (glyph, at) = if last && line.end >= text.len() {
("#", true)
} else if breaks {
("", true)
} else {
("", false)
// A right-to-left line ends at its left edge.
let (x, dx) = if line.rtl { (line.x0 - 1.0, -1.0) } else { (line.x1 + 1.0, 1.0) };
let align = match (lay.vertical, line.rtl) {
(true, _) => egui::Align2::CENTER_TOP,
(false, true) => egui::Align2::RIGHT_BOTTOM,
(false, false) => egui::Align2::LEFT_BOTTOM,
};
if at {
marks.ends.push((to(Point::new(line.x1 + 1.0, line.baseline)), glyph));
let soft = text.get(line.start..line.end).is_some_and(|s| s.ends_with('\u{2028}'));
if last && line.end >= text.len() {
marks.ends.push((at(x, line.baseline), "#", align));
} else if soft {
marks.breaks.push((at(x, line.baseline), at(x + dx, line.baseline), at(x, line.baseline - 1.0)));
} else if text.get(line.end..).is_some_and(|s| s.starts_with('\n')) {
marks.ends.push((at(x, line.baseline), "", align));
}
}
marks
+6 -1
View File
@@ -234,7 +234,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"",
"{} toggle drawing the gaps of the selected Live Paint groups (those livePaint.info lists) in each group's Gap Preview Color while edges show → true when on",
),
("type.hiddenCharacters", "Show Hidden Characters", "Cmd+Alt+I", "{} toggle markers for spaces, paragraph ends and story ends"),
(
"type.hiddenCharacters",
"Show Hidden Characters",
"Cmd+Alt+I",
"{} toggle markers for spaces, tabs, nonbreaking and fixed-width spaces, discretionary hyphens, forced line breaks, paragraph ends and story ends",
),
("type.alignLeft", "Align left", "Cmd+Shift+L", "{} align the selected type's paragraphs (or those the Type tool's selection touches) left"),
(
"type.alignCenter",
+2 -1
View File
@@ -532,7 +532,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale)
| Raster effects (Effect Gallery, Document Raster Effects Settings) | 4 | 35% | ~36 Photoshop-style filters (Artistic, Brush Strokes, Sketch, Stylize) and Texturizer's Load Texture (since done, see the area table above, as is the Effect Gallery, #2883); Document Raster Effects Settings, raster effects in PDF, the pixel-filter pipeline, Radial Blur, Smart Blur (Normal, Edge Only and Overlay Edge), Unsharp Mask, Glowing Edges, Distort (Diffuse Glow, Glass, Ocean Ripple), Pixelate (Color Halftone, Crystallize, Mezzotint, Pointillize), Texture (Craquelure, Grain, Mosaic Tiles, Patchwork, Stained Glass, Texturizer) and Video (De-Interlace, NTSC Colors) are done | 8–14 |
| 3D and Materials | 4 | ~25% | Initial Revolve, Extrude & Bevel, Inflate and Rotate, with simple lighting and four original lighting presets; materials, shadows, ray tracing, Rotate (Classic), Map Art and more complete visibility remain | 25–45 |
| Type advanced | 4 | 50% | CJK composition for vertical type (mojikumi beyond Line-end Punctuation Half Width — the other sets (and their paragraph-start bracket and indent rules), custom kinsoku sets (beyond Hard, Soft and None) and the Mojikumi Settings dialog —, manual tate-chu-yoko is done, its up/down settings remain; No Break is done), tab leaders, Touch Type, Retype; vertical point/area/path type and Type Orientation have initial support (beyond parity, not scored: inline symbols in text) | 20–28 |
| Type core | 9 | 80% | Middle Eastern features beyond bidi layout, Paragraph Direction, digit types and Kashidas (editable bidirectional SVG text, a split caret where directions meet; the Middle Eastern & South Asian composers are done, #4935, but `.ai`/EPS/PDF files carry no composer); paint-only harakat keep joining with conditional GDEF-mark colour ownership, but fonts without GDEF mark classes and some AAT/`morx` ligatures can still leave marks painted as their letters; Every-line Composer fidelity for justified and ragged text (available per object; mixed type sizes in a paragraph still break single-line in non-rectangular area type and with text wrap), Optical Margin Alignment, paragraph spacing limit for vertically justified area type, hidden characters, paragraph attributes in the Type tool's copy and paste (the characters keep their styles, the paragraphs take the destination's), mixed-value display in the Paragraph panel for a selection across differing paragraphs, partial selection of type-area anchors by marquee, optional font-size preservation during group scaling (scaled character controls fixed in #1034). Hyphenation and Justification options, Fractional Widths, System Layout, styled Type-range canvas Paste (#5636), and pattern hyphenation for eleven Indian languages with grapheme/cluster protection (#4947) are done; Sanskrit automatic patterns remain pending an allowlisted source | 14–19 |
| Type core | 9 | 80% | Middle Eastern features beyond bidi layout, Paragraph Direction, digit types and Kashidas (editable bidirectional SVG text, a split caret where directions meet; the Middle Eastern & South Asian composers are done, #4935, but `.ai`/EPS/PDF files carry no composer); paint-only harakat keep joining with conditional GDEF-mark colour ownership, but fonts without GDEF mark classes and some AAT/`morx` ligatures can still leave marks painted as their letters; Every-line Composer fidelity for justified and ragged text (available per object; mixed type sizes in a paragraph still break single-line in non-rectangular area type and with text wrap), Optical Margin Alignment, paragraph spacing limit for vertically justified area type, paragraph attributes in the Type tool's copy and paste (the characters keep their styles, the paragraphs take the destination's), mixed-value display in the Paragraph panel for a selection across differing paragraphs, partial selection of type-area anchors by marquee, optional font-size preservation during group scaling (scaled character controls fixed in #1034). Hyphenation and Justification options, Fractional Widths, System Layout, styled Type-range canvas Paste (#5636), and pattern hyphenation for eleven Indian languages with grapheme/cluster protection (#4947) are done; Sanskrit automatic patterns remain pending an allowlisted source | 14–19 |
| Symbols, blends, envelopes, Repeat, perspective | 5 | 90% | further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), dynamic symbols' `.ai` round trip, envelope Anti-Alias/Preserve Shape output and warp point editing, brush interpolation in blends (M8 fidelity pass done); Symbol Options › Registration and Export Type and on-canvas dynamic part paint (gradient/pattern, opacity, blend) are done; symbol editing shows draggable 9-slice guides (#5280), while guides outside the artwork remain unsupported | 4–7 |
| Image Trace, graphs, image tools | 3 | 72% | graph Column designs (Graph Design, Marker designs and series colours set with Group Selection are done), Create Object Mosaic, per-feature stroke/fill choice and varying widths in Image Trace's Create Strokes (Vector Halftone and the Image Trace View modes, Palette and Create Strokes are done) | 6–10 |
| Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 |
@@ -766,6 +766,7 @@ since 2026-10-01.
- **Justification… on type on a path:** each paragraph's Desired Word Spacing, Letter Spacing and Glyph Scaling set its glyphs on type on a path as on point and area type, so the text after a wider gap starts further along the path, alignment and overflow use the spaced length, and a list marker keeps its width. Minimum and Maximum are not used on a path, and vertical type is not glyph scaled. SVG export writes such type as outlines with a warning. Tests `tests::justify::type_on_a_path_takes_desired_spacing_and_scaling`, `type_on_a_path_is_aligned_and_fitted_at_desired_spacing`, `vertical_type_and_list_markers_on_a_path_are_not_glyph_scaled` and the SVG test `text_layout::justification_spacing_on_a_path_is_outlined`. Public reference: the help page (<https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>).
- **Letter spacing and Full Justify between shaped clusters:** Desired Letter Spacing on any line, the letter spacing range of a justified line, and Single Word Justification's Full Justify add space only between shaped clusters, in horizontal, right-to-left and vertical type, so a combining mark stays on its letter and a Devanagari syllable's glyphs stay together. They add no space next to a zero-width format control (a soft hyphen, a bidi mark, embedding, override or isolate, a zero-width space, a joiner or non-joiner, a word joiner, a variation selector, a tag, the byte order mark), so a word wrapped in an override still reaches both edges of a justified line, and a Kinsoku push-in counts no gap at one either. A zero-width space is a line break opportunity but not a word separator ([CSS Text Level 3](https://www.w3.org/TR/css-text-3/#word-separator) does not list it), so a justified line gives it no share of its room. Desired Letter Spacing between the letters on either side of a zero-width space goes after the zero-width space, so a line that breaks there ends at its last letter, and the line breaker does not measure a gap after it. A line that Full Justify spreads and that ends in a drawn hyphen puts the same gap between its last letter and the hyphen. The cluster boundary is VectorCraft's own rule, based on the typographic character unit of [CSS Text Level 3](https://www.w3.org/TR/css-text-3/#typographic-character-unit). Tests `tests::justify::single_word_full_justify_keeps_combining_mark_with_base`, `desired_and_fitted_letter_spacing_skip_shaped_cluster`, `rtl_single_word_cluster_gap_follows_drawn_order`, `vertical_single_word_cluster_gap_follows_drawn_order`, `single_word_full_justify_keeps_conjunct_cluster`, `desired_letter_spacing_skips_bidi_format_controls`, `letter_spacing_and_full_justify_skip_joiners_and_soft_hyphens`, `format_controls_are_the_zero_width_default_ignorables`, `zero_width_space_takes_no_word_space_room`, `desired_letter_spacing_ends_a_line_broken_at_a_zero_width_space_without_a_gap`, `single_word_full_justify_spreads_up_to_the_drawn_hyphen` and `layout::wrapping_tests::kinsoku_shori_type_counts_no_gap_at_a_format_control`. Public reference: the help page (<https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>).
- **Justified lines with tabs:** a tab is not a word space, so a justified area type line no longer gives it a share of its room that no glyph draws. On a justified line with a tab, the text up to the last tab keeps its spacing, each tab keeps its stop and its leader stays in its gap, and the text after the last tab takes the room (word spaces first, then letter spacing, glyph scaling and the gaps between its letters), so the line ends on the far edge. A tab separates two words, so Single Word Justification does not align a word-tab-word line. Right-to-left lines take the text drawn after the last tab drawn, and vertical lines work down the column. Spreading the room after the last tab is VectorCraft's own rule. Tests `tests::justify::a_justified_line_with_a_tab_spreads_the_text_after_it_to_the_edge`, `a_justified_tab_keeps_its_leader_inside_its_gap`, `a_justified_word_tab_word_line_reaches_the_edge`, `the_last_line_with_a_tab_fills_the_measure_only_with_justify_all`, `a_justified_line_takes_its_room_after_its_last_tab`, `a_justified_vertical_line_with_a_tab_reaches_the_end_of_its_column`, `a_justified_right_to_left_line_with_a_tab_spans_its_measure` and `justified_point_type_with_a_tab_keeps_its_width`. Public reference: the help pages (<https://helpx.adobe.com/illustrator/using/formatting-paragraphs.html>, <https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>).
- **Show Hidden Characters marks every character that prints no ink:** [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/insert-white-space-and-break-characters.html) lists the characters that Type › Show Hidden Characters makes visible: paragraph returns, forced line breaks, tabs, spaces, nonbreaking spaces, discretionary hyphens and the end of the text. Besides the dot over a space, ¶ at a paragraph's end and # at the story's end, the canvas draws an arrow across each tab's advance to its stop, a ring over a nonbreaking space (U+00A0) and a smaller one over a narrow nonbreaking space (U+202F), a short tick over the spaces of a set width (U+2000 to U+200A, U+205F, U+3000), ¬ at a discretionary hyphen (U+00AD) whether or not the line breaks there, and a bent arrow after a line that a forced line break (U+2028) ends, which gets no ¶. The marks follow the baseline of vertical type and of type on a path, ¶ goes at the left end of a right-to-left line, and type on a path gets # after its last character when the path shows all of its text. The shapes of the marks, and marking U+202F and the spaces of a set width, are VectorCraft's own rules. The marks are drawn only on the canvas and are not saved or exported. Tests: `canvas::tests::hidden_characters_mark_tabs_nonbreaking_spaces_and_discretionary_hyphens`, `hidden_characters_mark_forced_line_breaks`, `hidden_characters_mark_a_discretionary_hyphen_at_a_break_once`, `hidden_characters_follow_vertical_type`, `hidden_characters_end_a_right_to_left_line_at_its_left`, `hidden_characters_mark_type_on_a_path` and `show_hidden_characters_draws_every_kind_of_mark`.
- **The text style panel menus' Duplicate and Delete:** in the Character Styles and Paragraph Styles panel menus, Duplicate highlights the copy, as Create New Style highlights the new style, and Delete leaves no style highlighted, as the Delete button does, so Duplicate, Clear Overrides, Redefine and Style Options are disabled until another style is clicked. A highlighted style that is renamed in Style Options or deleted by a command is no longer highlighted either. The tests `panels::text_styles::tests::panel_menu_duplicate_and_delete_update_the_highlighted_style` and `a_highlighted_style_that_is_no_longer_listed_is_not_highlighted` cover this. Public reference: [Character and paragraph styles](https://web.archive.org/web/20261015081534/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
- **Names of new styles and symbols:** `charStyle.new` and `paraStyle.new` trim the white space around the name they are given, as `charStyle.rename` and `paraStyle.rename` do, and refuse a name that is then empty; Duplicate names its copy from the trimmed name. `symbol.new` and `symbol.duplicate` trim the name as Symbol Options does, and `library.use` adds a library's text style under its trimmed name. Public reference: [Character and paragraph styles](https://web.archive.org/web/20260825113735/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
- **Naming a new text style first:** Alt-click on New in the Character Styles or Paragraph Styles panel opens New Character Style or New Paragraph Style (`ui.newCharStyle`, `ui.newParaStyle`) with the name a plain click's style gets; OK makes the style from the text selected when the dialog opened, and Cancel adds none. Tests `panels::text_styles::tests::alt_clicking_new_character_style_asks_for_its_name` and `alt_clicking_new_paragraph_style_asks_for_its_name`. Public reference: [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html), which lists Alt-click for opening panel options and names Actions, Brushes, Swatches and Symbols as exceptions.
+1 -1
View File
@@ -50,7 +50,7 @@ against Illustrator's public documentation; **estimated** unless noted.
| Roman Hanging Punctuation | done | Paragraph panel menu › Roman Hanging Punctuation, `text.setFormat {romanHangingPunctuation}` (#2756): per paragraph, Optical Margin Alignment's punctuation and amounts without the letters; paragraph styles carry it. Evidence: `tests::roman_hanging_punctuation_hangs_punctuation_but_not_letters`, `typecmd::area_tests::roman_hanging_punctuation_is_set_per_paragraph_and_saved_only_when_on` |
| Hyphenation… and Justification… options | done | Eleven Indian languages use attributed patterns and preserve syllables in both composers (#4947). Hyphenation… (`ui.hyphenation`, `text.setFormat`) sets each paragraph's Words Longer Than, After First, Before Last, Hyphen Limit, Hyphenation Zone (Single-line Composer only) and Hyphenate Capitalized Words, and paragraph styles carry them (#2310). Justification… (`ui.justification`, `text.setFormat`, #2755) sets Word Spacing, Letter Spacing and Glyph Scaling (Minimum, Desired, Maximum), Auto Leading and Single Word Justification; Desired applies to every line, justified lines and the Every-line Composer use the ranges. Vertical type isn't glyph scaled. Auto Leading also sets the Leading the Character panel shows for Auto type, the leading Alt+↑/↓ (`type.step`) steps from, per paragraph, and the lines Fill with Placeholder Text counts. Evidence: `crates/text/src/tests/justify.rs`, `dialogs::justification::tests`, `tests_prefs::auto_leading_steps_and_fills_from_the_paragraph_auto_leading`, `panels::character` test `leading_field_shows_the_paragraph_auto_leading` |
| Tab stops and leaders; Tabs panel | partial | Tabs panel and stops with leaders in the model (`text.tabs.set`); a stop drags from where the press landed (#1458); leaders fill the tab's gap, repeated on a grid so they line up from line to line (#1877); Ctrl-dragging a stop (Command on macOS) moves all the stops together; in right-aligned area type the text before a line's last tab sits at its stops, from the left edge, and the text after it against the right edge, as Illustrator's own layout in a user's `.ai` sets a price list (evidence: `tests::right_aligned_area_type_sets_the_text_after_its_last_tab_against_the_edge`; centred lines are still aligned as a whole); in justified area type the text up to a line's last tab keeps its spacing and its tabs their stops, and the text after the last tab takes the line's room to the far edge, VectorCraft's own rule (evidence: `tests::justify::a_justified_line_with_a_tab_spreads_the_text_after_it_to_the_edge` and the other tab tests in `crates/text/src/tests/justify.rs`) |
| Hidden characters (Show Hidden Characters) | done | `type.hiddenCharacters` |
| Hidden characters (Show Hidden Characters) | done | `type.hiddenCharacters`: marks spaces, tabs, nonbreaking and narrow nonbreaking spaces, the spaces of a set width, discretionary hyphens, forced line breaks, paragraph ends and the story's end, in horizontal, vertical and right-to-left type and on a path; the mark shapes are VectorCraft's own. Evidence: `canvas::tests::hidden_characters_*` |
| Spell check (Check Spelling, Auto Spell Check, custom dictionary) | done | the engine (#4936): `text.spelling.check` lists the unknown words of the document's type, each run in its Language, at the bytes `text.editRange` changes, and `text.spelling.suggest` gives suggestions, both from craft-proof, each paragraph on its own (English from the first dictionary it finds: a Hunspell dictionary in the user's dictionaries folder, the SCOWL dictionary built in from craft-i18n, a system Hunspell dictionary, and last the public-domain Moby word list built into it; other languages from the dictionaries craft-proof finds for them). The custom dictionary commands are done: `text.spelling.addWord`, `removeWord` and `changeWord` (Add, and Edit Custom Dictionary's Add, Delete and Change), and `text.spelling.dictionary` lists the words, saved to `Custom Dictionary.txt` beside the preferences; Ignore All: `text.spelling.ignoreAll` skips a word in the active document while it is open. Auto Spell Check is done: Edit › Spelling › Auto Spell Check (`edit.autoSpellCheck`, off at first, saved with the view settings) draws a red wavy line under the unknown words of the visible type, leaves out type with effects, and follows edits, the custom dictionary and Ignore All. A right-click on an underlined word lists the words its dictionary suggests (each replaces it in one undo step, `text.editRange`), or No Suggestions, then Ignore All and Add to Dictionary, and a right-click on type has Spelling › Auto Spell Check, checked while it is on. Edit › Edit Custom Dictionary… lists the custom dictionary's words, with an Entry field and Add, Delete and Change, applied on Done (Cancel leaves the dictionary as it was). The modal Check Spelling dialog is done: Edit › Spelling › Check Spelling… (`Cmd+I`, `ui.checkSpelling`) opens a modal dialog displaying the unrecognized word in sentence context ("Not in Dictionary"), a list of suggestions with double-click or selection to replace ("Change to" field), and action buttons: Ignore, Ignore All, Change (one-step Undo/Redo via `text.editRange`), Change All (batched across occurrences in a single undo step), Add to Dictionary (`text.spelling.addWord`), Done and Cancel, with keyboard navigation (Tab between controls, Enter to Change or Done, Escape to close). Evidence: `crates/engine/src/tests/spelling.rs`, `crates/ui-egui/src/canvas/tests.rs` (`auto_spell_check_*`), `crates/ui-egui/src/tests/contextmenu.rs` (the right-click), `crates/ui-egui/src/dialogs/custom_dictionary.rs` (the dialog), `crates/ui-egui/src/dialogs/check_spelling.rs` (the Check Spelling dialog). |
| Smart Punctuation, Change Case, Find & Replace | done | Type › Smart Punctuation… opens a dialog with the ff, fi, ffi and ff, fl, ffl ligatures, Smart Quotes, Smart Spaces, En, Em Dashes, Ellipses and Expert Fractions, Replace In and Report Results, which lists the count of each replacement; ligatures and fractions are written only where the font has a glyph for them. Evidence: `tests::menucmds::smart_punctuation_ligatures_spaces_and_fractions_are_counted`, `smart_punctuation_skips_ligatures_and_fractions_the_font_lacks`, `smart_spaces_keeps_one_space_after_a_period`, `dialogs::smart_punctuation::tests::menu_item_opens_the_dialog_and_ok_reports_the_counts` |
| Alt + numeric-keypad codes while typing (Windows: `Alt+0176` → °) | partial | #5108: on Windows the character Windows posts when Alt comes up after keypad digits is typed at the caret like any other, in the typing's undo step, and the keypad digits typed with Alt run no shortcut. With NumLock off the keypad keys (Insert, End, arrows, Clear, Home, Page Up/Down without the extended-key flag) count as digits too and don't move the caret (`windows_alt_codes` unit tests; neither NumLock on nor off has been tried on a Windows machine yet). `type.insert {code}` (Windows Alt+0 code, Windows-1252 for 128–159) and `{unicode}` (hex code point) insert a character by its code (`menucmds::insert_a_character_by_its_code`). macOS and Linux have no such system convention and egui reports a keypad digit as the top-row digit, so there it does nothing; a floating panel window doesn't receive the character |