This commit is contained in:
bflatastic
2026-11-19 01:26:04 +07:00
11 changed files with 266 additions and 14 deletions
+12
View File
@@ -427,6 +427,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"Cmd+Shift+U",
"{} the Character panel's Underline button: underline the selected type (or the Type tool's selection), or remove the underline when the text the Character panel shows is underlined (text.setFormat {underline}) → underlined",
),
(
"type.superscript",
"Superscript",
"Cmd+Shift+=",
"{} the Character panel's Superscript button: the selected type (or the Type tool's selection, all of its text at a caret) becomes superscript, or Normal when all of it is superscript already (text.setFormat {position}). Without selected type the keys zoom in, as Cmd+= does → \"superscript\" | \"normal\"",
),
(
"type.subscript",
"Subscript",
"Cmd+Alt+Shift+=",
"{} the Character panel's Subscript button: the selected type (or the Type tool's selection, all of its text at a caret) becomes subscript, or Normal when all of it is subscript already (text.setFormat {position}) → \"subscript\" | \"normal\"",
),
(
"type.lineComposer",
"Toggle Line Composer",
+3 -3
View File
@@ -3693,9 +3693,9 @@ digits Malayalam Malayalam
Styling: Şekillendirme:
Stylize Stilize Et
Subdivisions Alt bölümler
Subscript Abonelik
Subscript (on the roadmap) Abonelik (yol haritasında)
Subscript: Abonelik:
Subscript Alt simge
Subscript (on the roadmap) Alt simge (yol haritasında)
Subscript: Alt simge:
Subset fonts below: Aşağıdaki yazı tiplerinin alt kümesi:
Subtract Çıkar
Suffix son ek
Can't render this file because it is too large.
+2
View File
@@ -337,6 +337,8 @@ fn run_ui_part3(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result<
"type.highlightKerning" => crate::panels::character::highlight(app, crate::panels::character::Field::Kerning),
"type.highlightTracking" => crate::panels::character::highlight(app, crate::panels::character::Field::Tracking),
"type.underline" => crate::panels::character::toggle_underline(app),
"type.superscript" => crate::panels::character::toggle_position(app, "superscript"),
"type.subscript" => crate::panels::character::toggle_position(app, "subscript"),
"type.lineComposer" => crate::panels::paragraph::toggle_composer(app),
"type.hyphenate" => crate::panels::paragraph::toggle_hyphenate(app),
id if let Some((_, justify)) = crate::panels::paragraph::ALIGN_COMMANDS.iter().find(|c| c.0 == id) => {
+8 -3
View File
@@ -221,9 +221,14 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool {
match id {
// Save is off for a clean document that already has its own file.
"file.save" => app.session.active().is_some_and(|d| d.path.is_none() || d.converted || d.is_dirty()),
"type.bold" | "type.italic" | "type.underline" | "type.lineComposer" | "type.hyphenate" | "type.highlightFontSize" => {
crate::panels::character::text_style(app).is_some()
}
"type.bold"
| "type.italic"
| "type.underline"
| "type.superscript"
| "type.subscript"
| "type.lineComposer"
| "type.hyphenate"
| "type.highlightFontSize" => crate::panels::character::text_style(app).is_some(),
id if crate::panels::paragraph::ALIGN_COMMANDS.iter().any(|c| c.0 == id) => crate::panels::character::text_style(app).is_some(),
"type.applyBullets" | "type.applyNumbers" | "type.convertListToText" => crate::panels::character::text_style(app).is_some(),
id if let Some(b) = crate::panels::align::button(id) => enabled(app, b.command_now(app)),
+12
View File
@@ -428,6 +428,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"Cmd+Shift+U",
"{} the Character panel's Underline button: underline the selected type (or the Type tool's selection), or remove the underline when the text the Character panel shows is underlined (text.setFormat {underline}) → underlined",
),
(
"type.superscript",
"Superscript",
"Cmd+Shift+=",
"{} the Character panel's Superscript button: the selected type (or the Type tool's selection, all of its text at a caret) becomes superscript, or Normal when all of it is superscript already (text.setFormat {position}). Without selected type the keys zoom in, as Cmd+= does → \"superscript\" | \"normal\"",
),
(
"type.subscript",
"Subscript",
"Cmd+Alt+Shift+=",
"{} the Character panel's Subscript button: the selected type (or the Type tool's selection, all of its text at a caret) becomes subscript, or Normal when all of it is subscript already (text.setFormat {position}) → \"subscript\" | \"normal\"",
),
(
"type.lineComposer",
"Toggle Line Composer",
+36 -2
View File
@@ -540,12 +540,27 @@ pub(crate) fn highlight(app: &mut VectorcraftApp, field: Field) -> Result<Value,
/// `type.underline` (Cmd+Shift+U): what the Underline button does, on the text the panels act on.
/// Returns whether the text is now underlined: off only when every character was underlined.
pub(crate) fn toggle_underline(app: &mut VectorcraftApp) -> Result<Value, String> {
// The typing Real-time Drawing off left unapplied is applied before the text is read.
text_editing_kept(app)?;
text_style(app).ok_or("select some type first")?;
let on = shared(app, |s| s.underline) != Some(true);
run_format(app, json!({"underline": on}))?;
Ok(json!(on))
}
/// `type.superscript` (Cmd+Shift+=) and `type.subscript` (Cmd+Alt+Shift+=): what the Superscript
/// or Subscript button does, on the text the panels act on. Returns the position the text now
/// has: `"normal"` only when every character had `position`, else `position`.
pub(crate) fn toggle_position(app: &mut VectorcraftApp, position: &str) -> Result<Value, String> {
// The typing Real-time Drawing off left unapplied is applied before the text is read.
text_editing_kept(app)?;
text_style(app).ok_or("select some type first")?;
let change = position_toggle(shared_position(app), position);
let to = change["position"].clone();
run_format(app, change)?;
Ok(to)
}
/// `text.setRangeStyle` with `p` on the range the Type tool has selected (the whole text when
/// nothing is selected). Does nothing unless the Type tool edits text.
pub(crate) fn range_style(app: &mut VectorcraftApp, p: Value) {
@@ -1518,7 +1533,7 @@ fn attributes(app: &mut VectorcraftApp, ui: &mut Ui, owner: crate::font_menu::Wh
// On only when every character the panel acts on has it; a mixed selection turns it on.
let all_caps = shared(app, |s| s.all_caps) == Some(true);
let small = shared(app, |s| s.small_caps.is_some()) == Some(true);
let position = shared(app, |s| s.position).map(|p| p.id()).unwrap_or("");
let position = shared_position(app);
let underline = shared(app, |s| s.underline) == Some(true);
let strike = shared(app, |s| s.strikethrough) == Some(true);
for (kind, tip, on, change) in [
@@ -1547,6 +1562,25 @@ fn attributes(app: &mut VectorcraftApp, ui: &mut Ui, owner: crate::font_menu::Wh
});
}
/// The position kind (`normal`, `superscript` or `subscript`) that every character a Superscript
/// or Subscript toggle changes has, else `""`: at a Type tool caret with no characters selected
/// every character of the text (of each frame of a threaded story), as the toggle changes all of
/// it there ([`run_format`], [`range_style`]), else the characters [`shared`] reads. Superscripts
/// in different proportions count as superscript.
fn shared_position(app: &VectorcraftApp) -> &'static str {
let Some((id, _, _)) = text_editing(app).filter(|&(_, a, b)| b <= a) else {
return shared(app, |s| s.position.id()).unwrap_or("");
};
let Some(st) = app.session.active() else { return "" };
let mut acc = Shared::None;
for frame in text_story(app).unwrap_or_else(|| vec![id]) {
if let Some(NodeKind::Text(t)) = st.doc.node(frame).map(|n| &n.kind) {
each_paragraph_run(t, None, |_, style, _| acc.add(style.position.id()));
}
}
acc.value().unwrap_or("")
}
/// The `text.setFormat` params of the Superscript or Subscript toggle `p` for text whose
/// position is `position`: `normal` when `p` is on, else `p`, which turns the other one off.
fn position_toggle(position: &str, p: &str) -> Value {
@@ -1694,7 +1728,7 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
}
}
let small = shared(app, |s| s.small_caps.is_some()) == Some(true);
let position = shared(app, |s| s.position).map(|p| p.id()).unwrap_or("");
let position = shared_position(app);
for (label, on, change) in [
(tl!("Small Caps"), small, json!({"smallCaps": !small})),
(tl!("Superscript"), position == "superscript", position_toggle(position, "superscript")),
@@ -583,6 +583,88 @@ fn small_caps_superscript_and_subscript_buttons_set_and_show_the_text() {
assert_eq!(script_buttons(&ctx, &mut app).1, [false; 3]);
}
/// Superscript and Subscript decide from the characters they change. At a Type tool caret they
/// change every character of the text, so text that is only partly superscript turns superscript
/// everywhere, with the caret after a superscript character too, and the button there shows off.
/// Superscripts in different proportions count as superscript, so a press turns them off.
#[test]
fn superscript_and_subscript_decide_from_the_characters_they_change() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.run("file.new", json!({"width": 300, "height": 200})).unwrap();
let id = app.run("text.create", json!({"x": 20, "y": 50, "text": "x2", "size": 12})).unwrap()["id"].clone();
app.run("text.setRangeStyle", json!({"id": id, "start": 1, "end": 2, "position": "superscript"})).unwrap();
app.run("select.set", json!({"ids": [id.clone()]})).unwrap();
app.select_tool("type");
app.session.apply_actions(vec![vectorcraft_tools::Action::Notify("text.editNew".into())]).unwrap();
app.session.set_tool_option("select", &json!({"start": 2, "end": 2}));
assert_eq!(text_editing(&app).map(|(_, a, b)| (a, b)), Some((2, 2)));
let ctx = egui::Context::default();
assert_eq!(script_buttons(&ctx, &mut app).1, [false; 3], "the text is not all superscript");
assert_eq!(app.run("type.superscript", json!({})).unwrap(), json!("superscript"));
assert!(scripts(&app, &id).iter().all(|(_, p)| *p == "superscript"), "{:?}", scripts(&app, &id));
app.run("type.superscript", json!({})).unwrap();
assert!(scripts(&app, &id).iter().all(|(_, p)| *p == "normal"), "{:?}", scripts(&app, &id));
// A file whose two superscript runs have different proportions.
app.select_tool("selection");
app.run("text.setRangeStyle", json!({"id": id, "position": "superscript"})).unwrap();
app.run("text.setRangeStyle", json!({"id": id, "start": 1, "end": 2, "underline": true})).unwrap();
let mut d = (*app.session.active().unwrap().doc).clone();
if let Some(NodeKind::Text(t)) = d.node_mut(NodeId(id.as_u64().unwrap())).map(|n| &mut n.kind) {
assert_eq!(t.runs.len(), 2);
t.runs[0].style.position = vectorcraft_doc::CharPosition::Superscript(vectorcraft_doc::ScriptMetrics { size: 50.0, position: 40.0 });
}
let data = vectorcraft_format::base64_encode(&vectorcraft_format::save_file(&d));
app.run("document.open", json!({"name": "scripts.vectorcraft", "dataBase64": data})).unwrap();
app.run("select.set", json!({"ids": [id.clone()]})).unwrap();
let runs = |app: &VectorcraftApp| match &app.session.active().unwrap().doc.node(NodeId(id.as_u64().unwrap())).unwrap().kind {
NodeKind::Text(t) => t.runs.iter().map(|r| r.style.position).collect::<Vec<_>>(),
_ => panic!("text"),
};
let before = runs(&app);
assert!(before.len() == 2 && before[0] != before[1] && before.iter().all(|p| p.id() == "superscript"), "{before:?}");
assert_eq!(script_buttons(&ctx, &mut app).1, [false, true, false], "the button shows superscript");
assert_eq!(app.run("type.superscript", json!({})).unwrap(), json!("normal"));
assert!(scripts(&app, &id).iter().all(|(_, p)| *p == "normal"), "{:?}", scripts(&app, &id));
}
/// With Real-time Drawing off, Superscript, Subscript and Underline decide from the text with the
/// typing applied: after a Backspace not yet applied takes out the one plain character, the rest
/// is all superscript (or underlined), so a press turns it off.
#[test]
fn superscript_and_underline_decide_from_the_text_with_the_typing_applied() {
for (command, set, off) in
[("type.superscript", json!({"position": "superscript"}), json!("normal")), ("type.underline", json!({"underline": true}), json!(false))]
{
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.run("file.new", json!({"width": 300, "height": 200})).unwrap();
app.session.execute("prefs.set", &json!({"key": "realTimeDrawing", "value": false})).unwrap();
let id = app.run("text.create", json!({"x": 20, "y": 50, "text": "x2", "size": 12})).unwrap()["id"].clone();
let mut range = set.clone();
range["id"] = id.clone();
range["start"] = json!(1);
range["end"] = json!(2);
app.run("text.setRangeStyle", range).unwrap();
app.run("select.set", json!({"ids": [id.clone()]})).unwrap();
app.select_tool("type");
app.session.apply_actions(vec![vectorcraft_tools::Action::Notify("text.editNew".into())]).unwrap();
app.session.set_tool_option("select", &json!({"start": 1, "end": 1}));
let ctx = egui::Context::default();
let backspace =
|pressed| egui::Event::Key { key: egui::Key::Backspace, physical_key: None, pressed, repeat: false, modifiers: Default::default() };
let raw = egui::RawInput { events: vec![backspace(true), backspace(false)], ..Default::default() };
ctx.run_ui(raw, |ui| crate::shortcuts::handle(&mut app, ui.ctx())).textures_delta.clear();
assert_eq!(app.session.tool_options()["typing"], json!(true), "{command}");
let node = |app: &VectorcraftApp| match &app.session.active().unwrap().doc.node(NodeId(id.as_u64().unwrap())).unwrap().kind {
NodeKind::Text(t) => (t.plain_text(), t.runs.iter().map(|r| (r.style.position.id(), r.style.underline)).collect::<Vec<_>>()),
_ => panic!("text"),
};
assert_eq!(node(&app).0, "x2", "{command}: the Backspace is not applied yet");
assert_eq!(app.run(command, json!({})).unwrap(), off, "{command}");
assert_eq!(node(&app), ("2".to_string(), vec![("normal", false)]), "{command}");
}
}
/// The panel menu's Small Caps, Superscript and Subscript set the selected type's small caps
/// and position and show a check mark when on; Superscript and Subscript turn each other off.
#[test]
+27 -6
View File
@@ -383,7 +383,8 @@ pub fn handle(app: &mut VectorcraftApp, ctx: &egui::Context) {
!(chord.is_plain() && types_text(chord.key) && !shifted_punctuation || row_key(chord) || gesture_escape(chord))
});
let ran = !hits.is_empty();
for c in hits {
for hit in hits {
let c = unshifted_when_dimmed(app, hit);
run_hit(app, ctx, &c);
if dialog_or_palette_open(app) {
break;
@@ -722,7 +723,8 @@ fn type_tool_input(app: &mut VectorcraftApp, ctx: &egui::Context, composing: boo
// cut or paste after a deferred pointer or navigation notice is dropped there). Only chords
// with the command key run commands: the rest type or edit.
let hits = dispatch(app, ctx, |hit| hit.trigger.chord.mods.cmd);
for c in hits {
for hit in hits {
let c = unshifted_when_dimmed(app, hit);
run_hit(app, ctx, &c);
if dialog_or_palette_open(app) {
break;
@@ -1017,8 +1019,9 @@ fn claimed_tool_keys(app: &mut VectorcraftApp, ctx: &egui::Context, view: ViewIn
}
/// Runs this frame's key presses against the keymap in effect; `accept` declines a hit, leaving
/// its press (and the text it typed) to what follows.
fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, accept: impl FnMut(&Hit) -> bool) -> Vec<CommandRef> {
/// its press (and the text it typed) to what follows. Each hit's command is worked out with
/// [`unshifted_when_dimmed`] just before it runs, after the commands of the presses before it.
fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, accept: impl FnMut(&Hit) -> bool) -> Vec<Hit> {
let mirror = crate::shortcut_editor::current();
let dispatcher = &mut app.dispatcher;
ctx.input_mut(|i| {
@@ -1050,7 +1053,7 @@ fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, accept: impl FnMut(&H
}
}
// Shift+`=` types `+`: as the Plus key it also reaches a `=` chord held with Shift
// (Cmd+Shift+= zooms in as Cmd+= does).
// (Cmd+Shift+= zooms in as Cmd+= does while Superscript is dimmed: [`unshifted_when_dimmed`]).
for e in &mut i.events {
if let egui::Event::Key { key, modifiers, .. } = e
&& *key == Key::Equals
@@ -1059,10 +1062,28 @@ fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, accept: impl FnMut(&H
*key = Key::Plus;
}
}
dispatcher.dispatch_filtered(i, &mirror.keymap, &Active::NONE, accept).into_iter().map(|h| h.command).collect()
dispatcher.dispatch_filtered(i, &mirror.keymap, &Active::NONE, accept)
})
}
/// The command a hit runs. A Shift+`=` chord whose command is dimmed runs what the same chord
/// without Shift runs, when that is bound: Cmd+Shift+= (Superscript) zooms in, as Cmd+= does,
/// while no type is selected.
fn unshifted_when_dimmed(app: &VectorcraftApp, hit: Hit) -> CommandRef {
let mirror = crate::shortcut_editor::current();
let chord = hit.trigger.chord;
if chord.key == craft_keymap::Key::Equals
&& chord.mods.shift
&& !hit.trigger.double
&& !crate::menus::enabled(app, &hit.command.id)
&& let Some(unshifted) =
crate::keymap::lookup(&mirror.keymap, &craft_keymap::Chord::new(craft_keymap::Mods { shift: false, ..chord.mods }, chord.key))
{
return unshifted;
}
hit.command
}
/// What a shortcut without params runs when its command's menu bar item gives params
/// ([`crate::shortcut_editor::menu_target_now`]): what a click on that item runs, or while the item
/// is dimmed, why the command can't run.
+75
View File
@@ -1093,6 +1093,81 @@ fn cmd_shift_u_and_cmd_alt_shift_c_and_h_toggle_type_formats() {
}
}
/// Cmd+Shift+= and Cmd+Alt+Shift+= do what the Character panel's Superscript and Subscript
/// buttons do; with no type selected, Cmd+Shift+= still zooms in, as Cmd+= does.
#[test]
fn cmd_shift_equals_and_cmd_alt_shift_equals_toggle_superscript_and_subscript() {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.session.execute("file.new", &json!({"width": 200, "height": 200})).unwrap();
let id = app.session.execute("text.create", &json!({"x": 20, "y": 50, "text": "One\nTwo"})).unwrap()["id"].as_u64().unwrap();
let positions = |app: &mut VectorcraftApp| {
let r = app.session.execute("text.getRange", &json!({"id": id})).unwrap();
// A superscript or subscript run reports its kind with its size and offset; a normal one
// reports no position.
let kind = |p: &serde_json::Value| if p.is_null() { json!("normal") } else { p.get("kind").unwrap_or(p).clone() };
r["runs"].as_array().unwrap().iter().map(|run| (run["text"].clone(), kind(&run["style"]["position"]))).collect::<Vec<_>>()
};
let zoom = |app: &mut VectorcraftApp| app.view_mut().unwrap().zoom;
let press =
|key, m: Modifiers| vec![egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::COMMAND | m }];
let (shift, alt_shift) = (Modifiers::SHIFT, Modifiers::ALT | Modifiers::SHIFT);
let all = |p: &str| [(json!("One\nTwo"), json!(p))];
app.session.execute("select.set", &json!({"ids": [id]})).unwrap();
let before = zoom(&mut app);
// Shift+`=` is reported as `=` or as `+`.
frame(&mut app, press(Key::Equals, shift));
assert_eq!(positions(&mut app), all("superscript"));
frame(&mut app, press(Key::Plus, shift));
assert_eq!(positions(&mut app), all("normal"), "a second press turns it off");
frame(&mut app, press(Key::Equals, alt_shift));
assert_eq!(positions(&mut app), all("subscript"));
frame(&mut app, press(Key::Equals, shift));
assert_eq!(positions(&mut app), all("superscript"), "superscript replaces subscript");
frame(&mut app, press(Key::Plus, alt_shift));
assert_eq!(positions(&mut app), all("subscript"));
frame(&mut app, press(Key::Equals, alt_shift));
assert_eq!(positions(&mut app), all("normal"));
assert_eq!(zoom(&mut app), before, "no press zoomed while type is selected");
frame(&mut app, press(Key::Equals, Modifiers::NONE));
assert!(zoom(&mut app) > before, "Cmd+= zooms in with type selected");
// While the Type tool edits: its selected text.
app.select_tool("type");
app.session.apply_actions(vec![vectorcraft_tools::Action::Notify("text.editNew".into())]).unwrap();
app.session.set_tool_option("select", &json!({"start": 4, "end": 7}));
assert!(app.session.tool_wants_text());
frame(&mut app, press(Key::Equals, alt_shift));
assert_eq!(positions(&mut app), [(json!("One\n"), json!("normal")), (json!("Two"), json!("subscript"))]);
// A mixed selection takes the position on every character.
app.select_tool("selection");
app.session.execute("select.set", &json!({"ids": [id]})).unwrap();
frame(&mut app, press(Key::Equals, alt_shift));
let subscript = |app: &mut VectorcraftApp| positions(app).iter().all(|(_, p)| *p == json!("subscript"));
assert!(subscript(&mut app), "{:?}", positions(&mut app));
// Nothing selected: Cmd+Shift+= zooms in, and Cmd+Alt+Shift+= changes nothing.
app.session.execute("select.none", &json!({})).unwrap();
for id in ["type.superscript", "type.subscript"] {
assert!(!crate::menus::enabled(&app, id), "{id}");
}
for key in [Key::Equals, Key::Plus] {
let before = zoom(&mut app);
frame(&mut app, press(key, alt_shift));
assert_eq!(zoom(&mut app), before, "{key:?} with Cmd+Alt+Shift");
frame(&mut app, press(key, shift));
assert!(zoom(&mut app) > before, "{key:?} with Cmd+Shift zooms in");
}
assert!(subscript(&mut app), "{:?}", positions(&mut app));
// Cmd+A and Cmd+Shift+= in one frame: Select All runs first, so Cmd+Shift+= applies
// Superscript to the text it selected instead of zooming in.
let before = zoom(&mut app);
frame(&mut app, [press(Key::A, Modifiers::NONE), press(Key::Equals, shift)].concat());
assert_eq!(zoom(&mut app), before, "no zoom once Select All selected the type");
// The earlier mixed selection left the text in two runs; check that both lines are still
// there and every run is superscript.
let runs = positions(&mut app);
assert_eq!(runs.iter().filter_map(|(t, _)| t.as_str()).collect::<String>(), "One\nTwo", "{runs:?}");
assert!(runs.iter().all(|(_, p)| *p == json!("superscript")), "{runs:?}");
}
/// Tab shows and hides the panels, and in the Type tool it types a tab, without moving the
/// keyboard focus on to a field: the keys after it (a tool letter, the next letter typed) still
/// work.
+8
View File
@@ -7805,6 +7805,14 @@ Guides off, this drag leaves a 70 × 50 and a 90 × 50 copy and the 110 × 70 re
in remote mode `press_key {key: "U", mods: {cmd: true, shift: true}}` or `invoke_menu`) does what the Character
panel's Underline button does: it underlines the Type tool's selected text or the selected type objects, or removes
the underline when the text the panel shows is underlined, and returns whether the text is now underlined.
`type.superscript` (Cmd+Shift+=, `press_key {key: "=", mods: {cmd: true, shift: true}}`) and `type.subscript`
(Cmd+Alt+Shift+=) do what the Character panel's Superscript and Subscript buttons do on the same text: they set its
position through `text.setFormat {position}`, or set it back to `"normal"` when every character already has that
position, and return the position the text now has. At a Type tool caret with no characters selected, the buttons and
both commands act on, and check, every character of the text; superscripts in different proportions count as
superscript. Without selected type or text the Type tool edits, both fail
and are dimmed, and Cmd+Shift+= zooms in, as Cmd+= does. In general, when the command a Shift+= chord is bound to is
dimmed, the press runs what the same chord without Shift is bound to.
- `missingGlyphProtection` (on by default): `text.setStyle` and `text.setRangeStyle` changing the font leave the
characters the new font has no glyph for in the font that had one.
- `typeSelectionByPathOnly` (off by default): on, the Selection tools (`pointer_gesture` with `selection`, and the
+1
View File
@@ -1260,6 +1260,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- F8 (`ui.symbolOptions`) opens Symbol Options for a new symbol made from the selection, as the Symbols panel's New Symbol button does, on the key the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists for making a new symbol. OK makes the symbol and puts an instance of it in place of the art, and Cancel makes none. With nothing selected, F8 opens no dialog, and the status bar says that nothing is selected. Shift+F8 and Cmd/Ctrl+F8 still show the Transform and Info panels.
- Cmd/Ctrl+Shift+X (`type.resetHorizontalScale`) sets the horizontal scale of the selected type, or of the text the Type tool has selected, to 100% as the Character panel shows it (the object's own stretch included), in one undo step; at a caret it leaves the text as it is.
- Cmd/Ctrl+Shift+U (`type.underline`) underlines the selected type, or the text the Type tool has selected, and removes the underline again, as the Character panel's Underline button does. Cmd/Ctrl+Alt+Shift+C (`type.lineComposer`) switches the paragraphs between the Single-line and the Every-line Composer, and Cmd/Ctrl+Alt+Shift+H (`type.hyphenate`) turns their hyphenation on and off, as the Hyphenate checkbox does. These are the keys the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists for underlining and for toggling auto-hyphenation, and on Windows for toggling the line composer. The page's macOS key for the line composer ends after Command, and VectorCraft uses C there as well.
- Cmd/Ctrl+Shift+= (`type.superscript`) and Cmd/Ctrl+Alt+Shift+= (`type.subscript`) make the selected type, or the text the Type tool has selected, superscript or subscript, and set it back to normal when all of it already has that position, as the Character panel's Superscript and Subscript buttons do. [The help page](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) gives Shift with Ctrl or Command and `=` for Superscript and adds Alt for Subscript; its macOS cell for Subscript repeats the Windows modifier names, and VectorCraft uses Command there. With no type selected, Cmd/Ctrl+Shift+= still zooms in as Cmd/Ctrl+= does; that rule, the second press restoring normal, and a mixed selection taking the position throughout are VectorCraft's own.
- Cmd/Ctrl+Alt+N (`file.newWithoutDialog`) makes a document without opening the New Document dialog, on the key the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page assigns to creating a document directly. The page does not say which settings the document gets. VectorCraft gives it the settings the dialog opens on (the first Recent entry, or the Print category's Letter while Recent is empty) and the next untitled name.
- Cmd/Ctrl+F6 (`window.nextDocument`) and Cmd/Ctrl+Shift+F6 (`window.previousDocument`) make the next and the previous open document the current one, in tab order and as a click on its tab does, on the keys the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists for navigating to the next and the previous document. After the last document comes the first, and before the first document comes the last. From the Home screen the keys go to the first and the last document. Keyboard Shortcuts lists both under Window.
- Cmd/Ctrl+Alt+Shift+U (`document.switchUnits`) switches the document to the next unit of measurement, in one undo step, on the key the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists for switching units of measurement. The page does not give an order. VectorCraft steps through the units in the order a right-click on a ruler lists them (Points, Picas, Inches, Millimeters, Centimeters, Pixels, Feet & Inches, Meters, Yards, Feet) and goes from Feet back to Points.