diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 0e3d6df203..e3b924a9a6 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -376,6 +376,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "Cmd+Alt+Shift+F", "{} show the Character panel if it is hidden and open its font family menu, whose search field takes the keyboard focus: type to search, Enter applies the highlighted font → {field: \"fontName\"}. Without selected type (or text the Type tool edits) the panel shows, and the error says to select type first", ), + ( + "type.highlightFontSize", + "Highlight Font Size", + "", + "{} (Type › Size › Other…) show the Character panel if it is hidden and give its Font Size field the keyboard focus with its value selected (blank where the selected sizes differ): type a size and press Enter → {field: \"fontSize\"}. Without selected type (or text the Type tool edits) the panel shows, and the error says to select type first", + ), ( "type.highlightKerning", "Highlight Kerning", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 71e443a399..b79c6978d9 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -5936,6 +5936,8 @@ theme Appearance Външен вид Reset Tracking and Kerning Нулиране на разредката и кернинга Reset Horizontal Scale Нулиране на хоризонталния мащаб Highlight Font Name Маркиране на името на шрифта + Highlight Font Size Маркиране на размера на шрифта + Other… Друг… Highlight Kerning Маркиране на кернинга Highlight Tracking Маркиране на разредката @msg span must be "object" or "selection", got {v} span трябва да е "object" или "selection", а не {v} diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 883d6dd387..29637c6903 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4249,6 +4249,8 @@ axis Both Obje Reset Tracking and Kerning Vrati razmak slova i podrezivanje na početno Reset Horizontal Scale Vrati vodoravnu skalu na početno Highlight Font Name Istakni naziv fonta + Highlight Font Size Istakni veličinu fonta + Other… Druga… Highlight Kerning Istakni podrezivanje Highlight Tracking Istakni razmak slova Step Type Vrsta koraka diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index a8a63cbf55..492faa37b1 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1809,6 +1809,8 @@ digits Malayalam Malaiàlam Clear Similar Fonts Esborra els tipus de lletra semblants Font Preview Size Mida de previsualització del tipus de lletra Font Size Mida del tipus de lletra + Highlight Font Size Ressalta la mida del tipus de lletra + Other… Una altra… Font Style: Estil de tipus de lletra: Font Technology Tecnologia del tipus de lletra Font: Tipus de lletra: diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 569b1347ec..4f2bb4a42c 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4354,6 +4354,8 @@ axis Both Obě Reset Tracking and Kerning Obnovit prostrkání a vyrovnání párů Reset Horizontal Scale Obnovit vodorovnou změnu velikosti Highlight Font Name Zvýraznit název písma + Highlight Font Size Zvýraznit velikost písma + Other… Jiná… Highlight Kerning Zvýraznit vyrovnání párů Highlight Tracking Zvýraznit prostrkání Step Type Krokovat text diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 4578e4efc1..4317afe913 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -8409,6 +8409,8 @@ mark-style Japanese Japansk Reset Tracking and Kerning Nulstil sporing og kerning Reset Horizontal Scale Nulstil vandret skalering Highlight Font Name Fremhæv skrifttypenavn + Highlight Font Size Fremhæv skriftstørrelse + Other… Anden… Highlight Kerning Fremhæv kerning Highlight Tracking Fremhæv sporing @msg span must be "object" or "selection", got {v} span skal være "object" eller "selection", fik {v} diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index c943c89dd2..69e72b9ae8 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1272,6 +1272,8 @@ font-technology Variable Variabel Reset Tracking and Kerning Laufweite und Kerning zurücksetzen Reset Horizontal Scale Horizontale Skalierung zurücksetzen Highlight Font Name Schriftname hervorheben + Highlight Font Size Schriftgrad hervorheben + Other… Andere… Highlight Kerning Kerning hervorheben Highlight Tracking Laufweite hervorheben Spacing Abstand diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 906640aa0a..70fc1207d5 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -6310,6 +6310,8 @@ effect Points Σημεία Reset Horizontal Scale Επαναφορά οριζόντιας κλίμακας Reset Tracking and Kerning Επαναφορά απόστασης χαρακτήρων και διαγραμμάτωσης Highlight Font Name Επισήμανση ονόματος γραμματοσειράς + Highlight Font Size Επισήμανση μεγέθους γραμματοσειράς + Other… Άλλο… Highlight Kerning Επισήμανση διαγραμμάτωσης Highlight Tracking Επισήμανση απόστασης χαρακτήρων Sample Color from Screen Δειγματοληψία χρώματος από την οθόνη diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 9239c93a73..5deae11eea 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1299,6 +1299,8 @@ font-technology Variable Variables Reset Tracking and Kerning Restablecer espaciado e interletraje Reset Horizontal Scale Restablecer escala horizontal Highlight Font Name Resaltar nombre de fuente + Highlight Font Size Resaltar tamaño de fuente + Other… Otro… Highlight Kerning Resaltar interletraje Highlight Tracking Resaltar espaciado Spacing Espaciado diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 423703e5c1..0517937c8e 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6320,6 +6320,8 @@ mark-style Japanese Japanilainen Reset Horizontal Scale Palauta vaakaskaalaus Reset Tracking and Kerning Palauta merkkiväli ja parivälistys Highlight Font Name Korosta fontin nimi + Highlight Font Size Korosta fonttikoko + Other… Muu… Highlight Kerning Korosta parivälistys Highlight Tracking Korosta merkkiväli Sample Color from Screen Poimi väri näytöltä diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 1cff1c8ad0..ed8ea9aaa7 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1289,6 +1289,8 @@ font-technology Variable Variables Reset Tracking and Kerning Réinitialiser l’approche et le crénage Reset Horizontal Scale Réinitialiser la mise à l’échelle horizontale Highlight Font Name Surligner le nom de la police + Highlight Font Size Surligner la taille de police + Other… Autre… Highlight Kerning Surligner le crénage Highlight Tracking Surligner l’approche Spacing Espacement diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 4eed343e3d..44c8b4ae8f 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -1691,6 +1691,8 @@ Highlight Alternate Glyphs વૈકલ્પિક ગ્લિફ હાઇલાઇટ કરો Highlight Area વિસ્તાર હાઇલાઇટ કરો Highlight Font Name ફોન્ટનું નામ હાઇલાઇટ કરો + Highlight Font Size ફોન્ટ સાઇઝ હાઇલાઇટ કરો + Other… અન્ય… Highlight Intensity હાઇલાઇટ તીવ્રતા Highlight Kerning કર્નિંગ હાઇલાઇટ કરો Highlight Rows પંક્તિઓ હાઇલાઇટ કરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index de33cdbd92..2593a22075 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -2328,6 +2328,8 @@ antiAlias Sharp शार्प Highlight anchors on mouse over माउस ओवर पर हाइलाइट एंकर Highlight Area हाइलाइट क्षेत्र Highlight Font Name हाइलाइट फ़ॉन्ट नाम + Highlight Font Size हाइलाइट फ़ॉन्ट साइज़ + Other… अन्य… Highlight Kerning हाइलाइट कर्निंग Highlight Rows हाइलाइट पंक्तियाँ Highlight Substituted Fonts हाईलाइट सबस्टिट्यूटेड फ़ॉन्ट diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index f869e7d07b..9146f7429f 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3611,6 +3611,8 @@ mark-style Japanese Japán Reset Tracing Tracing visszaállítása Reset Tracking and Kerning Betűköz és alávágás visszaállítása Highlight Font Name Betűtípusnév kiemelése + Highlight Font Size Betűméret kiemelése + Other… Egyéb… Highlight Kerning Alávágás kiemelése Highlight Tracking Betűköz kiemelése Reset Typography Typography visszaállítása diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index c5f865e69b..19579dd31f 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -5681,6 +5681,8 @@ mark-style Japanese Jepang Reset Tracking and Kerning Atur ulang tracking dan kerning Reset Horizontal Scale Atur ulang skala horizontal Highlight Font Name Sorot nama font + Highlight Font Size Sorot ukuran font + Other… Lainnya… Highlight Kerning Sorot kerning Highlight Tracking Sorot tracking @msg span must be "object" or "selection", got {v} span harus "object" atau "selection", diterima {v} diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 08cefdbed7..3a037b10d2 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1306,6 +1306,8 @@ font-technology Variable Variabili Reset Tracking and Kerning Reimposta spaziatura caratteri e crenatura Reset Horizontal Scale Reimposta scala orizzontale Highlight Font Name Evidenzia nome del font + Highlight Font Size Evidenzia dimensione font + Other… Altro… Highlight Kerning Evidenzia crenatura Highlight Tracking Evidenzia spaziatura caratteri Spacing Spaziatura diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 59c7628f40..4c2b4712b2 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -461,6 +461,8 @@ digits Malayalam マラヤーラム数字 Reset Tracking and Kerning トラッキングとカーニングをリセット Reset Horizontal Scale 水平比率をリセット Highlight Font Name フォント名をハイライト + Highlight Font Size フォントサイズをハイライト + Other… その他… Highlight Kerning カーニングをハイライト Highlight Tracking トラッキングをハイライト Step Type 文字を段階的に調整 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 9393433cdb..a3f3a9a74e 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -7998,6 +7998,8 @@ liquify-list-end {0}, {1} {0} და {1} Keep selected მონიშნულად დატოვება Reset Tracking and Kerning ტრეკინგისა და კერნინგის ჩამოყრა Highlight Font Name შრიფტის სახელის გამოკვეთა + Highlight Font Size შრიფტის ზომის გამოკვეთა + Other… სხვა… Highlight Kerning კერნინგის გამოკვეთა Highlight Tracking ტრეკინგის გამოკვეთა Legacy (version 7) ძველი (ვერსია 7) diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 49d5e10dc1..21c5bbedcb 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -454,6 +454,8 @@ digits Malayalam 말라얄람어 Reset Tracking and Kerning 자간 및 커닝 재설정 Reset Horizontal Scale 가로 비율 재설정 Highlight Font Name 글꼴 이름 강조 표시 + Highlight Font Size 글꼴 크기 강조 표시 + Other… 기타… Highlight Kerning 커닝 강조 표시 Highlight Tracking 자간 강조 표시 Step Type 단계별 문자 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index f071ebd0e2..d23a677dfb 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -8192,6 +8192,8 @@ mark-style Japanese Japans Reset Tracking and Kerning Tracking en kerning herstellen Reset Horizontal Scale Horizontale schaal herstellen Highlight Font Name Lettertypenaam markeren + Highlight Font Size Lettertypegrootte markeren + Other… Andere… Highlight Kerning Kerning markeren Highlight Tracking Tracking markeren @msg span must be "object" or "selection", got {v} span moet "object" of "selection" zijn, maar is {v} diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 2477c73abd..dfe3969653 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4196,6 +4196,8 @@ axis Both Obie Reset Tracking and Kerning Resetuj światło i kerning Reset Horizontal Scale Resetuj skalę poziomą Highlight Font Name Wyróżnij nazwę czcionki + Highlight Font Size Wyróżnij rozmiar czcionki + Other… Inny… Highlight Kerning Wyróżnij kerning Highlight Tracking Wyróżnij światło Step Type Krok tekstu diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 333351b9af..d9c1d3626b 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1179,6 +1179,8 @@ antiAlias Sharp Nítido Reset Tracking and Kerning Redefinir Rastreamento e Kerning Reset Horizontal Scale Redefinir Escala Horizontal Highlight Font Name Destacar Nome da Fonte + Highlight Font Size Destacar Tamanho da Fonte + Other… Outro… Highlight Kerning Destacar Kerning Highlight Tracking Destacar Rastreamento Step Type Ajustar Texto em Incrementos diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index ae33aa0d55..694c137d08 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1297,6 +1297,8 @@ font-technology Variable Вариативные Reset Tracking and Kerning Сбросить трекинг и кернинг Reset Horizontal Scale Сбросить масштаб по горизонтали Highlight Font Name Выделить имя шрифта + Highlight Font Size Выделить размер шрифта + Other… Другой… Highlight Kerning Выделить кернинг Highlight Tracking Выделить трекинг Spacing Интервал diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 1bd4fd0692..5aad4fd2c0 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -6303,6 +6303,8 @@ theme Appearance Utseende Reset Horizontal Scale Återställ horisontell skala Reset Tracking and Kerning Återställ spärrning och kerning Highlight Font Name Framhäv typsnittsnamn + Highlight Font Size Framhäv teckenstorlek + Other… Annan… Highlight Kerning Framhäv kerning Highlight Tracking Framhäv spärrning Sample Color from Screen Hämta färg från skärmen diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index a2a38c679a..4c680f92b9 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -1248,6 +1248,8 @@ font-technology Variable Değişken Reset Tracking and Kerning Takip ve Karakter Aralığını Sıfırla Reset Horizontal Scale Yatay Ölçeği Sıfırla Highlight Font Name Yazı Tipi Adını Vurgula + Highlight Font Size Yazı Tipi Boyutunu Vurgula + Other… Diğer… Highlight Kerning Karakter Aralığını Vurgula Highlight Tracking Takibi Vurgula Spacing Aralık diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 17c673885d..3a70b5b8af 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1300,6 +1300,8 @@ font-technology Variable Варіативні Reset Tracking and Kerning Скинути трекінг і кернінг Reset Horizontal Scale Скинути масштаб по горизонталі Highlight Font Name Виділити назву шрифту + Highlight Font Size Виділити розмір шрифту + Other… Інший… Highlight Kerning Виділити кернінг Highlight Tracking Виділити трекінг Spacing Інтервал diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index da89525314..e764fa06d2 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3380,6 +3380,8 @@ mark-style Japanese Kiểu Nhật Reset to White, Black Đặt lại về Trắng, Đen Reset Tracking and Kerning Đặt lại giãn chữ và kerning Highlight Font Name Đánh dấu tên phông + Highlight Font Size Đánh dấu cỡ chữ + Other… Khác… Highlight Kerning Đánh dấu kerning Highlight Tracking Đánh dấu giãn chữ Reset with Mesh Đặt lại với lưới diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 5f612cb0d4..30a2bbfa76 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1237,6 +1237,8 @@ antiAlias Sharp 锐利 Reset Tracking and Kerning 重置字距和字偶距 Reset Horizontal Scale 重置水平缩放 Highlight Font Name 突出显示字体名称 + Highlight Font Size 突出显示字号 + Other… 其他… Highlight Kerning 突出显示字偶距 Highlight Tracking 突出显示字距 Spacing 间距 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index e0b5a13ee2..e0ac64696d 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1271,6 +1271,8 @@ font-technology Variable 可變 Reset Tracking and Kerning 重設字距與字距微調 Reset Horizontal Scale 重設水平縮放 Highlight Font Name 反白顯示字體名稱 + Highlight Font Size 反白顯示字體大小 + Other… 其他… Highlight Kerning 反白顯示字距微調 Highlight Tracking 反白顯示字距 Spacing 間距 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 495e606d6c..0b3d86f57a 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -322,6 +322,7 @@ fn run_ui_part3(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option crate::panels::character::toggle_face(app, Face::Bold), "type.italic" => crate::panels::character::toggle_face(app, Face::Italic), "type.highlightFontName" => crate::panels::character::highlight(app, crate::panels::character::Field::FontName), + "type.highlightFontSize" => crate::panels::character::highlight(app, crate::panels::character::Field::FontSize), "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), diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index d4dda4698b..7a4b195ae1 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -219,7 +219,7 @@ 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.bold" | "type.italic" | "type.underline" | "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(), diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index 1bb152292e..a1e5e65c33 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -416,6 +416,39 @@ fn center_on_top_and_bottom_are_type_on_a_path_items() { assert!((start - 0.625).abs() < 1e-6, "{start}"); } +/// Type › Size ends with a separator and Other…, which runs `type.highlightFontSize`: dimmed +/// without selected type, enabled with it, and never checked. +#[test] +fn type_size_ends_with_other() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default()); + let id = "type.highlightFontSize"; + assert!(!enabled(&app, id), "no document"); + app.run("file.new", json!({})).unwrap(); + let items: Vec = menu_tree() + .into_iter() + .filter(|(menu, _)| *menu == "Type") + .flat_map(|(_, items)| items) + .filter_map(|item| match item { + Item::Sub("Size", children) => Some(children), + _ => None, + }) + .flatten() + .collect(); + let n = items.len(); + assert!(n > 2, "{n} items"); + assert!(matches!(items[n - 2], Item::Sep), "a separator comes before Other…"); + assert!(matches!(&items[n - 1], Item::Cmd("Other…", c, p) if *c == id && p.is_null()), "Other… comes last"); + assert!(items[..n - 2].iter().all(|i| matches!(i, Item::Cmd(_, "text.setStyle", _))), "the sizes come first"); + assert!(!enabled(&app, id), "nothing selected"); + let path = app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 50, "height": 50})).unwrap()["id"].clone(); + app.run("select.set", json!({"ids": [path]})).unwrap(); + assert!(!enabled(&app, id), "a path selected"); + let text = app.run("text.create", json!({"x": 10, "y": 100, "text": "Size"})).unwrap()["id"].clone(); + app.run("select.set", json!({"ids": [text]})).unwrap(); + assert!(enabled(&app, id), "type selected"); + assert_eq!(checked(&app, id, &Value::Null), None); +} + /// Type › Dynamic Text Presets › Circle, Arch and Bow run `type.dynamicTextPreset` with their /// preset, enabled for point type and type on a path but not for area type alone. #[test] diff --git a/crates/ui-egui/src/menus/tree.rs b/crates/ui-egui/src/menus/tree.rs index ec8ec99018..f54f95b569 100644 --- a/crates/ui-egui/src/menus/tree.rs +++ b/crates/ui-egui/src/menus/tree.rs @@ -397,7 +397,14 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec)> { vec![ sub("Font", font_items(english_names)), sub("Recent Fonts", RECENT_FONT_IDS.iter().map(|id| c("Recent Font", id)).collect()), - sub("Size", TYPE_SIZES.iter().map(|(l, n)| cp(l, "text.setStyle", json!({ "size": n }))).collect()), + sub( + "Size", + TYPE_SIZES + .iter() + .map(|(l, n)| cp(l, "text.setStyle", json!({ "size": n }))) + .chain([Sep, c("Other…", "type.highlightFontSize")]) + .collect(), + ), c("Bold", "type.bold"), c("Italic", "type.italic"), Sep, diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index ced961e32c..2ff580f22c 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -377,6 +377,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "Cmd+Alt+Shift+F", "{} show the Character panel if it is hidden and open its font family menu, whose search field takes the keyboard focus: type to search, Enter applies the highlighted font → {field: \"fontName\"}. Without selected type (or text the Type tool edits) the panel shows, and the error says to select type first", ), + ( + "type.highlightFontSize", + "Highlight Font Size", + "", + "{} (Type › Size › Other…) show the Character panel if it is hidden and give its Font Size field the keyboard focus with its value selected (blank where the selected sizes differ): type a size and press Enter → {field: \"fontSize\"}. Without selected type (or text the Type tool edits) the panel shows, and the error says to select type first", + ), ( "type.highlightKerning", "Highlight Kerning", diff --git a/crates/ui-egui/src/panel_docking/tests.rs b/crates/ui-egui/src/panel_docking/tests.rs index 266f423838..d1f7f1473a 100644 --- a/crates/ui-egui/src/panel_docking/tests.rs +++ b/crates/ui-egui/src/panel_docking/tests.rs @@ -408,7 +408,7 @@ fn a_character_field_shortcut_brings_the_floating_character_panel_forward() { h.frame(vec![]); assert!(showing(&h.app.ui, "character")); assert_eq!(h.app.dock_rt.raise, None); - for command in ["type.highlightKerning", "type.highlightTracking", "type.highlightFontName"] { + for command in ["type.highlightKerning", "type.highlightTracking", "type.highlightFontName", "type.highlightFontSize"] { h.app.run(command, json!({})).unwrap(); assert_eq!(h.app.dock_rt.raise.as_deref(), Some("character"), "{command}"); h.frame(vec![]); diff --git a/crates/ui-egui/src/panels/character.rs b/crates/ui-egui/src/panels/character.rs index 746a8fbdf4..1ddb45b11b 100644 --- a/crates/ui-egui/src/panels/character.rs +++ b/crates/ui-egui/src/panels/character.rs @@ -481,12 +481,14 @@ pub(crate) fn toggle_face(app: &mut VectorcraftApp, face: Face) -> Result &'static str { match self { Field::FontName => "ch-font", + Field::FontSize => "ch-size", Field::Kerning => "ch-kern", Field::Tracking => "ch-track", } @@ -504,17 +507,19 @@ impl Field { fn name(self) -> &'static str { match self { Field::FontName => "fontName", + Field::FontSize => "fontSize", Field::Kerning => "kerning", Field::Tracking => "tracking", } } } -/// `type.highlightFontName`, `type.highlightKerning` and `type.highlightTracking`: show the -/// Character panel if it is hidden (a shown one is activated, so its floating window comes -/// forward), and give `field` the keyboard focus when the panel next draws it, a number field with -/// its value selected (typing replaces it, Enter applies it). Without selected type or text the -/// Type tool edits, the panel shows, nothing takes the focus and the command fails. → `{field}`. +/// `type.highlightFontName`, `type.highlightFontSize`, `type.highlightKerning` and +/// `type.highlightTracking`: show the Character panel if it is hidden (a shown one is activated, +/// so its floating window comes forward), and give `field` the keyboard focus when the panel next +/// draws it, a number field with its value selected (typing replaces it, Enter applies it). +/// Without selected type or text the Type tool edits, the panel shows, nothing takes the focus and +/// the command fails. → `{field}`. pub(crate) fn highlight(app: &mut VectorcraftApp, field: Field) -> Result { // `window.panel` would hide a floating panel in front of its window, or an open flyout. if crate::panel_docking::visible(&app.ui, "character") { diff --git a/crates/ui-egui/src/panels/character/tests.rs b/crates/ui-egui/src/panels/character/tests.rs index 1e3e6acec4..6ff3eeb51e 100644 --- a/crates/ui-egui/src/panels/character/tests.rs +++ b/crates/ui-egui/src/panels/character/tests.rs @@ -343,6 +343,57 @@ fn highlight_commands_focus_the_font_kerning_and_tracking_fields() { assert_eq!(app.character_focus, None); } +/// Type › Size › Other… (Highlight Font Size) shows the Character panel and gives its Font Size +/// field the keyboard focus with the value selected: what is typed replaces it, Enter applies it +/// as one undo step, and a selection of different sizes takes the one size typed into the blank +/// field. Without selected type the panel shows, the command fails and nothing takes the focus. +#[test] +fn highlight_font_size_focuses_the_font_size_field() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + let a = app.run("text.create", json!({"x": 20, "y": 50, "text": "AVAX", "size": 12})).unwrap()["id"].clone(); + let b = app.run("text.create", json!({"x": 20, "y": 120, "text": "Wave", "size": 20})).unwrap()["id"].clone(); + let ctx = egui::Context::default(); + let frame = |app: &mut VectorcraftApp, events: Vec| { + let mut out = ctx.run_ui(egui::RawInput { events, ..Default::default() }, |ui| show(app, ui)); + out.textures_delta.clear(); + }; + let typed = |text: &str| { + let enter = egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }; + vec![egui::Event::Text(text.into()), enter] + }; + let size = |app: &VectorcraftApp| shared(app, |s| s.size); + app.run("select.set", json!({"ids": [a.clone()]})).unwrap(); + assert_eq!(app.run("type.highlightFontSize", json!({})).unwrap(), json!({"field": "fontSize"})); + assert!(crate::panel_docking::showing(&app.ui, "character"), "the panel shows"); + frame(&mut app, vec![]); + assert_eq!(app.character_focus, None, "the Font Size field took the focus"); + frame(&mut app, typed("33")); + assert_eq!(size(&app), Some(33.0), "typing replaced the size"); + app.run("edit.undo", json!({})).unwrap(); + assert_eq!(size(&app), Some(12.0), "one undo step restores the size"); + // Choosing Other again while the field holds typed text that is not applied selects all of it. + app.run("type.highlightFontSize", json!({})).unwrap(); + frame(&mut app, vec![]); + frame(&mut app, vec![egui::Event::Text("999".into())]); + app.run("type.highlightFontSize", json!({})).unwrap(); + frame(&mut app, vec![]); + frame(&mut app, typed("18")); + assert_eq!(size(&app), Some(18.0), "typing replaced the text typed before"); + ctx.memory_mut(|m| m.stop_text_input()); + // Different sizes: the field is blank, and the size typed applies to every selected object. + app.run("select.set", json!({"ids": [a, b]})).unwrap(); + assert_eq!(size(&app), None); + app.run("type.highlightFontSize", json!({})).unwrap(); + frame(&mut app, vec![]); + frame(&mut app, typed("16")); + assert_eq!(size(&app), Some(16.0), "both objects take the size typed"); + // No type selected: the panel shows, the command fails and nothing is armed. + app.run("select.none", json!({})).unwrap(); + assert!(app.run("type.highlightFontSize", json!({})).is_err()); + assert_eq!(app.character_focus, None); +} + /// A variable font gets the Variable Font button, which opens one slider per axis named as the /// font names it; a drag along one sets that axis of the selected type in one undo step. #[test] diff --git a/crates/ui-egui/src/widgets/numeric.rs b/crates/ui-egui/src/widgets/numeric.rs index 89ce8d70d5..23f48f88d2 100644 --- a/crates/ui-egui/src/widgets/numeric.rs +++ b/crates/ui-egui/src/widgets/numeric.rs @@ -142,7 +142,8 @@ fn unit_field( /// [`unit_field`] whose blank field (`value` is `None`) steps from `blank_from` (points) with /// ↑/↓ and the wheel instead of doing nothing. With `refuse_outside`, a value typed outside -/// `bounds` is refused as text that doesn't read is, rather than kept at the nearer end. +/// `bounds` is refused as text that doesn't read is, rather than kept at the nearer end. Armed +/// with id salt `id` ([`arm_field_focus`]), it takes the keyboard focus with its value selected. #[allow(clippy::too_many_arguments)] fn unit_field_from( ui: &mut Ui, @@ -160,10 +161,18 @@ fn unit_field_from( empty: &str, refuse_outside: bool, ) -> Option { + let armed = take_armed_focus(ui, &id); let id = id_with(ui.scope_id(), id); let shown = value.map(|v| unit.format(v)).unwrap_or_else(|| empty.to_string()); take_dialog_focus(ui, id, &shown); + if armed { + focus_field(ui, id, &shown); + } let (mut buf, commit, resp, rect) = recessed_text(ui, id, &shown, width, 1, label, name); + if armed { + // A field armed while it has focus keeps the text typed into it: select all of that text. + select_all(ui, id, &buf); + } select_all_on_focus(ui, &resp, &buf); // ↑/↓ and the wheel step in the field's unit; a drag on its label scrubs it. let typed = typed_unit(ui.ctx(), unit); diff --git a/docs/mcp.md b/docs/mcp.md index c7aa202d3f..43884793f2 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7034,7 +7034,10 @@ Pen's second anchor at (150, 431), in line with the square's centre. `type.highlightTracking` (no default key) and `type.highlightFontName` (Cmd+Alt+Shift+F) show the Character panel and give its Kerning or Tracking field the keyboard focus with the value selected, or open its font family menu with the search field focused; each replies `{field: "kerning" | "tracking" | "fontName"}`. Without selected type or text the - Type tool edits, the panel shows and the command fails. + Type tool edits, the panel shows and the command fails. Type › Size › Other… runs `type.highlightFontSize` (`{}`, no + default key), which gives the Character panel's Font Size field the keyboard focus the same way (blank when the + selected sizes differ; the size typed and Enter apply through `text.setStyle {size}` as one undo step) and replies + `{field: "fontSize"}`; the menu item is dimmed without selected type or text the Type tool edits. The UI command `type.underline` (Cmd+Shift+U, 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 diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 0782bacab9..06a002aef9 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1121,6 +1121,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - 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 clears manual kerning while keeping the automatic method, in one undo step; at a caret it resets only the kerning there: of the character before it, or at the start of a line the space before the character after it (#5111). - Cmd/Ctrl+Alt+K (`type.highlightKerning`) and Cmd/Ctrl+Alt+Shift+F (`type.highlightFontName`) show the Character panel and give its Kerning field the keyboard focus with the value selected, or open its font family menu with the search field focused, 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 highlighting kerning and the font name field. The page lists the same key for selecting the tracking value; `type.highlightTracking` focuses the Tracking field the same way and has no default key in Keyboard Shortcuts. + - Type › Size ends with Other… (`type.highlightFontSize`), for a size the list does not hold: it shows the Character panel and gives its Font Size field the keyboard focus with the value selected, and the size typed applies on Enter. [The help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=488) describes Other in the Size menu as the way to enter a new size in the Character panel. Selecting the field's value, the separator before Other… and the item being dimmed without selected type are VectorCraft's own choices. - Cmd/Ctrl+Alt+L (`ui.newLayer`) opens Layer Options for a new layer, as an Alt-click on the Layers panel's New Layer 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 adding a layer through the New Layer dialog box. OK adds the layer above the current layer, and Cancel adds none. Cmd/Ctrl+L still adds a layer without the dialog. - 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.