Merge pull request #3318 from dotCooCoo/feat/tabs-panel-vertical-type-labels

Tabs: in vertical type the alignments read Top- and Bottom-Justified Tab and the position Y
This commit is contained in:
BFlat
2026-10-21 17:27:30 +07:00
committed by GitHub
25 changed files with 127 additions and 17 deletions
+2
View File
@@ -294,6 +294,7 @@
Blur Размазване
Bottom Долу
Bottom in Front Най-долу отпред
Bottom-Justified Tab Табулация с долно подравняване
Bottom: Долу:
Bounds Ограничителна рамка
Bounds (Fill Proportionally) Граници (пропорционално запълване)
@@ -3213,6 +3214,7 @@
Tools Инструменти
Top Горно
Top in Front Най-горе отпред
Top-Justified Tab Табулация с горно подравняване
Top: Горно:
Total Width: Обща ширина:
Touch Type Tool Инструмент „Сензорен текст“
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1907,6 +1907,7 @@ lighting Light Světlo
Select art and click New Symbol to make one. Vyberte kresbu a symbol vytvořte tlačítkem Nový symbol.
Symbol Libraries (on the roadmap) Knihovny symbolů (v plánu)
Align On: Zarovnat na:
Bottom-Justified Tab Tabulátor zarovnaný dolů
Center-Justified Tab Tabulátor zarovnaný na střed
Above Text Nad textem
Position Panel Above Text Umístit panel nad text
@@ -1918,6 +1919,7 @@ lighting Light Světlo
No text selected Není vybrán žádný text
Repeat Tab Opakovat tabulátor
Right-Justified Tab Tabulátor zarovnaný doprava
Top-Justified Tab Tabulátor zarovnaný nahoru
Select a text object to set its tab stops. Vyberte textový objekt, abyste mohli nastavit jeho zarážky tabulátoru.
Select text Vyberte text
Snap to Unit Přichytávat k jednotkám
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1724,6 +1724,7 @@ lighting Light Lys
Select art and click New Symbol to make one. Markér grafik, og klik på Nyt symbol for at oprette et.
Symbol Libraries (on the roadmap) Symbolbiblioteker (på roadmappen)
Align On: Justér på:
Bottom-Justified Tab Bundjusteret tabulator
Center-Justified Tab Midterjusteret tabulator
Above Text Over teksten
Position Panel Above Text Placér panel over teksten
@@ -1735,6 +1736,7 @@ lighting Light Lys
No text selected Ingen tekst markeret
Repeat Tab Gentag tabulator
Right-Justified Tab Højrejusteret tabulator
Top-Justified Tab Topjusteret tabulator
Select a text object to set its tab stops. Markér et tekstobjekt for at angive dets tabulatorstop.
Select text Markér tekst
Snap to Unit Fastgør til enhed
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -289,6 +289,7 @@
Blur Weichzeichnen
Bottom Unten
Bottom in Front Unten im Vordergrund
Bottom-Justified Tab Unten ausgerichteter Tabulator
Bottom: Unten:
Bounds Begrenzung
Bounds (Fill Proportionally) Begrenzung (proportional füllen)
@@ -3238,6 +3239,7 @@ effect Points Punkte
Tools Werkzeuge
Top Oben
Top in Front Oben im Vordergrund
Top-Justified Tab Oben ausgerichteter Tabulator
Top: Oben:
Total Width: Gesamtbreite:
Touch Type Touch-Type
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -285,6 +285,7 @@
Blur Θόλωση
Bottom Κάτω
Bottom in Front Κάτω αντικείμενο μπροστά
Bottom-Justified Tab Στηλοθέτης κάτω στοίχισης
Bottom: Κάτω:
Bounds Όρια
Bounds (Fill Proportionally) Όρια (αναλογικό γέμισμα)
@@ -3587,6 +3588,7 @@ theme Appearance Εμφάνιση
Toolbar: Remove Tool Γραμμή εργαλείων: Αφαίρεση εργαλείου
Toolbar: Reset Γραμμή εργαλείων: Επαναφορά
Top in Front Επάνω μπροστά
Top-Justified Tab Στηλοθέτης επάνω στοίχισης
Total Width: Συνολικό πλάτος:
Touch Type Tool Επεξεργασία χαρακτήρων με αφή (Touch Type Tool)
Trace Διανυσματοποίηση
Can't render this file because it contains an unexpected character in line 2021 and column 19.
+2
View File
@@ -307,6 +307,7 @@
Blur Desenfocar
Bottom Abajo
Bottom in Front Inferior delante
Bottom-Justified Tab Tabulación inferior
Bottom: Abajo:
Bounds Límites
Bounds (Fill Proportionally) Límites (rellenar proporcionalmente)
@@ -3272,6 +3273,7 @@
Tools Herramientas
Top Arriba
Top in Front Superior delante
Top-Justified Tab Tabulación superior
Top: Arriba:
Total Width: Anchura total:
Touch Type Tool Herramienta Retocar texto
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1870,6 +1870,7 @@ lighting Light Valo
Select art and click New Symbol to make one. Luo symboli valitsemalla kuvitus ja napsauttamalla Uusi symboli.
Symbol Libraries (on the roadmap) Symbolikirjastot (suunnitteilla)
Align On: Tasaa kohteeseen:
Bottom-Justified Tab Alas tasattu sarkain
Center-Justified Tab Keskitetty sarkain
Above Text Tekstin yläpuolella
Position Panel Above Text Sijoita paneeli tekstin yläpuolelle
@@ -1881,6 +1882,7 @@ lighting Light Valo
No text selected Ei valittua tekstiä
Repeat Tab Toista sarkain
Right-Justified Tab Oikealle tasattu sarkain
Top-Justified Tab Ylös tasattu sarkain
Select a text object to set its tab stops. Valitse tekstiobjekti, jonka sarkainkohdat haluat asettaa.
Select text Valitse teksti
Snap to Unit Kohdista yksikköön
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -308,6 +308,7 @@
Blur Flou
Bottom Bas
Bottom in Front Bas au premier plan
Bottom-Justified Tab Tabulation alignée en bas
Bottom: Bas :
Bounds Limites
Bounds (Fill Proportionally) Limites (remplir proportionnellement)
@@ -3269,6 +3270,7 @@
Tools Outils
Top Haut
Top in Front Haut au premier plan
Top-Justified Tab Tabulation alignée en haut
Top: Haut :
Total Width: Largeur totale :
Touch Type Tool Outil Retouche de texte
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -432,6 +432,7 @@
Bottom Left Bal alsó
Bottom Right Jobb alsó
Bottom to Top Lentről felfelé
Bottom-Justified Tab Alulra igazító tabulátor
Bottom-to-Bottom Leading Alulról alulra mért sorköz
Bottom: Alsó:
Bounding Box Befoglaló keret
@@ -3945,6 +3946,7 @@ mark-style Japanese Japán
Top Left Bal felső
Top Right Jobb felső
Top to Bottom Fentről lefelé
Top-Justified Tab Felülre igazító tabulátor
Top-to-Top Leading Felülről felülre mért sorköz
Top: Felső:
Total Width: Teljes szélesség:
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1724,6 +1724,7 @@ lighting Light Cahaya
Select art and click New Symbol to make one. Pilih karya seni dan klik Simbol Baru untuk membuatnya.
Symbol Libraries (on the roadmap) Pustaka simbol (ada di peta jalan)
Align On: Ratakan pada:
Bottom-Justified Tab Tab rata bawah
Center-Justified Tab Tab rata tengah
Above Text Di atas teks
Position Panel Above Text Posisikan panel di atas teks
@@ -1735,6 +1736,7 @@ lighting Light Cahaya
No text selected Tidak ada teks yang dipilih
Repeat Tab Ulangi tab
Right-Justified Tab Tab rata kanan
Top-Justified Tab Tab rata atas
Select a text object to set its tab stops. Pilih objek teks untuk mengatur tab stop-nya.
Select text Pilih teks
Snap to Unit Snap ke satuan
1 # Indonesian (id) catalog. Same format as zh-hant.tsv: context <TAB> source <TAB> translation
1724
1725
1726
1727
1728
1729
1730
1736
1737
1738
1739
1740
1741
1742
+2
View File
@@ -307,6 +307,7 @@
Blur Sfocatura
Bottom In basso
Bottom in Front Inferiore davanti
Bottom-Justified Tab Tabulazione allineata in basso
Bottom: In basso:
Bounds Limiti
Bounds (Fill Proportionally) Limiti (riempi proporzionalmente)
@@ -3305,6 +3306,7 @@ mark-style Japanese Giapponese
Tools Strumenti
Top In alto
Top in Front Superiore davanti
Top-Justified Tab Tabulazione allineata in alto
Top: In alto:
Total Width: Larghezza totale:
Touch Type Ritocco testo
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3228,6 +3228,7 @@ gradient-kind Radial 円形
Black and White Logo 白黒ロゴ
Bottom 下
Bottom in Front 下が前面
Bottom-Justified Tab 下揃えタブ
Bounds 境界
Bounds (Fill Proportionally) 境界 (縦横比を保って全体を覆う)
Bounds (Fit Proportionally) 境界 (縦横比を保って収める)
@@ -3552,6 +3553,7 @@ file-filter Templates テンプレート
Tip on the end point 先端をパスの端点に合わせる
Top 上
Top in Front 上が前面
Top-Justified Tab 上揃えタブ
Transforms 変形
Transparent (Default) 透明 (デフォルト)
Trim marks トリムマーク
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1625,6 +1625,7 @@ lighting Light სინათლე
Select art and click New Symbol to make one. მონიშნეთ ნახატი და შესაქმნელად დაწკაპეთ „ახალ სიმბოლოზე“.
Symbol Libraries (on the roadmap) სიმბოლოების ბიბლიოთეკები (სამომავლო გეგმაშია)
Align On: სწორება მიმართ:
Bottom-Justified Tab ქვემოთ სწორებული ტაბულაცია
Center-Justified Tab ცენტრით სწორებული ტაბულაცია
Above Text ტექსტის ზემოთ
Position Panel Above Text პანელის ტექსტის ზემოთ განთავსება
@@ -1636,6 +1637,7 @@ lighting Light სინათლე
No text selected ტექსტი მონიშნული არ არის
Repeat Tab ტაბულაციის გამეორება
Right-Justified Tab მარჯვნივ სწორებული ტაბულაცია
Top-Justified Tab ზემოთ სწორებული ტაბულაცია
Select a text object to set its tab stops. ტაბულაციის გაჩერებების დასაყენებლად მონიშნეთ ტექსტური ობიექტი.
Select text მონიშნეთ ტექსტი
Snap to Unit ერთეულზე მიბმა
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3221,6 +3221,7 @@ gradient-kind Radial 방사형
Black and White Logo 흑백 로고
Bottom 아래쪽
Bottom in Front 아래쪽이 앞
Bottom-Justified Tab 아래쪽 정렬 탭
Bounds 경계
Bounds (Fill Proportionally) 경계(비율 유지하여 채우기)
Bounds (Fit Proportionally) 경계(비율 유지하여 맞추기)
@@ -3545,6 +3546,7 @@ file-filter Templates 템플릿
Tip on the end point 끝이 끝점에 위치
Top 위쪽
Top in Front 위쪽이 앞
Top-Justified Tab 위쪽 정렬 탭
Transforms 변형
Transparent (Default) 투명 (기본값)
Trim marks 재단 표시
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1738,6 +1738,7 @@ lighting Light Licht
Select art and click New Symbol to make one. Selecteer artwork en klik op Nieuw symbool om er een te maken.
Symbol Libraries (on the roadmap) Symboolbibliotheken (op de roadmap)
Align On: Uitlijnen op:
Bottom-Justified Tab Onder uitgelijnde tabstop
Center-Justified Tab Midden uitgelijnde tabstop
Above Text Boven tekst
Position Panel Above Text Paneel boven tekst plaatsen
@@ -1749,6 +1750,7 @@ lighting Light Licht
No text selected Geen tekst geselecteerd
Repeat Tab Tabstop herhalen
Right-Justified Tab Rechts uitgelijnde tabstop
Top-Justified Tab Boven uitgelijnde tabstop
Select a text object to set its tab stops. Selecteer een tekstobject om de tabstops in te stellen.
Select text Selecteer tekst
Snap to Unit Uitlijnen op eenheid
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1826,6 +1826,7 @@ lighting Light Światło
Select art and click New Symbol to make one. Zaznacz kompozycję i kliknij Nowy symbol, aby go utworzyć.
Symbol Libraries (on the roadmap) Biblioteki symboli (w planach)
Align On: Wyrównaj do:
Bottom-Justified Tab Tabulator dolny
Center-Justified Tab Tabulator środkowy
Above Text Nad tekstem
Position Panel Above Text Umieść panel nad tekstem
@@ -1837,6 +1838,7 @@ lighting Light Światło
No text selected Nie zaznaczono tekstu
Repeat Tab Powtórz tabulator
Right-Justified Tab Tabulator prawy
Top-Justified Tab Tabulator górny
Select a text object to set its tab stops. Zaznacz obiekt tekstowy, aby ustawić jego tabulatory.
Select text Zaznacz tekst
Snap to Unit Przyciągaj do jednostek
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4089,6 +4089,7 @@ axis Both Ambos
Black and White Logo Logotipo em Preto e Branco
Bottom Inferior
Bottom in Front Inferior na Frente
Bottom-Justified Tab Parada de Tabulação Inferior
Bounds Limites
Bounds (Fill Proportionally) Limites (Preencher Proporcionalmente)
Bounds (Fit Proportionally) Limites (Ajustar Proporcionalmente)
@@ -4472,6 +4473,7 @@ axis Both Ambos
Toolbar: Reset Barra de Ferramentas: Redefinir
Top Superior
Top in Front Superior na Frente
Top-Justified Tab Parada de Tabulação Superior
Transforms Transformações
Transparent (Default) Transparente (Padrão)
Trim marks Marcas de corte
Can't render this file because it contains an unexpected character in line 6 and column 47.
+2
View File
@@ -305,6 +305,7 @@
Blur Размытие
Bottom Внизу
Bottom in Front Нижний спереди
Bottom-Justified Tab Табуляция с выравниванием по нижнему краю
Bottom: Внизу:
Bounds Границы
Bounds (Fill Proportionally) Границы (заполнять пропорционально)
@@ -3301,6 +3302,7 @@ mark-style Japanese Японский
Tools Инструменты
Top Вверху
Top in Front Верхний спереди
Top-Justified Tab Табуляция с выравниванием по верхнему краю
Top: Вверху:
Total Width: Общая ширина:
Touch Type Настройка текста
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -296,6 +296,7 @@
Blur Oskärpa
Bottom Nederkant
Bottom in Front Nederkant framför
Bottom-Justified Tab Bottenjusterad tabb
Bottom: Nederkant:
Bounds Gränser
Bounds (Fill Proportionally) Gränser (fyll proportionellt)
@@ -3213,6 +3214,7 @@
Tools Verktyg
Top Överkant
Top in Front Ovansidan framför
Top-Justified Tab Toppjusterad tabb
Top: Överkant:
Total Width: Total bredd:
Touch Type Tool Beröringstextverktyg
Can't render this file because it contains an unexpected character in line 5 and column 25.
+2
View File
@@ -301,6 +301,7 @@
Blur Розмиття
Bottom Внизу
Bottom in Front Нижній спереду
Bottom-Justified Tab Табуляція з вирівнюванням по нижньому краю
Bottom: Внизу:
Bounds Межі
Bounds (Fill Proportionally) Межі (заповнювати пропорційно)
@@ -3298,6 +3299,7 @@ effect Points Точки
Tools Інструменти
Top Вгорі
Top in Front Верхній спереду
Top-Justified Tab Табуляція з вирівнюванням по верхньому краю
Top: Вгорі:
Total Width: Загальна ширина:
Touch Type Налаштування тексту
Can't render this file because it contains an unexpected character in line 726 and column 40.
+2
View File
@@ -354,6 +354,7 @@
Bottom Left Dưới trái
Bottom Right Dưới phải
Bottom to Top Dưới lên trên
Bottom-Justified Tab Tab căn dưới
Bottom-to-Bottom Leading Giãn dòng đáy đến đáy
Bottom: Dưới:
Bounds Giới hạn
@@ -3644,6 +3645,7 @@ mark-style Japanese Kiểu Nhật
Top Left Trên trái
Top Right Trên phải
Top to Bottom Trên xuống dưới
Top-Justified Tab Tab căn trên
Top-to-Top Leading Giãn dòng đỉnh đến đỉnh
Top: Trên:
Total Width: Tổng chiều rộng:
1 # Vietnamese (vi) catalog. Same format as zh-hant.tsv: context <TAB> source <TAB> translation
354
355
356
357
358
359
360
3645
3646
3647
3648
3649
3650
3651
+2
View File
@@ -262,6 +262,7 @@
Blur 模糊
Bottom 下
Bottom in Front 下方置前
Bottom-Justified Tab 底对齐制表位
Bottom-to-Bottom Leading 基线至基线行距
Burasagari 标点悬挂
Force 强制
@@ -3155,6 +3156,7 @@ font-script Japanese 汉字
Tools 工具
Top 上
Top in Front 上方在前
Top-Justified Tab 顶对齐制表位
Top-to-Top Leading 上缘至上缘行距
Top: 上:
Total Width: 总宽度:
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -273,6 +273,7 @@
Blur 模糊
Bottom 下
Bottom in Front 下方置前
Bottom-Justified Tab 靠下定位點
Bottom-to-Bottom Leading 基線至基線行距
Burasagari 標點懸掛
Force 強制
@@ -4029,6 +4030,7 @@ font-script Japanese 漢字
Tools 工具
Top 上
Top in Front 上方在前
Top-Justified Tab 靠上定位點
Top-to-Top Leading 上緣至上緣行距
Top: 上:
Total Width: 總寬度:
Can't render this file because it contains an unexpected character in line 6 and column 47.
+80 -17
View File
@@ -1,7 +1,7 @@
//! Tabs panel: tab-stop alignment, X position, leader and "align on", and a ruler numbered in the
//! General unit on which a click adds a stop, dragging moves one and dragging it off the ruler
//! deletes it. With Snap to Unit on, or Shift held, a stop placed or dragged on the ruler lands on
//! the ruler's nearest tick.
//! Tabs panel: tab-stop alignment, X position (Y in vertical type), leader and "align on", and a
//! ruler numbered in the General unit on which a click adds a stop, dragging moves one and dragging
//! it off the ruler deletes it. With Snap to Unit on, or Shift held, a stop placed or dragged on the
//! ruler lands on the ruler's nearest tick.
use egui::{Sense, Stroke, Ui, vec2};
use serde_json::{Value, json};
@@ -12,12 +12,21 @@ use crate::VectorcraftApp;
use crate::theme::Tokens;
use crate::widgets::{self, menu_item};
const ALIGNS: [(TabAlign, &str, &str); 4] = [
(TabAlign::Left, "⇥", "Left-Justified Tab"),
(TabAlign::Center, "⇹", "Center-Justified Tab"),
(TabAlign::Right, "⇤", "Right-Justified Tab"),
(TabAlign::Decimal, ".⇥", "Decimal-Justified Tab"),
];
const ALIGNS: [(TabAlign, &str); 4] = [(TabAlign::Left, "⇥"), (TabAlign::Center, "⇹"), (TabAlign::Right, "⇤"), (TabAlign::Decimal, ".⇥")];
/// The name of alignment `a`'s button: its tool tip and what screen readers call it. A line of
/// vertical type runs from top to bottom, so in vertical type a Left stop is named Top-Justified
/// and a Right stop is named Bottom-Justified.
fn align_name(a: TabAlign, vertical: bool) -> &'static str {
match (a, vertical) {
(TabAlign::Left, false) => tl!("Left-Justified Tab"),
(TabAlign::Left, true) => tl!("Top-Justified Tab"),
(TabAlign::Center, _) => tl!("Center-Justified Tab"),
(TabAlign::Right, false) => tl!("Right-Justified Tab"),
(TabAlign::Right, true) => tl!("Bottom-Justified Tab"),
(TabAlign::Decimal, _) => tl!("Decimal-Justified Tab"),
}
}
fn align_id(a: TabAlign) -> &'static str {
match a {
@@ -129,15 +138,15 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
sel = stops.len().saturating_sub(1);
}
let mut align_idx: usize = pstate(ui.ctx(), "tabs-align");
let vertical = matches!(&node.kind, NodeKind::Text(text) if text.vertical);
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 3.0;
for (i, (a, label, tip)) in ALIGNS.iter().enumerate() {
for (i, (a, label)) in ALIGNS.iter().enumerate() {
let on = stops.get(sel).map_or(align_idx == i, |s| s.align == *a);
if ui
.add(egui::Button::new(egui::RichText::new(*label).size(13.0)).selected(on).min_size(vec2(28.0, 24.0)))
.on_hover_text(tl!(*tip))
.clicked()
{
let tip = align_name(*a, vertical);
let resp = ui.add(egui::Button::new(egui::RichText::new(*label).size(13.0)).selected(on).min_size(vec2(28.0, 24.0)));
resp.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Button, ui.is_enabled(), on, tip));
if resp.on_hover_text(tip).clicked() {
align_idx = i;
set_pstate(ui.ctx(), "tabs-align", i);
if let Some(s) = stops.get_mut(sel) {
@@ -154,7 +163,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
});
ui.add_space(4.0);
egui::Grid::new("tabs-grid").num_columns(2).spacing([6.0, 4.0]).show(ui, |ui| {
ui.label(egui::RichText::new("X:").color(t.text));
ui.label(egui::RichText::new(if vertical { "Y:" } else { "X:" }).color(t.text));
let x = stops.get(sel).map(|s| s.position);
if let Some(v) = widgets::spin_field(ui, "tabs-x", x, app.session.general_unit(), 90.0, 1.0, 0.0, &[])
&& let Some(i) = apply_moved(app, ui.ctx(), &mut stops, sel, v.max(0.0))
@@ -368,6 +377,60 @@ mod tests {
assert_eq!(back[1]["align"], json!("decimal"));
}
/// In vertical type the Left and Right alignment buttons are named Top-Justified Tab and
/// Bottom-Justified Tab, in their tool tips and for screen readers, and the position field is
/// labeled Y. Horizontal type keeps Left-Justified Tab, Right-Justified Tab and X.
#[test]
fn vertical_type_names_the_alignments_top_and_bottom_and_the_position_y() {
use crate::widgets::accessibility_tests::{role_and_state, tree};
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.session.execute("file.new", &json!({})).unwrap();
app.session.execute("text.create", &json!({"x": 10, "y": 20, "text": "a b", "area": {"width": 300, "height": 100}})).unwrap();
app.session.execute("text.tabs.set", &json!({"stops": [{"position": 50}]})).unwrap();
let horizontal = ["Left-Justified Tab", "Center-Justified Tab", "Right-Justified Tab", "Decimal-Justified Tab"];
let vertical = ["Top-Justified Tab", "Center-Justified Tab", "Bottom-Justified Tab", "Decimal-Justified Tab"];
for (names, other, axis, other_axis) in [(horizontal, vertical, "X:", "Y:"), (vertical, horizontal, "Y:", "X:")] {
if axis == "Y:" {
app.session.execute("type.orientation.vertical", &json!({})).unwrap();
}
// Screen readers find the four buttons by name, and the selected stop's alignment is pressed.
let nodes = tree(|ui| show(&mut app, ui));
for (i, name) in names.iter().enumerate() {
let pressed = if i == 0 { egui::accesskit::Toggled::True } else { egui::accesskit::Toggled::False };
assert_eq!(role_and_state(&nodes, name), (egui::accesskit::Role::Button, Some(pressed)), "{name}");
}
for name in other.iter().filter(|n| !names.contains(n)) {
assert!(!nodes.iter().any(|n| n.label() == Some(name)), "{name} with {axis}");
}
// Hovering each button shows its tool tip, and the panel shows the position field's label.
let ctx = egui::Context::default();
ctx.global_style_mut(|s| s.interaction.tooltip_delay = 0.0);
let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, vec2(400.0, 400.0));
let mut time = 0.0;
let mut frame = |app: &mut VectorcraftApp, events: Vec<egui::Event>| {
time += 0.5;
let input = egui::RawInput { time: Some(time), screen_rect: Some(screen), events, ..Default::default() };
let mut out = ctx.run_ui(input, |ui| show(app, ui));
out.textures_delta.clear();
out.shapes
.iter()
.filter_map(|c| match &c.shape {
egui::Shape::Text(t) => Some((t.galley.text().to_string(), t.visual_bounding_rect())),
_ => None,
})
.collect::<Vec<_>>()
};
let texts = frame(&mut app, vec![]);
assert!(texts.iter().any(|(t, _)| t == axis) && !texts.iter().any(|(t, _)| t == other_axis), "{axis} in {texts:?}");
for ((_, glyph), name) in ALIGNS.iter().zip(names) {
let at = texts.iter().find(|(t, _)| t == glyph).unwrap_or_else(|| panic!("{glyph} in {texts:?}")).1.center();
frame(&mut app, vec![egui::Event::PointerMoved(at)]);
let tips = (0..3).flat_map(|_| frame(&mut app, vec![])).collect::<Vec<_>>();
assert!(tips.iter().any(|(t, _)| t == name), "the tip {name} in {tips:?}");
}
}
}
/// #924: Leader and Align On keep what is typed, frame after frame, until Enter applies it
/// (spaces kept, eight characters at most).
#[test]
+1
View File
@@ -654,6 +654,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
The frames of threaded text share one Optical Margin Alignment setting: turning it on or off in one frame sets it in every frame, threading frames gives the thread its first frame's setting, and frames taken out of a thread keep it.
Type › Optical Margin Alignment (`type.opticalMarginAlignment`) hangs the punctuation and letter edges at the ends of a type object's lines outside its margins: at the left of left-aligned lines, at the right of right-aligned lines, and at both ends of centered and justified lines, in point and area type of left-to-right paragraphs. Quotation marks, hyphens, full stops and commas hang wholly; asterisks, tildes, ellipses, en and em dashes, colons and semicolons hang by half; and A, V, W, Y, v, w and y hang by a tenth of their width. It is off by default and saved with the type object.
The Paragraph panel menu's Hyphenation… (`ui.hyphenation`, `text.setFormat {wordsLongerThan, afterFirst, beforeLast, hyphenLimit, hyphenationZone, hyphenateCapitalized}`) sets each paragraph's hyphenation limits: the shortest word that breaks, the fewest letters on each side of the hyphen, the most hyphenated lines in a row, a zone at the right edge where the Single-line Composer breaks before a word instead of hyphenating it, and whether capitalized words break. The defaults are words longer than 5 letters, 3 letters on each side, no limit or zone, and capitalized words hyphenated; paragraph styles and the native file keep the options.
In vertical type, the Tabs panel names its alignment buttons Top-Justified Tab, Center-Justified Tab, Bottom-Justified Tab and Decimal-Justified Tab, in their tool tips and for screen readers, and labels the position field Y. In horizontal type the buttons keep the names Left-Justified Tab and Right-Justified Tab, and the field keeps the label X.
The Tabs panel's ruler is numbered in the General unit with the canvas rulers' label steps and a tick every tenth of a step. With the panel menu's Snap to Unit on, or Shift held, a tab stop placed by a click on the ruler or dragged on it lands on the nearest tick (`text.tabs.set`).
When a drag on the Tabs panel's ruler or a value typed in its X field moves a tab stop past another stop, the moved stop stays selected.
The Tabs panel menu's Clear All Tabs (`text.tabs.clear`), Delete Tab and Repeat Tab (`text.tabs.set`) can be chosen while the panel's ruler shows tab stops. Delete Tab removes the stop selected on the ruler. Repeat Tab replaces the stops after the selected stop with up to 20 copies of it. The copies are spaced by the selected stop's distance from the stop before it, or from the paragraph's left indent when it is the first stop, and no copy is placed at 2,000 pt or beyond. Clear All Tabs removes every stop, so the default stops every ½ inch apply again.