Merge pull request #5244 from dotCooCoo/feat/select-same-text-fill-stroke

Select: Same › Text Fill & Stroke Color selects type whose fill and stroke both match
This commit is contained in:
Brandon Thomas
2026-11-03 00:18:46 -05:00
committed by GitHub
32 changed files with 109 additions and 0 deletions
+9
View File
@@ -66,6 +66,15 @@ pub fn specs() -> Vec<CommandSpec> {
"select.same.textStrokeColor",
|a, b| a.stroke == b.stroke
)),
cmd!(
"select.same.textFillAndStrokeColor",
"Text Fill & Stroke Color",
["Select", "Same"],
None,
"{} select the type objects with characters whose fill and stroke both match the first character of the first selected type → {count}",
has_selection,
|s, _| same_text(s, "select.same.textFillAndStrokeColor", |a, b| a.fill == b.fill && a.stroke == b.stroke)
),
cmd!(
"select.object.directionHandles",
"Direction Handles",
+43
View File
@@ -1948,6 +1948,49 @@ fn select_same_font_size_and_fill() {
assert!(s.execute("select.same.fontSize", &json!({})).is_err());
}
/// Select › Same › Text Fill & Stroke Color selects the type with characters whose fill and stroke
/// both match the first character of the selected type: the same fill with another stroke, or the
/// same stroke with another fill, is left out, and in type with several runs one run has to match
/// both.
#[test]
fn select_same_text_fill_and_stroke_color_needs_both_to_match() {
let mut s = session();
let typed = |s: &mut Session, y: f64, fill: &str, stroke: &str| {
let id = id_of(&s.execute("text.create", &json!({"x": 0, "y": y, "text": "type"})).unwrap());
s.execute("text.setRangeStyle", &json!({"id": id.0, "start": 0, "end": 4, "fill": fill, "stroke": stroke})).unwrap();
id
};
let (red, blue, green) = ("#ff0000", "#0000ff", "#00ff00");
let a = typed(&mut s, 20.0, red, blue);
let both = typed(&mut s, 60.0, red, blue);
let same_fill = typed(&mut s, 100.0, red, green);
let same_stroke = typed(&mut s, 140.0, green, blue);
// Mixed runs: "ty" matches both; the other runs do not.
let mixed = typed(&mut s, 180.0, green, green);
s.execute("text.setRangeStyle", &json!({"id": mixed.0, "start": 0, "end": 2, "fill": red, "stroke": blue})).unwrap();
// Mixed runs where one run has the fill and another the stroke: no run matches both.
let split = typed(&mut s, 220.0, green, green);
s.execute("text.setRangeStyle", &json!({"id": split.0, "start": 0, "end": 2, "fill": red})).unwrap();
s.execute("text.setRangeStyle", &json!({"id": split.0, "start": 2, "end": 4, "stroke": blue})).unwrap();
let r = rect(&mut s, 300.0, 0.0, 5.0, 5.0);
s.execute("paint.setFill", &json!({"ids": [r.0], "color": red})).unwrap();
let undo = s.doc().unwrap().history.undo.len();
sel(&mut s, &[a]);
assert_eq!(s.execute("select.same.textFillAndStrokeColor", &json!({})).unwrap()["count"], 3);
assert_eq!(selected(&s), vec![a, both, mixed]);
assert_eq!(s.doc().unwrap().history.undo.len(), undo, "selecting adds no undo step");
// The single-attribute commands take the type that matches one of the two.
sel(&mut s, &[a]);
assert_eq!(s.execute("select.same.textFillColor", &json!({})).unwrap()["count"], 5);
assert_eq!(selected(&s), vec![a, both, same_fill, mixed, split]);
sel(&mut s, &[a]);
assert_eq!(s.execute("select.same.textStrokeColor", &json!({})).unwrap()["count"], 5);
assert_eq!(selected(&s), vec![a, both, same_stroke, mixed, split]);
// With no type selected the command reports it.
sel(&mut s, &[r]);
assert!(s.execute("select.same.textFillAndStrokeColor", &json!({})).is_err());
}
#[test]
fn select_same_link_block_series_selects_the_frames_of_a_thread() {
let mut s = session();
+1
View File
@@ -3306,6 +3306,7 @@ digits Malayalam Малаялам
Templates… Шаблони…
Text Displayed in Cell: Текст, показван в клетката:
Text Export Options Опции за експортиране на текст
Text Fill & Stroke Color Цвят на запълване и щрих на текста
Text Fill Color Цвят на запълване на текста
Text Import Options Опции за импортиране на текст
Text Stroke Color Цвят на щриха на текста
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -426,6 +426,7 @@
Variable Font Varijabilni font
Text Fill Color Boja ispune teksta
Text Stroke Color Boja poteza teksta
Text Fill & Stroke Color Boja ispune i poteza teksta
All on Same Layers Sve na istim slojevima
Direction Handles Ručke smjera
Brush Strokes Potezi četkicom
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -4225,6 +4225,7 @@ digits Malayalam Malaiàlam
Text Displayed in Cell Text mostrat a la cel·la
Text Displayed in Cell: Text mostrat a la cel·la:
Text Export Options Opcions d’exportació de text
Text Fill & Stroke Color Color de farciment i traç del text
Text Fill Color Color de farciment del text
Text Import Options Opcions d’importació de text
Text Orientation Orientació del text
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -434,6 +434,7 @@
Variable Font Variabilní písmo
Text Fill Color Barva výplně textu
Text Stroke Color Barva tahu textu
Text Fill & Stroke Color Barva výplně a tahu textu
All on Same Layers Vše ve stejných vrstvách
Direction Handles Směrové úchyty
Brush Strokes Tahy štětcem
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -393,6 +393,7 @@
Variable Font Variabel skrifttype
Text Fill Color Tekstfyldfarve
Text Stroke Color Tekststregfarve
Text Fill & Stroke Color Tekstfyld- og stregfarve
All on Same Layers Alt på samme lag
Direction Handles Retningshåndtag
Brush Strokes Penselstrøg
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -3334,6 +3334,7 @@ effect Points Punkte
Templates… Vorlagen…
Text Displayed in Cell: In der Zelle angezeigter Text:
Text Export Options Textexportoptionen
Text Fill & Stroke Color Flächen- und Konturfarbe des Texts
Text Fill Color Flächenfarbe des Texts
Text Import Options Textimportoptionen
Text Stroke Color Konturfarbe des Texts
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -3727,6 +3727,7 @@ digits Malayalam Μαλαγιάλαμ
Templates Folder Φάκελος προτύπων
Text Displayed in Cell: Κείμενο που εμφανίζεται στο κελί:
Text Export Options Επιλογές εξαγωγής κειμένου
Text Fill & Stroke Color Χρώμα γεμίσματος και περιγράμματος κειμένου
Text Fill Color Χρώμα γεμίσματος κειμένου
Text Import Options Επιλογές εισαγωγής κειμένου
Text Stroke Color Χρώμα περιγράμματος κειμένου
Can't render this file because it contains an unexpected character in line 163 and column 5.
+1
View File
@@ -3390,6 +3390,7 @@ digits Malayalam Malayálam
Templates… Plantillas…
Text Displayed in Cell: Texto mostrado en la celda:
Text Export Options Opciones de exportación de texto
Text Fill & Stroke Color Color de relleno y trazo del texto
Text Fill Color Color de relleno del texto
Text Import Options Opciones de importación de texto
Text Stroke Color Color de trazo del texto
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -431,6 +431,7 @@
Variable Font Muuttuva fontti
Text Fill Color Tekstin täyttöväri
Text Stroke Color Tekstin viivan väri
Text Fill & Stroke Color Tekstin täytön ja viivan väri
All on Same Layers Kaikki samoilla tasoilla
Direction Handles Suuntakahvat
Brush Strokes Sivellinviivat
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -3382,6 +3382,7 @@ digits Malayalam Malayalam
Templates… Modèles…
Text Displayed in Cell: Texte affiché dans la cellule :
Text Export Options Options d’exportation du texte
Text Fill & Stroke Color Couleur de fond et de contour du texte
Text Fill Color Couleur de fond du texte
Text Import Options Options d’importation du texte
Text Stroke Color Couleur de contour du texte
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -4043,6 +4043,7 @@ mark-style Japanese Japán
Text Displayed in Cell A cellában megjelenő szöveg
Text Displayed in Cell: A cellában megjelenő szöveg:
Text Export Options Szövegexportálási beállítások
Text Fill & Stroke Color Szöveg kitöltő- és körvonalszíne
Text Fill Color Szöveg kitöltőszíne
Text Import Options Szövegimportálási beállítások
Text Stroke Color Szöveg körvonalszíne
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -393,6 +393,7 @@
Variable Font Font variabel
Text Fill Color Warna isian teks
Text Stroke Color Warna stroke teks
Text Fill & Stroke Color Warna isian & stroke teks
All on Same Layers Semua di lapisan yang sama
Direction Handles Gagang arah
Brush Strokes Sapuan kuas
1 # Indonesian (id) catalog. Same format as zh-hant.tsv: context <TAB> source <TAB> translation
393
394
395
396
397
398
399
+1
View File
@@ -3426,6 +3426,7 @@ digits Malayalam Malayalam
Templates… Modelli…
Text Displayed in Cell: Testo visualizzato nella cella:
Text Export Options Opzioni di esportazione testo
Text Fill & Stroke Color Colore riempimento e traccia testo
Text Fill Color Colore riempimento testo
Text Import Options Opzioni di importazione testo
Text Stroke Color Colore traccia testo
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -463,6 +463,7 @@ digits Malayalam マラヤーラム数字
Variable Font バリアブルフォント
Text Fill Color テキストカラー (塗り)
Text Stroke Color テキストカラー (線)
Text Fill & Stroke Color テキストカラー (塗りと線)
All on Same Layers 同じレイヤー上のすべて
Direction Handles 方向線ハンドル
Brush Strokes ブラシストローク
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -350,6 +350,7 @@
Font Size შრიფტის ზომა
Text Fill Color ტექსტის შევსების ფერი
Text Stroke Color ტექსტის კონტურის ფერი
Text Fill & Stroke Color ტექსტის შევსებისა და კონტურის ფერი
All on Same Layers ყველა იმავე შრეებზე
Direction Handles მიმართულების სახელურები
Brush Strokes ფუნჯის შტრიხები
Can't render this file because it is too large.
+1
View File
@@ -456,6 +456,7 @@ digits Malayalam 말라얄람어
Variable Font 가변 글꼴
Text Fill Color 문자 칠 색상
Text Stroke Color 문자 선 색상
Text Fill & Stroke Color 문자 칠 및 선 색상
All on Same Layers 같은 레이어의 모두
Direction Handles 방향 핸들
Brush Strokes 브러시 선
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -407,6 +407,7 @@
Variable Font Variabel lettertype
Text Fill Color Tekstvulkleur
Text Stroke Color Tekstcontourkleur
Text Fill & Stroke Color Tekstvul- en contourkleur
All on Same Layers Alles op dezelfde lagen
Direction Handles Richtingsgrepen
Brush Strokes Penseelstreken
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -394,6 +394,7 @@
Variable Font Czcionka zmienna
Text Fill Color Kolor wypełnienia tekstu
Text Stroke Color Kolor obrysu tekstu
Text Fill & Stroke Color Kolor wypełnienia i obrysu tekstu
All on Same Layers Wszystko na tych samych warstwach
Direction Handles Uchwyty kierunkowe
Brush Strokes Pociągnięcia pędzla
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -2781,6 +2781,7 @@ digits Malayalam Malaiala
Templates… Modelos…
Text Displayed in Cell: Texto Exibido na Célula:
Text Export Options Opções de Exportação de Texto
Text Fill & Stroke Color Cor de Preenchimento e Traçado do Texto
Text Fill Color Cor de Preenchimento do Texto
Text Import Options Opções de Importação de Texto
Text Stroke Color Cor do Traçado do Texto
Can't render this file because it contains an unexpected character in line 6 and column 47.
+1
View File
@@ -3421,6 +3421,7 @@ digits Malayalam Малаялам
Templates… Шаблоны…
Text Displayed in Cell: Текст, отображаемый в ячейке:
Text Export Options Параметры экспорта текста
Text Fill & Stroke Color Цвет заливки и обводки текста
Text Fill Color Цвет заливки текста
Text Import Options Параметры импорта текста
Text Stroke Color Цвет обводки текста
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -3312,6 +3312,7 @@ digits Malayalam Malayalam
Templates… Mallar…
Text Displayed in Cell: Text som visas i cellen:
Text Export Options Alternativ för textexport
Text Fill & Stroke Color Textens fyllnads- och konturfärg
Text Fill Color Textens fyllnadsfärg
Text Import Options Alternativ för textimport
Text Stroke Color Textens konturfärg
Can't render this file because it contains an unexpected character in line 5 and column 25.
+1
View File
@@ -3205,6 +3205,7 @@ digits Malayalam Malayalam
Templates… Şablonlar…
Text Displayed in Cell: Hücrede Görüntülenen Metin:
Text Export Options Metin Dışa Aktarma Seçenekleri
Text Fill & Stroke Color Metin Dolgu ve Kontur Rengi
Text Fill Color Metin Dolgu Rengi
Text Import Options Metin İçe Aktarma Seçenekleri
Text Stroke Color Metin Kontur Rengi
Can't render this file because it contains an unexpected character in line 5 and column 25.
+1
View File
@@ -3419,6 +3419,7 @@ effect Points Точки
Templates… Шаблони…
Text Displayed in Cell: Текст, що відображається в комірці:
Text Export Options Параметри експорту тексту
Text Fill & Stroke Color Колір заливки та обведення тексту
Text Fill Color Колір заливки тексту
Text Import Options Параметри імпорту тексту
Text Stroke Color Колір обведення тексту
Can't render this file because it contains an unexpected character in line 177 and column 5.
+1
View File
@@ -3748,6 +3748,7 @@ mark-style Japanese Kiểu Nhật
Text Văn bản
Text Displayed in Cell: Văn bản hiển thị trong ô:
Text Export Options Tùy chọn xuất văn bản
Text Fill & Stroke Color Màu tô & nét văn bản
Text Fill Color Màu tô văn bản
Text Import Options Tùy chọn nhập văn bản
Text Stroke Color Màu nét văn bản
Can't render this file because it contains an unexpected character in line 199 and column 5.
+1
View File
@@ -3258,6 +3258,7 @@ digits Malayalam 马拉雅拉姆数字
Templates… 模板…
Text Displayed in Cell: 单元格中显示的文字:
Text Export Options 文本导出选项
Text Fill & Stroke Color 文字填色和描边颜色
Text Fill Color 文字填色
Text Import Options 文本导入选项
Text Stroke Color 文字描边颜色
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -4276,6 +4276,7 @@ digits Malayalam 馬來亞拉姆數字
Templates… 範本…
Text Displayed in Cell: 儲存格中顯示的文字:
Text Export Options 文字匯出選項
Text Fill & Stroke Color 文字填色與筆畫顏色
Text Fill Color 文字填色
Text Import Options 文字匯入選項
Text Stroke Color 文字筆畫顏色
Can't render this file because it contains an unexpected character in line 6 and column 47.
+22
View File
@@ -527,6 +527,28 @@ fn select_same_link_block_series_selects_a_thread_from_the_menu() {
assert_eq!(json!(ids), json!([a, b]));
}
#[test]
fn select_same_text_fill_and_stroke_color_follows_text_stroke_color_in_the_menu() {
let mut app = app_with_a_rectangle();
let entries = menu_entries(&app);
let at = |id: &str| entries.iter().position(|e| e.command.as_deref() == Some(id));
let entry = at("select.same.textFillAndStrokeColor").map(|i| &entries[i]).expect("menu entry");
assert_eq!((entry.path.clone(), entry.label.as_str()), (vec!["Select".to_string(), "Same".to_string()], "Text Fill & Stroke Color"));
assert_eq!(at("select.same.textStrokeColor").map(|i| i + 1), at("select.same.textFillAndStrokeColor"));
let text = |app: &mut VectorcraftApp, y: i32, fill: &str, stroke: &str| {
let id = app.run("text.create", json!({"x": 0, "y": y, "text": "type"})).unwrap()["id"].clone();
app.run("text.setRangeStyle", json!({"id": id.clone(), "start": 0, "end": 4, "fill": fill, "stroke": stroke})).unwrap();
id
};
let a = text(&mut app, 40, "#ff0000", "#0000ff");
let b = text(&mut app, 80, "#ff0000", "#0000ff");
let _ = text(&mut app, 120, "#ff0000", "#00ff00");
app.run("select.set", json!({"ids": [a.clone()]})).unwrap();
invoke(&mut app, "select.same.textFillAndStrokeColor", json!({}));
let ids: Vec<u64> = app.session.active().unwrap().selection.objects.iter().map(|i| i.0).collect();
assert_eq!(json!(ids), json!([a, b]));
}
#[test]
fn edit_selection_opens_its_dialog_on_the_saved_selections() {
let mut app = app_with_a_rectangle();
+1
View File
@@ -470,6 +470,7 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec<Item>)> {
c("Font Size", "select.same.fontSize"),
c("Text Fill Color", "select.same.textFillColor"),
c("Text Stroke Color", "select.same.textStrokeColor"),
c("Text Fill & Stroke Color", "select.same.textFillAndStrokeColor"),
],
),
sub(
+7
View File
@@ -1438,6 +1438,13 @@ everything in it, and `select.all`, `select.allOnArtboard` and `select.inverse`
among the objects beside it in its group or layer, passing over hidden and locked objects and sublayers. When there
is no such object, the selection stays as it is.
`select.same.textFillAndStrokeColor` (Select › Same › Text Fill & Stroke Color) selects the type objects that have
characters whose fill and stroke both match the first character of the first selected type, and returns `{count}`.
`select.same.textFillColor` and `select.same.textStrokeColor` compare the fill or the stroke alone. In type with
several runs, one run has to match both: type with the fill in one run and the stroke in another is left out. The fill
and stroke of other objects are not compared. Without type among the selected objects it returns the error "select a
text object", and it records no undo step.
## Shaper Groups
`shaper.releaseSource {source, group?}` takes the original shape `source` out of its Shaper Group: the shape becomes a
+1
View File
@@ -892,6 +892,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
Object › Rasterize on a frame of threaded text takes it out of the thread with the text it shows, which the image draws, and the other frames keep the text they hold. When the last frame is rasterized, the text it has no room for goes after the text of the last frame that stays.
Type › Create Outlines, Object › Expand and Object › Expand Appearance on a frame of threaded text take it out of the thread with the text it shows, which the outlines draw, and the other frames keep the text they hold. When the last frame is outlined, the text it has no room for goes after the text of the last frame that stays. When Expand Appearance keeps the frame as type in a group with its shadow, outer glow or Crop Marks, the type stays in the thread. The public help on threads ([Create text threads between objects](https://helpx.adobe.com/illustrator/desktop/design-with-text/add-manage-text/create-text-threads-between-objects.html), [Remove or break text threads between objects](https://helpx.adobe.com/illustrator/desktop/design-with-text/add-manage-text/remove-or-break-text-threads-between-objects.html)) does not describe outlining a threaded frame; this handling is VectorCraft's own behavior.
Select › Same › Link Block Series selects every frame of the threads of the selected type; type in no thread selects itself (`select.same.linkBlockSeries`). The menu entry is listed in [Select objects by characteristics](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects-by-characteristics.html); selecting several threads at once and type in no thread selecting itself are VectorCraft's own behavior.
Select › Same › Text Fill & Stroke Color selects the type whose characters match both the fill and the stroke of the selected type (`select.same.textFillAndStrokeColor`). The menu entry is listed in [Select objects by characteristics](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects-by-characteristics.html); requiring one run of characters to match both is VectorCraft's own behavior.
Object › Flatten Transparency takes a frame of threaded text out of the thread in the same way when Convert All Text to Outlines outlines it or when the frame becomes flat regions or an image, and the other frames keep the text they hold.
New Symbol and Redefine Symbol on a frame of threaded text take it out of the thread with the text it shows, which the symbol's art holds, and the other frames keep the text they hold. When the last frame goes into the symbol, the text it has no room for goes after the text of the last frame that stays. When every frame of a thread goes into the symbol, the copy of the last frame keeps all its text.
With Optical Margin Alignment on, or Roman Hanging Punctuation on in the first paragraph, the glyphs at the ends of left-to-right type on a path hang outside its brackets, measured along the path. The type hangs at the start bracket when its line is placed there, hangs at the end bracket when the line is placed there, and hangs at both when it is centered. Glyphs that hang past the end bracket do not make the type overflow, and a hang stops at an open path's end. SVG export writes such type as outlines.