diff --git a/crates/engine/src/cmd/panelcmds.rs b/crates/engine/src/cmd/panelcmds.rs index a155245fbc..aa83466693 100644 --- a/crates/engine/src/cmd/panelcmds.rs +++ b/crates/engine/src/cmd/panelcmds.rs @@ -1276,7 +1276,7 @@ fn aligned_between(tab: &vectorcraft_doc::TabStop, from: f64, x: f64) -> bool { /// The frames of the story that type object `id` belongs to (its thread in thread order, else `id` /// alone), each with the length of its text in bytes. -fn story_frames(s: &Session, id: NodeId) -> Vec<(NodeId, usize)> { +pub(crate) fn story_frames(s: &Session, id: NodeId) -> Vec<(NodeId, usize)> { let Some(st) = s.active() else { return vec![] }; let d = &st.doc; let frames = d.text_threads.iter().find(|thread| thread.contains(&id)).cloned().unwrap_or_else(|| vec![id]); @@ -1314,6 +1314,16 @@ fn move_editing_selection( at + inserted.iter().filter(|(b, _)| *b <= at).map(|(_, n)| n).sum::() }; let (anchor, caret) = (story(anchor), story(caret)); + select_story_range(s, id, anchor, caret) +} + +/// The Type tool's anchor and caret become story positions `anchor` and `caret` of the story that +/// frame `id` belongs to, as its frames are now. The caret stays in `id` while its place is there, +/// and else goes to the frame that holds it, with the anchor in that frame; that frame becomes the +/// selection when it was not selected. +pub(crate) fn select_story_range(s: &mut Session, id: NodeId, anchor: usize, caret: usize) -> Result<()> { + let start_of = |frames: &[(NodeId, usize)], f: NodeId| frames.iter().take_while(|(g, _)| *g != f).map(|(_, n)| n).sum::(); + let len_of = |frames: &[(NodeId, usize)], f: NodeId| frames.iter().find(|(g, _)| *g == f).map_or(0, |(_, n)| *n); let after = story_frames(s, id); let fits = |f: NodeId| (start_of(&after, f)..=start_of(&after, f) + len_of(&after, f)).contains(&caret); let frame = if fits(id) { Some(id) } else { after.iter().map(|(f, _)| *f).find(|f| fits(*f)) }; diff --git a/crates/engine/src/cmd/textedit.rs b/crates/engine/src/cmd/textedit.rs index 9079f7b892..cf0ceb82ee 100644 --- a/crates/engine/src/cmd/textedit.rs +++ b/crates/engine/src/cmd/textedit.rs @@ -270,7 +270,7 @@ fn range_of(p: &Value, len: usize, cmd: &str) -> Result<(usize, usize)> { Ok((a.min(b), a.max(b))) } -fn edit_range(s: &mut Session, p: &Value) -> Result { +pub(crate) fn edit_range(s: &mut Session, p: &Value) -> Result { const C: &str = "text.editRange"; let id = object_param(p, "id", C)?.ok_or_else(|| bad(C, "missing `id`"))?; let t = text_ref(s, id)?; diff --git a/crates/engine/src/cmd/typemenu.rs b/crates/engine/src/cmd/typemenu.rs index da930d7e59..359b369a89 100644 --- a/crates/engine/src/cmd/typemenu.rs +++ b/crates/engine/src/cmd/typemenu.rs @@ -10,8 +10,8 @@ use super::object::choice; use super::threads::ThreadIndex; use super::typecmd::{area_text, block_gaps, needed_room, refresh_bounds}; use super::{ - CommandSpec, EngineError, Result, Session, bad, checked_ids_param, cmd, find_command, has_clipboard, has_doc, has_selection, number_or, - switch_or, targets, text_param, + CommandSpec, EngineError, Result, Session, bad, checked_ids_param, cmd, find_command, has_clipboard, has_doc, has_selection, named_ids, + number_or, switch_or, targets, text_param, }; pub fn specs() -> Vec { @@ -111,7 +111,7 @@ pub fn specs() -> Vec { "Insert Character", ["Type"], None, - "{char: \"bullet\"|\"copyright\"|\"ellipsis\"|\"paragraph\"|\"registered\"|\"section\"|\"trademark\"|\"emDash\"|\"enDash\"|\"discretionaryHyphen\"|\"nonBreakingHyphen\"|\"doubleLeftQuote\"|\"doubleRightQuote\"|\"singleLeftQuote\"|\"singleRightQuote\"|\"emSpace\"|\"enSpace\"|\"hairSpace\"|\"sixthSpace\"|\"thinSpace\"|\"nonBreakingSpace\"|\"figureSpace\"|\"punctuationSpace\"|\"thirdSpace\"|\"quarterSpace\"|\"tab\"|\"forcedLineBreak\"|\"paragraphReturn\" | text: string | code: Windows Alt+0 code (0–255 in Windows-1252, a Unicode code point above: 176 → °, 151 → —) | unicode: hex code point (\"00B0\" or \"U+00B0\"), ids?|id?: object ids (default: the selection)} append to the selected text objects", + "{char: \"bullet\"|\"copyright\"|\"ellipsis\"|\"paragraph\"|\"registered\"|\"section\"|\"trademark\"|\"emDash\"|\"enDash\"|\"discretionaryHyphen\"|\"nonBreakingHyphen\"|\"doubleLeftQuote\"|\"doubleRightQuote\"|\"singleLeftQuote\"|\"singleRightQuote\"|\"emSpace\"|\"enSpace\"|\"hairSpace\"|\"sixthSpace\"|\"thinSpace\"|\"nonBreakingSpace\"|\"figureSpace\"|\"punctuationSpace\"|\"thirdSpace\"|\"quarterSpace\"|\"tab\"|\"forcedLineBreak\"|\"paragraphReturn\" | text: string | code: Windows Alt+0 code (0–255 in Windows-1252, a Unicode code point above: 176 → °, 151 → —) | unicode: hex code point (\"00B0\" or \"U+00B0\"), ids?|id?: object ids (default: the selection)} insert at the Type tool's caret, replacing its selection, while it edits text and no ids are given; otherwise append to the selected text objects. forcedLineBreak is U+2028, a new line in the same paragraph; paragraphReturn is a line feed, which starts a new paragraph", has_selection, insert_char ), @@ -786,8 +786,9 @@ fn to_point(s: &mut Session, p: &Value) -> Result { let plain = t.plain_text(); let baseline = lay.lines.first().map(|l| l.baseline).unwrap_or(fb.y0 + t.first_style().size * 0.8); // Soft wraps → explicit breaks (replace the space before the wrap when there is one). - let mut breaks: Vec = - lay.lines.iter().skip(1).map(|l| l.start).filter(|&b| b > 0 && plain.as_bytes().get(b - 1) != Some(&b'\n')).collect(); + // A line after a paragraph return or a forced line break (U+2028) already starts there. + let hard = |b: usize| plain.get(..b).is_some_and(|s| s.ends_with(['\n', '\u{2028}'])); + let mut breaks: Vec = lay.lines.iter().skip(1).map(|l| l.start).filter(|&b| b > 0 && !hard(b)).collect(); breaks.sort_unstable(); breaks.dedup(); for b in breaks.into_iter().rev() { @@ -1525,8 +1526,9 @@ pub(crate) fn special_char(name: &str) -> Option<&'static str> { "thirdSpace" => "\u{2004}", "quarterSpace" => "\u{2005}", "tab" => "\t", - // Our text model breaks lines at paragraph returns only. - "forcedLineBreak" | "paragraphReturn" => "\n", + // A line break inside the paragraph, as Shift+Enter types it. + "forcedLineBreak" => "\u{2028}", + "paragraphReturn" => "\n", _ => return None, }) } @@ -1576,6 +1578,11 @@ fn insert_char(s: &mut Session, p: &Value) -> Result { (None, None, None, Some(u)) => unicode_char(u).ok_or_else(|| bad(C, format!("`{u}` is no Unicode character")))?.to_string(), (None, None, None, None) => return Err(bad(C, "give `char`, `text`, `code` or `unicode`")), }; + if named_ids(p)?.is_none() + && let Some(r) = insert_at_type_caret(s, &text)? + { + return Ok(r); + } let ids = texts(s, p, C)?; // When `text` is empty and every object ends with a run of text, the document and its undo // history stay as they are. @@ -1606,6 +1613,44 @@ fn insert_char(s: &mut Session, p: &Value) -> Result { Ok(ids_json(&ids)) } +/// `type.insert` while the Type tool edits text: `text` replaces the tool's selection (inserts at +/// its caret) as one undo step, and the caret goes after it. `None` when no text is being edited. +fn insert_at_type_caret(s: &mut Session, text: &str) -> Result> { + let tool = s.tool_options(); + let Some(id) = tool.get("editing").and_then(Value::as_u64).map(NodeId) else { return Ok(None) }; + let d = &s.doc()?.doc; + let Some(NodeKind::Text(t)) = d.node(id).map(|n| &n.kind) else { return Ok(None) }; + let len = vectorcraft_text::edit::runs_len(&t.runs); + let g = |k: &str| tool.get(k).and_then(Value::as_u64).map_or(len, |v| (v as usize).min(len)); + let (x, y) = (g("start"), g("end")); + let (a, b) = (x.min(y), x.max(y)); + // After Select All in threaded text the whole story is selected: the other frames' text goes + // in the same edit, as when typing replaces it. + let story: Vec = tool.get("story").and_then(Value::as_array).into_iter().flatten().filter_map(Value::as_u64).map(NodeId).collect(); + let clear: Vec = if a == 0 && b == len && story.contains(&id) { + let has_text = |f: &NodeId| matches!(d.node(*f).map(|n| &n.kind), Some(NodeKind::Text(o)) if !o.runs.iter().all(|r| r.text.is_empty())); + story.iter().filter(|f| **f != id && has_text(f)).map(|f| f.0).collect() + } else { + vec![] + }; + if text.is_empty() && a == b && clear.is_empty() { + return Ok(Some(ids_json(&[id]))); + } + // A typing session ends first: the insertion is a step of its own. + if tool.get("typing").and_then(Value::as_bool) == Some(true) { + s.set_tool_option("commitTyping", &Value::Bool(true)); + s.commit_interaction()?; + } + // The frame's place in the story once the edit has cleared the frames in `clear`. + let start: usize = + super::panelcmds::story_frames(s, id).iter().take_while(|(f, _)| *f != id).filter(|(f, _)| !clear.contains(&f.0)).map(|(_, n)| n).sum(); + let r = super::textedit::edit_range(s, &json!({"id": id.0, "start": a, "end": b, "insert": text, "clear": clear}))?; + let caret = r.get("caret").and_then(Value::as_u64).map_or(a + text.len(), |c| c as usize); + // Threaded text re-flows in the edit: the caret goes to the frame its place moved to. + super::panelcmds::select_story_range(s, id, start + caret, start + caret)?; + Ok(Some(ids_json(&[id]))) +} + // ---------- Find and Replace ---------- fn is_word(c: char) -> bool { diff --git a/crates/engine/src/tests/menucmds.rs b/crates/engine/src/tests/menucmds.rs index ae40324b9e..1faeaa76ad 100644 --- a/crates/engine/src/tests/menucmds.rs +++ b/crates/engine/src/tests/menucmds.rs @@ -4109,6 +4109,17 @@ fn area_to_point_turns_wraps_into_breaks() { assert_eq!(txt.replace('\n', " "), "one two three four five six"); } +/// Convert To Point Type keeps the lines that a paragraph return or a forced line break (U+2028) +/// starts as they are: neither gets a paragraph return added after it. +#[test] +fn area_to_point_keeps_forced_line_breaks() { + let mut s = session(); + let a = id_of(&s.execute("text.create", &json!({"x": 0, "y": 0, "text": "ab\u{2028}c\nd", "area": {"width": 300, "height": 200}})).unwrap()); + sel(&mut s, &[a]); + s.execute("type.convertToPointType", &json!({})).unwrap(); + assert_eq!(plain(&s, a), "ab\u{2028}c\nd"); +} + #[test] fn placeholder_and_insert_characters() { let mut s = session(); @@ -4124,6 +4135,76 @@ fn placeholder_and_insert_characters() { assert!(s.execute("type.insert", &json!({"char": "nope"})).is_err()); } +/// Type › Insert Break Character › Forced Line Break (`type.insert {char: "forcedLineBreak"}`) +/// starts a new line in the same paragraph (U+2028, as Shift+Enter types it), so the paragraph's +/// space before does not come between the two lines; `paragraphReturn` starts a new paragraph. +/// Each insert is one undo step. +#[test] +fn insert_forced_line_break_differs_from_paragraph_return() { + fn second_line_gap(s: &Session, id: NodeId) -> f64 { + let NodeKind::Text(t) = &node(s, id).kind else { panic!("not text") }; + let lay = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), t); + assert_eq!(lay.lines.len(), 2, "{:?}", t.plain_text()); + lay.lines[1].baseline - lay.lines[0].baseline + } + let mut s = session(); + let mut gaps = Vec::new(); + for (c, want) in [("forcedLineBreak", "ab\u{2028}c"), ("paragraphReturn", "ab\nc")] { + let t = text(&mut s, "ab"); + sel(&mut s, &[t]); + s.execute("text.setFormat", &json!({"ids": [t.0], "spaceBefore": 30})).unwrap(); + let steps = undo_len(&s); + s.execute("type.insert", &json!({"char": c})).unwrap(); + assert_eq!(undo_len(&s), steps + 1, "{c}"); + s.execute("type.insert", &json!({"text": "c"})).unwrap(); + assert_eq!(plain(&s, t), want, "{c}"); + gaps.push(second_line_gap(&s, t)); + } + assert!(gaps[1] - gaps[0] > 29.0, "space before only at the paragraph return: {gaps:?}"); + // The same character by `unicode` and by `text`. + let t = text(&mut s, ""); + sel(&mut s, &[t]); + s.execute("type.insert", &json!({"unicode": "2028"})).unwrap(); + s.execute("type.insert", &json!({"text": "\u{2028}"})).unwrap(); + assert_eq!(plain(&s, t), "\u{2028}\u{2028}"); +} + +/// While the Type tool edits text, the Insert Special, Whitespace and Break menu items +/// (`type.insert` without `ids`) insert at its caret or replace its selection, as one undo step, +/// and the caret goes after the insertion; `ids` still appends to those objects. +#[test] +fn insert_character_goes_to_the_type_tool_caret() { + use vectorcraft_tools::{Mods, PointerEvent, PointerKind, ToolKey}; + let mut s = session(); + let v = ViewInfo::default(); + s.select_tool("type", v).unwrap(); + for k in [PointerKind::Down, PointerKind::Up] { + s.pointer(&PointerEvent::new(k, 50.0, 300.0), v).unwrap(); + } + let t = s.doc().unwrap().selection.objects[0]; + s.tool_text("abcd", v).unwrap(); + for _ in 0..2 { + s.tool_key(ToolKey::Left, Mods::default(), v).unwrap(); + } + let steps = undo_len(&s); + s.execute("type.insert", &json!({"text": ""})).unwrap(); + assert_eq!(undo_len(&s), steps, "an empty insert changes nothing"); + s.execute("type.insert", &json!({"char": "forcedLineBreak"})).unwrap(); + assert_eq!(plain(&s, t), "ab\u{2028}cd"); + assert_eq!(s.tool_options()["caret"], json!(5)); + s.tool_text("X", v).unwrap(); + assert_eq!(plain(&s, t), "ab\u{2028}Xcd"); + s.tool_key(ToolKey::Left, Mods { shift: true, ..Mods::default() }, v).unwrap(); + s.execute("type.insert", &json!({"char": "paragraphReturn"})).unwrap(); + assert_eq!(plain(&s, t), "ab\u{2028}\ncd"); + s.execute("type.insert", &json!({"ids": [t.0], "text": "!"})).unwrap(); + assert_eq!(plain(&s, t), "ab\u{2028}\ncd!"); + s.tool_key(ToolKey::Escape, Mods::default(), v).unwrap(); + s.execute("edit.undo", &json!({})).unwrap(); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(plain(&s, t), "ab\u{2028}Xcd", "the replacement is one undo step"); +} + /// `type.insert` by code (#5108): `code` as a Windows Alt+0 code types (Windows-1252 for /// 128–159, the code point otherwise), `unicode` as a hex code point. #[test] diff --git a/crates/engine/src/tests/textedit.rs b/crates/engine/src/tests/textedit.rs index ed4a82dce6..4f1edcc62a 100644 --- a/crates/engine/src/tests/textedit.rs +++ b/crates/engine/src/tests/textedit.rs @@ -2289,6 +2289,41 @@ fn threaded_list_edited_in_its_second_frame() -> (Session, NodeId, NodeId, Strin (s, a, b, story) } +/// Type › Insert Break Character › Forced Line Break (`type.insert`) after Select All in threaded +/// text replaces the whole story, every frame's text, as one undo step. +#[test] +fn insert_character_replaces_the_whole_story_that_select_all_selected() { + let (mut s, a, b, story) = threaded_story_edited_in_its_second_frame(); + s.execute("select.all", &json!({})).unwrap(); + let steps = undo_labels(&s).len(); + s.execute("type.insert", &json!({"char": "forcedLineBreak"})).unwrap(); + assert_eq!(undo_labels(&s).len(), steps + 1, "one undo step"); + assert_eq!(format!("{}{}", obj(&s, a).plain_text(), obj(&s, b).plain_text()), "\u{2028}"); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(format!("{}{}", obj(&s, a).plain_text(), obj(&s, b).plain_text()), story); +} + +/// When `type.insert` at the caret in the first frame of threaded text pushes the caret's place on +/// into the next frame, the Type tool's caret goes there with it, and typing goes after the +/// insertion. +#[test] +fn insert_character_moves_the_caret_with_the_text_it_flows_on() { + let (mut s, a, b, story) = threaded_story_edited_in_its_second_frame(); + let first = obj(&s, a).plain_text(); + // Before the last word of the first frame: two line breaks there push the line after the + // first one on into the second frame. + let at = first.trim_end().rfind(' ').map_or(0, |k| k + 1); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + s.set_tool_option("textSelection", &json!({"editing": a.0, "anchor": at, "caret": at})); + for _ in 0..2 { + s.execute("type.insert", &json!({"char": "forcedLineBreak"})).unwrap(); + } + assert!(obj(&s, a).plain_text().len() < at + 6, "the second break flows on into the second frame"); + s.tool_text("X", ViewInfo::default()).unwrap(); + let want = format!("{}\u{2028}\u{2028}X{}", &story[..at], &story[at..]); + assert_eq!(format!("{}{}", obj(&s, a).plain_text(), obj(&s, b).plain_text()), want); +} + #[test] fn remove_breaks_takes_the_whole_story_that_select_all_selected() { let (mut s, a, b, story) = threaded_list_edited_in_its_second_frame(); diff --git a/docs/mcp.md b/docs/mcp.md index 2bc487bbce..2d62c71356 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -9803,6 +9803,20 @@ on again. {"name":"run_command","arguments":{"command":"type.convertToAreaType","params":{"ids":[42]}}} ``` +## Insert Special, Whitespace and Break Characters + +`type.insert {char?, text?, code?, unicode?, ids?|id?}` inserts one character (`char` names it, `code` and `unicode` give +its code) or the string `text`. While the Type tool edits text and neither `ids` nor `id` is given, it replaces the +tool's selection, or inserts at its caret, and the caret goes after the insertion; otherwise it appends to the end of each +selected text object. Each call is one undo step; an empty `text` at the Type tool's caret changes nothing and records no undo step. +`char: "forcedLineBreak"` (Type › Insert Break Character › Forced Line Break) inserts U+2028, which starts a new line in +the same paragraph, as Shift+Enter does; `char: "paragraphReturn"` inserts a line feed, which starts a new paragraph. A +`text` that holds U+2028 inserts the same break. + +```json +{"name":"run_command","arguments":{"command":"type.insert","params":{"char":"forcedLineBreak"}}} +``` + ## Smart Punctuation `type.smartPunctuation` replaces keyboard characters in the selected type, or in every text object with `scope: diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 82bef4efc5..bb40f35586 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1505,6 +1505,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Vertical punctuation:** fullwidth `!` (U+FF01) and `?` (U+FF1F) use their nominal glyph upright when no vertical alternate is present, following the Tu fallback in [Unicode UAX #50 §3.1](https://www.unicode.org/reports/tr50/#vo). Code-built test fonts cover point and area type with and without `vert` alternates, retain the rotated fallback for a bracket and long vowel mark, and leave horizontal type unchanged. Tests: `crates/text/src/tests/vertical.rs`. - Free Distort's dialog (Effect › Distort & Transform › Free Distort…) shows a box in the proportions of the first selected object's bounds with a handle on each corner. Dragging a handle moves that corner. A handle focused by a click or Tab moves 1% of the box with each arrow key, and 10% with Shift. Reset puts the four corners back on the box. The preview and OK run `effect.apply`, or `effect.setParams` when the dialog edits an applied effect, and the Appearance panel's inline editor opens the dialog with Edit…. Behavior reference: Illustrator CC Help (2014, [PDF](https://help.adobe.com/archive/en/illustrator/cc/2014/illustrator_reference.pdf)), page 285 (PDF page 291). - **Kerning at the start of a line:** at the Type tool's caret before the first character of the text, of a paragraph, or after a forced line break, the Kerning field, Alt+←/→ (Alt+↓/↑ in vertical type) and Reset Tracking and Kerning set the space before the character after the caret (`kerningBefore`), as the reporter of #5111 describes the reference; the character moves along its line and the rest of the line follows, as one undo step (#5111). It used to do nothing there, or kern the invisible line break. Inside a line the caret still kerns the character before it. A line that wraps in area type takes no space before its first character, and Touch Type still moves a line's first character only up and down. SVG export starts the line where the character is drawn, and on a path writes the space as the first character's `dx`; vertical type moves the character down its column. A space on the first letter of a ligature keeps the ligature whole. Tests: `tests::caret_kerning` (engine), `tests::kerning_before` (text), `the_space_before_a_lines_first_character_moves_its_tspan` (SVG). +- **Forced Line Break:** Type › Insert Break Character › Forced Line Break starts a new line without starting a new paragraph, as [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/insert-white-space-and-break-characters.html) describes: it inserts U+2028, the character Shift+Enter types, so the paragraph's Space Before does not come between the two lines (`type.insert {char: "forcedLineBreak"}`; `paragraphReturn` still inserts a line feed). Storing the break as U+2028 is VectorCraft's own choice. While the Type tool edits text, this item and the other Insert Special, Whitespace and Break Character items insert at its caret or replace its selection as one undo step, with the caret after them; without a Type tool edit they append to the selected type objects. Tests: `tests::menucmds::insert_forced_line_break_differs_from_paragraph_return`, `tests::menucmds::insert_character_goes_to_the_type_tool_caret`. - **Optical kerning:** Character and Properties offer Optical beside Auto for automatic pair spacing. The side-profile spacing method is VectorCraft's own: each pair moves part of the way toward the font's own stem spacing (the gap of `nn`, else `HH` or `oo`), keeps at least part of that gap where the outlines come closest, and changes by at most 0.12 em tighter or 0.06 em looser, so ordinary text keeps the font's spacing (#5336). Ideographs, kana, hangul, fullwidth and CJK punctuation forms and dashes keep the font's spacing. Optical keeps its mode across cosmetic style runs. Choosing Optical clears manual pair values, as Auto does, and leaves additive tracking intact; a manual value typed afterwards replaces that pair's correction ([Adjust kerning and tracking](https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-kerning-and-tracking.html)). Native documents retain the mode and pair overrides; old documents use Auto. Behavior reference: [Line and character spacing](https://web.archive.org/web/20260916050333/https://helpx.adobe.com/illustrator/using/line-character-spacing.html) (public documentation). Tests: `crates/text/src/tests/typo.rs`, `crates/engine/src/tests/textedit.rs`. - **Kerning across style runs:** characters that differ only in fill, stroke, underline, strikethrough, overprint, character style name, leading, baseline shift, rotation, Character Alignment, kerning, or tracking that keeps or drops ligatures alike are shaped together, so restyling one character keeps the font's kerning pairs with its neighbors. A character with manual kerning that follows one with automatic kerning keeps the font's kerning with it (unless All Caps or Small Caps sets it as two letters, as ß becomes SS), and its value replaces the font's kerning after it. A ligature does not form across a change of style, and a change of font, size or OpenType features still shapes the characters apart. Behavior reference: [Line and character spacing](https://web.archive.org/web/20260916050333/https://helpx.adobe.com/illustrator/using/line-character-spacing.html) (public documentation). Tests: `crates/text/src/tests/typo.rs`, `crates/text/src/tests/bidi.rs`. - **Manual kerning in right-to-left text:** a manual kerning value on a Hebrew or Arabic character changes the space between it and the next character in reading order, the one drawn to its left, under Auto and Optical kerning. The character before it keeps its place, and the caret between the pair stays beside the next character. The side the space goes on is VectorCraft's own rule. Behavior reference: [Line and character spacing](https://web.archive.org/web/20260916050333/https://helpx.adobe.com/illustrator/using/line-character-spacing.html). Test: `rtl_manual_kerning_spaces_the_character_from_the_next_in_reading_order`.