From ad1e8d11122a669757570059b00497a64bc04235 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 16 Oct 2026 00:15:18 -0700 Subject: [PATCH] Type: Cmd/Ctrl+Alt+Shift+. and , step the font size by five increments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No command held Cmd/Ctrl+Alt+Shift+. and Cmd/Ctrl+Alt+Shift+,, so the chords reached Increase and Decrease Font Size (Cmd/Ctrl+Shift+. and ,) and changed the size by one Size/Leading increment. Two commands, type.size.increaseByFive and type.size.decreaseByFive, now hold the chords. They step the font size of the selected type, or of the text the Type tool has selected, by five times the Size/Leading increment (Preferences › Type). Agents reach them with press_key too. Their labels have rows in every complete catalog. Docs: docs/mcp.md, docs/target-app-parity.md. --- crates/engine/src/cmd/textedit.rs | 18 +++++++++++++++++ crates/engine/src/tests_prefs.rs | 27 ++++++++++++++++++++++++++ crates/mcp/src/tests.rs | 24 +++++++++++++++++++++++ crates/ui-egui/src/i18n/bg.tsv | 2 ++ crates/ui-egui/src/i18n/cs.tsv | 2 ++ crates/ui-egui/src/i18n/de.tsv | 2 ++ crates/ui-egui/src/i18n/el.tsv | 2 ++ crates/ui-egui/src/i18n/es.tsv | 2 ++ crates/ui-egui/src/i18n/fi.tsv | 2 ++ crates/ui-egui/src/i18n/fr.tsv | 2 ++ crates/ui-egui/src/i18n/hu.tsv | 2 ++ crates/ui-egui/src/i18n/it.tsv | 2 ++ crates/ui-egui/src/i18n/ja.tsv | 2 ++ crates/ui-egui/src/i18n/ko.tsv | 2 ++ crates/ui-egui/src/i18n/pl.tsv | 2 ++ crates/ui-egui/src/i18n/pt-br.tsv | 2 ++ crates/ui-egui/src/i18n/ru.tsv | 2 ++ crates/ui-egui/src/i18n/sv.tsv | 2 ++ crates/ui-egui/src/i18n/uk.tsv | 2 ++ crates/ui-egui/src/i18n/vi.tsv | 2 ++ crates/ui-egui/src/i18n/zh-hans.tsv | 2 ++ crates/ui-egui/src/i18n/zh-hant.tsv | 2 ++ crates/ui-egui/src/shortcuts.rs | 30 +++++++++++++++++++++++++++++ docs/mcp.md | 4 +++- docs/target-app-parity.md | 1 + 25 files changed, 141 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/textedit.rs b/crates/engine/src/cmd/textedit.rs index c113344c6..879e75e90 100644 --- a/crates/engine/src/cmd/textedit.rs +++ b/crates/engine/src/cmd/textedit.rs @@ -85,6 +85,24 @@ pub fn specs() -> Vec { has_selection, |s, p| type_step(s, &json!({"attribute": "size", "by": -f64_or(p, "by", 1.0)})) ), + cmd!( + "type.size.increaseByFive", + "Increase Font Size by Five Steps", + [], + Some("Cmd+Alt+Shift+."), + "{} type.step {attribute: size, by: 5}: five times the Size/Leading increment (typeSizeIncrement)", + has_selection, + |s, _| type_step(s, &json!({"attribute": "size", "by": 5.0})) + ), + cmd!( + "type.size.decreaseByFive", + "Decrease Font Size by Five Steps", + [], + Some("Cmd+Alt+Shift+,"), + "{} type.step {attribute: size, by: -5}: five times the Size/Leading increment (typeSizeIncrement)", + has_selection, + |s, _| type_step(s, &json!({"attribute": "size", "by": -5.0})) + ), cmd!( "type.resetTracking", "Reset Tracking and Kerning", diff --git a/crates/engine/src/tests_prefs.rs b/crates/engine/src/tests_prefs.rs index f789e8f12..0ed460cae 100644 --- a/crates/engine/src/tests_prefs.rs +++ b/crates/engine/src/tests_prefs.rs @@ -1024,6 +1024,33 @@ fn type_increments_step_the_type() { assert_eq!((style_at(&s, id, 0).size, style_at(&s, id, 6).size), (22.0, 25.0)); } +/// Cmd/Ctrl+Alt+Shift+. and , step the font size by five times the Size/Leading increment, on +/// the selected type objects and on the Type tool's selected text. +#[test] +fn font_size_steps_by_five_increments() { + use vectorcraft_tools::PointerKind::{Down, Up}; + let mut s = new_doc(); + let id = NodeId(s.execute("text.create", &json!({"x": 100, "y": 100, "text": "Hello world", "size": 12})).unwrap()["id"].as_u64().unwrap()); + s.execute("select.set", &json!({"ids": [id.0]})).unwrap(); + assert_eq!(find_command("type.size.increaseByFive").unwrap().shortcut, Some("Cmd+Alt+Shift+.")); + assert_eq!(find_command("type.size.decreaseByFive").unwrap().shortcut, Some("Cmd+Alt+Shift+,")); + s.execute("type.size.increaseByFive", &json!({})).unwrap(); + assert_eq!(style_at(&s, id, 0).size, 22.0, "five steps of the 2 pt Size/Leading increment"); + s.execute("type.size.decreaseByFive", &json!({})).unwrap(); + assert_eq!(style_at(&s, id, 0).size, 12.0); + set_pref(&mut s, "typeSizeIncrement", json!(3)); + s.execute("type.size.increaseByFive", &json!({})).unwrap(); + assert_eq!(style_at(&s, id, 10).size, 27.0, "the step follows the preference"); + // While the Type tool edits, only its selected text steps. + let v = ViewInfo::default(); + s.select_tool("type", v).unwrap(); + gesture(&mut s, v, &[(Down, 102.0, 95.0), (Up, 102.0, 95.0)]); + assert_eq!(s.tool_options()["editing"], json!(id.0), "editing the text"); + s.set_tool_option("select", &json!({"start": 6, "end": 11})); + s.execute("type.size.decreaseByFive", &json!({})).unwrap(); + assert_eq!((style_at(&s, id, 0).size, style_at(&s, id, 6).size), (27.0, 12.0)); +} + /// Cmd/Ctrl+Alt+Q resets tracking to 0 and kerning to Auto (0 in the Character panel) in every /// selected type object and in the Type tool's selected text. At a caret it resets only the /// kerning of the character before it. It is one undo step. Type objects given in `ids` are reset diff --git a/crates/mcp/src/tests.rs b/crates/mcp/src/tests.rs index 5ac7ea542..552136fd4 100644 --- a/crates/mcp/src/tests.rs +++ b/crates/mcp/src/tests.rs @@ -1076,6 +1076,30 @@ fn type_preferences_apply_to_agents() { assert_eq!(style(&mut s, 6), (size + 4.0, tracking + 50.0)); } +/// Cmd+Alt+Shift+. and , reach agents: the placeholder text the Type tool selects steps by five +/// times the Size/Leading increment (2 pt by default) and back. +#[test] +fn cmd_alt_shift_period_steps_the_font_size_by_five_for_agents() { + let mut s = server(); + let events = json!([{"kind": "down", "x": 100, "y": 100}, {"kind": "up", "x": 100, "y": 100}]); + let r = call(&mut s, 1, "pointer_gesture", json!({"tool": "type", "events": events})); + assert_eq!(r["isError"], false, "{r}"); + let id = serde_json::from_str::(&text_of(&r)).unwrap()["selection"][0].as_u64().unwrap(); + let r = call(&mut s, 2, "run_command", json!({"command": "text.setRangeStyle", "params": {"id": id, "size": 12}})); + assert_eq!(r["isError"], false, "{r}"); + let size = |s: &mut Server, n| { + let r = call(s, n, "run_command", json!({"command": "text.getRange", "params": {"id": id, "effective": true}})); + serde_json::from_str::(&text_of(&r)).unwrap()["runs"][0]["style"]["size"].clone() + }; + let r = call(&mut s, 3, "press_key", json!({"key": ".", "mods": {"cmd": true, "alt": true, "shift": true}})); + assert_eq!(r["isError"], false, "{r}"); + assert_eq!(serde_json::from_str::(&text_of(&r)).unwrap()["command"], "type.size.increaseByFive", "{r}"); + assert_eq!(size(&mut s, 4), json!(22.0)); + let r = call(&mut s, 5, "press_key", json!({"key": ",", "mods": {"cmd": true, "alt": true, "shift": true}})); + assert_eq!(serde_json::from_str::(&text_of(&r)).unwrap()["command"], "type.size.decreaseByFive", "{r}"); + assert_eq!(size(&mut s, 6), json!(12.0)); +} + /// Cmd+Alt+Q reaches agents: the placeholder text the Type tool selects goes back to tracking 0 /// and Auto kerning. #[test] diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index fb41d32da..2583ea959 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -1046,7 +1046,9 @@ Fit dashes to corners and ends Напасване на тиретата към ъглите и краищата Fit Headline Напасване на заглавие Decrease Font Size Намаляване размера на шрифта + Decrease Font Size by Five Steps Намаляване размера на шрифта с пет стъпки Increase Font Size Увеличаване размера на шрифта + Increase Font Size by Five Steps Увеличаване размера на шрифта с пет стъпки Spacing Разстояние Step Type Тип стъпка Fit in View Побиране в изгледа diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index e38040e84..86794d785 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -3481,7 +3481,9 @@ axis Both Obě Duplicate Artboard Duplikovat pracovní plochu Area / Path Type Text v oblasti / na cestě Decrease Font Size Zmenšit velikost písma + Decrease Font Size by Five Steps Zmenšit velikost písma o pět kroků Increase Font Size Zvětšit velikost písma + Increase Font Size by Five Steps Zvětšit velikost písma o pět kroků Reset Tracking and Kerning Obnovit prostrkání a vyrovnání párů Step Type Krokovat text Get Text Range Získat rozsah textu diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 5b331c7cb..09dd23f52 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1051,7 +1051,9 @@ Fit dashes to corners and ends Striche an Ecken und Enden anpassen Fit Headline Überschrift einpassen Decrease Font Size Schriftgrad verringern + Decrease Font Size by Five Steps Schriftgrad um fünf Schritte verringern Increase Font Size Schriftgrad erhöhen + Increase Font Size by Five Steps Schriftgrad um fünf Schritte erhöhen Reset Tracking and Kerning Laufweite und Kerning zurücksetzen Spacing Abstand Step Type Text schrittweise ändern diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 307a3903b..45fe554f2 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -1012,7 +1012,9 @@ Fit dashes to corners and ends Προσαρμογή παυλών σε γωνίες και άκρα Fit Headline Προσαρμογή επικεφαλίδας Decrease Font Size Μείωση μεγέθους γραμματοσειράς + Decrease Font Size by Five Steps Μείωση μεγέθους γραμματοσειράς κατά πέντε βήματα Increase Font Size Αύξηση μεγέθους γραμματοσειράς + Increase Font Size by Five Steps Αύξηση μεγέθους γραμματοσειράς κατά πέντε βήματα Spacing Διάστημα Step Type Σταδιακό κείμενο Fit in View Προσαρμογή στην προβολή diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index d8cbe0823..a4126fab1 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1068,7 +1068,9 @@ Fit dashes to corners and ends Ajustar guiones a esquinas y extremos Fit Headline Ajustar titular Decrease Font Size Reducir tamaño de fuente + Decrease Font Size by Five Steps Reducir tamaño de fuente en cinco incrementos Increase Font Size Aumentar tamaño de fuente + Increase Font Size by Five Steps Aumentar tamaño de fuente en cinco incrementos Reset Tracking and Kerning Restablecer espaciado e interletraje Spacing Espaciado Step Type Ajustar texto por incrementos diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index c65a04353..ab1738b33 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -3417,7 +3417,9 @@ axis Both Molemmat Duplicate Artboard Monista piirtoalusta Area / Path Type Alue- / polkuteksti Decrease Font Size Pienennä fonttikokoa + Decrease Font Size by Five Steps Pienennä fonttikokoa viisi askelta Increase Font Size Suurenna fonttikokoa + Increase Font Size by Five Steps Suurenna fonttikokoa viisi askelta Step Type Porrasta teksti Get Text Range Hae tekstialue Punctuation Välimerkit diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index a49edfcf8..235330013 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1067,7 +1067,9 @@ Fit dashes to corners and ends Ajuster les tirets aux angles et aux extrémités Fit Headline Ajuster le titre Decrease Font Size Réduire la taille de police + Decrease Font Size by Five Steps Réduire la taille de police de cinq incréments Increase Font Size Augmenter la taille de police + Increase Font Size by Five Steps Augmenter la taille de police de cinq incréments Reset Tracking and Kerning Réinitialiser l’approche et le crénage Spacing Espacement Step Type Texte par incréments diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 86542f5ca..602d502d7 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -884,6 +884,7 @@ Decimal: Tizedesjegyek: Decorative Díszítő Decrease Font Size Betűméret csökkentése + Decrease Font Size by Five Steps Betűméret csökkentése öt lépéssel Default Alapértelmezett Default Actions Alapértelmezett műveletek Default Figure Alapértelmezett számjegyek @@ -1717,6 +1718,7 @@ Include Swatches for Tints Tónusok színmintáinak felvétele Include tagged source profiles Címkézett forrásprofilok beágyazása Increase Font Size Betűméret növelése + Increase Font Size by Five Steps Betűméret növelése öt lépéssel Inflate… Felfújás… Info Infó Ink Festék diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 6d6984968..0662b14f6 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1067,7 +1067,9 @@ Fit dashes to corners and ends Adatta i trattini ad angoli ed estremità Fit Headline Adatta titolo Decrease Font Size Riduci dimensione font + Decrease Font Size by Five Steps Riduci dimensione font di cinque incrementi Increase Font Size Aumenta dimensione font + Increase Font Size by Five Steps Aumenta dimensione font di cinque incrementi Reset Tracking and Kerning Reimposta spaziatura caratteri e crenatura Spacing Spaziatura Step Type Dimensione testo a incrementi diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 461a1aa4c..84dfaece0 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -328,7 +328,9 @@ Remove Threading スレッドを解除 Fit Headline ヘッドラインを合わせる Decrease Font Size フォントサイズを小さく + Decrease Font Size by Five Steps フォントサイズを5段階小さく Increase Font Size フォントサイズを大きく + Increase Font Size by Five Steps フォントサイズを5段階大きく Reset Tracking and Kerning トラッキングとカーニングをリセット Step Type 文字を段階的に調整 Find Font… フォントの検索と置換… diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index b5fff56d9..9eb89a47e 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -324,7 +324,9 @@ Remove Threading 연결 제거 Fit Headline 제목에 맞추기 Decrease Font Size 글꼴 크기 줄이기 + Decrease Font Size by Five Steps 글꼴 크기 5단계 줄이기 Increase Font Size 글꼴 크기 키우기 + Increase Font Size by Five Steps 글꼴 크기 5단계 키우기 Reset Tracking and Kerning 자간 및 커닝 재설정 Step Type 단계별 문자 Find Font… 글꼴 찾기… diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 4bb175066..4c4cb4f1d 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -3314,7 +3314,9 @@ axis Both Obie Duplicate Artboard Powiel obszar kompozycji Area / Path Type Tekst akapitowy / na ścieżce Decrease Font Size Zmniejsz rozmiar czcionki + Decrease Font Size by Five Steps Zmniejsz rozmiar czcionki o pięć kroków Increase Font Size Zwiększ rozmiar czcionki + Increase Font Size by Five Steps Zwiększ rozmiar czcionki o pięć kroków Reset Tracking and Kerning Resetuj światło i kerning Step Type Krok tekstu Get Text Range Pobierz zakres tekstu diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 8109e8982..79bc524de 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -948,7 +948,9 @@ Fit Artboard in Window Ajustar Mesa de Trabalho na Janela Fit Headline Ajustar Manchete Decrease Font Size Diminuir Tamanho da Fonte + Decrease Font Size by Five Steps Diminuir Tamanho da Fonte em Cinco Incrementos Increase Font Size Aumentar Tamanho da Fonte + Increase Font Size by Five Steps Aumentar Tamanho da Fonte em Cinco Incrementos Reset Tracking and Kerning Redefinir Rastreamento e Kerning Step Type Ajustar Texto em Incrementos Fit dashes to corners and ends Ajustar tracejados aos cantos e extremidades diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 8a59b3cc6..b6f14c967 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1065,7 +1065,9 @@ Fit dashes to corners and ends Подгонять штрихи к углам и концам Fit Headline Подогнать заголовок Decrease Font Size Уменьшить размер шрифта + Decrease Font Size by Five Steps Уменьшить размер шрифта на пять шагов Increase Font Size Увеличить размер шрифта + Increase Font Size by Five Steps Увеличить размер шрифта на пять шагов Reset Tracking and Kerning Сбросить трекинг и кернинг Spacing Интервал Step Type Подгонять текст по шагам diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index ec14d04c5..228db52f4 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1048,7 +1048,9 @@ Fit dashes to corners and ends Anpassa streck till hörn och ändar Fit Headline Anpassa rubrik Decrease Font Size Minska teckenstorleken + Decrease Font Size by Five Steps Minska teckenstorleken fem steg Increase Font Size Öka teckenstorleken + Increase Font Size by Five Steps Öka teckenstorleken fem steg Spacing Avstånd Step Type Stegtyp Fit in View Anpassa till vyn diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 2d8aeea1a..b1f7a34b6 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1061,7 +1061,9 @@ Fit dashes to corners and ends Підганяти штрихи до кутів та кінців Fit Headline Підігнати заголовок Decrease Font Size Зменшити розмір шрифту + Decrease Font Size by Five Steps Зменшити розмір шрифту на п’ять кроків Increase Font Size Збільшити розмір шрифту + Increase Font Size by Five Steps Збільшити розмір шрифту на п’ять кроків Reset Tracking and Kerning Скинути трекінг і кернінг Spacing Інтервал Step Type Підганяти текст кроками diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 2a6c5b885..e4bec9dff 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -781,6 +781,7 @@ Decimal: Thập phân: Decorative Trang trí Decrease Font Size Giảm cỡ chữ + Decrease Font Size by Five Steps Giảm cỡ chữ năm bước Default Mặc định Default Actions Hành động mặc định Default Figure Chữ số mặc định @@ -1579,6 +1580,7 @@ Include SVG Code Bao gồm mã SVG Include Swatches for Tints Bao gồm mẫu màu cho sắc pha Increase Font Size Tăng cỡ chữ + Increase Font Size by Five Steps Tăng cỡ chữ năm bước Inflate… Phình… Info Thông tin Ink Mực diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 5e5f4b5e7..a39e1af81 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1016,7 +1016,9 @@ Fit dashes to corners and ends 让虚线贴合转角与端点 Fit Headline 适合标题 Decrease Font Size 减小字体大小 + Decrease Font Size by Five Steps 按五个增量减小字体大小 Increase Font Size 增大字体大小 + Increase Font Size by Five Steps 按五个增量增大字体大小 Reset Tracking and Kerning 重置字距和字偶距 Spacing 间距 Step Type 按增量调整文字 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 3597302f1..4ce18df1c 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1039,7 +1039,9 @@ Fit dashes to corners and ends 讓虛線貼合轉角與端點 Fit Headline 符合標題 Decrease Font Size 縮小字體大小 + Decrease Font Size by Five Steps 按五個增量縮小字體大小 Increase Font Size 放大字體大小 + Increase Font Size by Five Steps 按五個增量放大字體大小 Reset Tracking and Kerning 重設字距與字距微調 Spacing 間距 Step Type 依增量調整文字 diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 4cd8ecea8..0163eb7d7 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -1163,6 +1163,36 @@ mod tests { assert_eq!(app.session.tool_id(), "curvature"); } + /// Cmd/Ctrl+Alt+Shift+. and , step the font size by five Size/Leading increments, and + /// Cmd/Ctrl+Shift+. still steps it by one: the chord with Alt does not reach the one-step + /// command. + #[test] + fn cmd_alt_shift_period_and_comma_step_the_font_size_by_five() { + 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 Two", "size": 12})).unwrap()["id"].as_u64().unwrap(); + let sizes = |app: &mut VectorcraftApp| { + let r = app.session.execute("text.getRange", &json!({"id": id})).unwrap(); + r["runs"].as_array().unwrap().iter().map(|run| (run["text"].clone(), run["style"]["size"].clone())).collect::>() + }; + let press = |key, modifiers| egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers }; + let five = Modifiers::COMMAND | Modifiers::ALT | Modifiers::SHIFT; + app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); + frame(&mut app, vec![press(Key::Period, five)]); + assert_eq!(sizes(&mut app), [(json!("One Two"), json!(22.0))]); + frame(&mut app, vec![press(Key::Period, Modifiers::COMMAND | Modifiers::SHIFT)]); + assert_eq!(sizes(&mut app), [(json!("One Two"), json!(24.0))], "one step"); + frame(&mut app, vec![press(Key::Comma, five)]); + assert_eq!(sizes(&mut app), [(json!("One Two"), json!(14.0))]); + // While the Type tool edits: only its selection. + 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, vec![press(Key::Period, five)]); + assert_eq!(sizes(&mut app), [(json!("One "), json!(14.0)), (json!("Two"), json!(24.0))]); + } + /// #793: with a layout without Latin letters the one-key shortcuts go by the key's position: /// the P key typing Persian `ح` chooses the Pen, the V key typing Russian `м` the Selection /// tool. A Latin layout keeps the letter typed: AZERTY's A (the Q key's place) is A. diff --git a/docs/mcp.md b/docs/mcp.md index 1db7301ef..09254c861 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2019,7 +2019,9 @@ Pen's second anchor at (150, 431), in line with the square's centre. - `typeSizeIncrement`, `trackingIncrement`, `baselineShiftIncrement`: what `type.step {attribute: "size" | "leading" | "tracking" | "kerning" | "baselineShift", by?}` steps by, on the text range given, the type objects in `ids`, the Type tool's selected text or the selected type objects. `type.size.increase` / `type.size.decrease` (Cmd+Shift+. and - Cmd+Shift+,) step the size; the Type tool's Alt+arrows (`press_key {key: "Right", mods: {alt: true}}`) step kerning at + Cmd+Shift+,) step the size. `type.size.increaseByFive` (Cmd+Alt+Shift+., `press_key {key: ".", mods: {cmd: true, + alt: true, shift: true}}`) and `type.size.decreaseByFive` (Cmd+Alt+Shift+,) step it by five times `typeSizeIncrement`. + The Type tool's Alt+arrows (`press_key {key: "Right", mods: {alt: true}}`) step kerning at a caret or tracking of the selection (←/→), leading (↑/↓) and baseline shift (Shift+↑/↓), five steps with Cmd/Ctrl too. `type.resetTracking` (Cmd+Alt+Q, `press_key {key: "Q", mods: {cmd: true, alt: true}}`) sets tracking to 0 and kerning to Auto in the type objects in `ids`, the Type tool's selected text or the selected type objects; at a caret diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 1448e43a5..bd8f70d90 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -450,6 +450,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Shift+Tab (`window.panels`) shows and hides the dock and the floating panels and leaves the toolbar and the Control bar as they are; hiding the panels with Tab or Shift+Tab also closes a panel popped out of the icon column. - The second Tab (`window.dock`) shows again only the bars the first Tab hid, after a restart too: a Control bar that was off stays off, a toolbar hidden with Window › Tools stays hidden, and panels shown with Shift+Tab in between stay shown. - Cmd/Ctrl+A follows the keyboard: in a panel, dialog or search field it selects the field's text, while the Type tool edits it selects all of that text (also `select.all` over MCP), and only otherwise every object. On macOS the menu bar's Select All, Cut, Copy and Paste (keys or clicks) act on a focused field too, and elsewhere the in-window menus' do: the field that had the keyboard when the menu opened gets them, with its selection, and the keyboard back (#516). Not yet: Select All across threaded frames (one frame's text is selected). + - Cmd/Ctrl+Alt+Shift+. and , (`type.size.increaseByFive`, `type.size.decreaseByFive`) step the font size of the selected type, or of the text the Type tool has selected, by five times the Size/Leading increment (Preferences › Type); Cmd/Ctrl+Shift+. and , still step it by one increment. - Cmd/Ctrl+Alt+Q (`type.resetTracking`) sets the tracking of the selected type, or of the text the Type tool has selected, to 0 and its kerning to Auto (0 in the Character panel), in one undo step; at a caret it resets the kerning of the character before it. - Shortcut sets other apps save as text (`.kys`) open in Import Shortcut Set from File › Open, from Edit › Keyboard Shortcuts › Import… in the desktop app, or from a drop on the window. It matches each entry to a tool, command or panel by name and decodes the file's key and modifier codes where VectorCraft's default shortcuts agree on them; the user answers the rest, and Apply fills the Keyboard Shortcuts dialog's working set. The answers are kept with the preferences for the next import (`shortcutSet.read`, `importMatches.*`). - On Windows and Linux the app bar is the window's title bar (its own minimize, maximize and close buttons, drag to move, edges to resize), with the dragon app icon as the brand mark; dialogs and menus size to their content. As on a native menu bar, once one menu is open, moving the pointer onto another title opens that one.