diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 9be6fbf29b..9d9bb34aa1 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -381,6 +381,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 c89b89b284..52b6f5e779 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6097,6 +6097,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 0dda0682a7..0c5e7fdf8c 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4293,6 +4293,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 e425a7571a..0ff335f8b2 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1823,6 +1823,8 @@ digits Malayalam Malaiàlam Fonts added in the last 30 days Tipus de lletra afegits en els darrers 30 dies 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 da84a74d1a..0c6fc20d78 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4395,6 +4395,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 a7f5380f48..1e58a4981d 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -8603,6 +8603,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 4da6580d6f..2322a033e7 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1284,6 +1284,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 b8e152090a..da2f3db18d 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -6499,6 +6499,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 78d84c4aa3..0f20dc9a9f 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1309,6 +1309,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 a784be1816..e5d8b24899 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6509,6 +6509,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 79e5564f95..d908a4cecc 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1299,6 +1299,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 9b077fe53d..1d8c7763b4 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -1714,6 +1714,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 61fed77b1a..f5897977d4 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -2344,6 +2344,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 66ae7bf1f7..295b847193 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3649,6 +3649,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 e2d75d86c5..0f3b333107 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -5842,6 +5842,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 ef042d5e41..4fd8fcc93a 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1318,6 +1318,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 cfb75833d1..43c9fb4ca1 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -466,6 +466,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 6f281d65ef..2af511383a 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -8284,6 +8284,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 202145361b..58873523d7 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -459,6 +459,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 af28e84e1d..5243cc6720 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -8389,6 +8389,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 bd2ce9d91a..c7a50fee09 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4237,6 +4237,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 7aa3c71cee..8c67228afa 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1189,6 +1189,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 eb2b15574b..23abe5b843 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1307,6 +1307,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 cdce91f638..e313fd3529 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -6489,6 +6489,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 0b8af17d31..fd9b06b3c2 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -1258,6 +1258,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 34c8ed8ac0..786122bfe9 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1312,6 +1312,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 5889cc4e94..a7e4523664 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3420,6 +3420,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 a202695665..317b320bca 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1249,6 +1249,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 43aeffb566..7ca3b187e1 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1283,6 +1283,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 39e9932f14..7fba89ddcb 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 3e2673a651..676e34e1a1 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -442,6 +442,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 04cf160411..19a68f140d 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 00cf6f2637..4c3ebfa633 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -382,6 +382,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 e12a5b2c6e..6c861c0db9 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 0424485926..f329273e7e 100644 --- a/crates/ui-egui/src/panels/character.rs +++ b/crates/ui-egui/src/panels/character.rs @@ -483,12 +483,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", } @@ -506,17 +509,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 4b0e96679f..5280db5e8a 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 f526513a74..01ce18757f 100644 --- a/crates/ui-egui/src/widgets/numeric.rs +++ b/crates/ui-egui/src/widgets/numeric.rs @@ -120,7 +120,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, @@ -138,10 +139,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 cf227853db..63a304faef 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7286,7 +7286,10 @@ Guides off, this drag leaves a 70 × 50 and a 90 × 50 copy and the 110 × 70 re `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 52c8b3a80d..dbb3e4725b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1181,6 +1181,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.