From 734582bd81ae2166587886d4505da231298a3e98 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 07:28:58 -0800 Subject: [PATCH 1/4] Retype: the Retype panel lists the fonts that match outlined text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Window › Retype shows a panel that lists the fonts whose glyphs the selected outlined text exactly matches. Find Matching Fonts lists ten, ranked by how many shapes each matches and then by how closely, and Find more font matches adds the next five from the same search. Each row shows a sample in the font, at the size the panel menu sets (Small, Medium, Large) and with the text typed in the panel. A click on a row sets the font on the selected live type. Reset Retype Panel clears the list. - type.retypeFonts {count?} returns the ranked fonts without changing the document. It compares shapes with the glyphs of up to 96 loaded fonts, those of the document's live type first, by type.retype's matching. A shape counts once for each font it fits. Of two loaded versions of a font, only the version its name gives is compared. - RetypeIndex::all_matches returns every fit of a shape, so fonts past the first 16 fits are ranked too. - retype.find, retype.list, retype.preview and retype.reset drive the panel. - Rows for the panel's labels and the commands' errors in every complete catalog. The Retype row also translates the Type › Retype menu item. Docs: docs/mcp.md (Retype panel), docs/target-app-parity.md, docs/ui-parity.md, docs/gaps.md, docs/type-parity.md. Part of #4934. Builds on #8441. --- crates/engine/src/cmd.rs | 1 + crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + crates/engine/src/cmd/retype.rs | 3 + crates/engine/src/cmd/retype_fonts.rs | 141 ++++++++++ crates/engine/src/cmd/retype_fonts_tests.rs | 144 ++++++++++ crates/mcp/src/ui_catalog.rs | 24 ++ crates/text/src/retype.rs | 36 ++- crates/ui-egui/src/font_menu.rs | 11 + crates/ui-egui/src/i18n/bg.tsv | 12 + crates/ui-egui/src/i18n/bs.tsv | 12 + crates/ui-egui/src/i18n/ca.tsv | 12 + crates/ui-egui/src/i18n/cs.tsv | 12 + crates/ui-egui/src/i18n/da.tsv | 12 + crates/ui-egui/src/i18n/de.tsv | 12 + crates/ui-egui/src/i18n/el.tsv | 12 + crates/ui-egui/src/i18n/es.tsv | 12 + crates/ui-egui/src/i18n/fi.tsv | 12 + crates/ui-egui/src/i18n/fr.tsv | 12 + crates/ui-egui/src/i18n/gu.tsv | 12 + crates/ui-egui/src/i18n/hi.tsv | 12 + crates/ui-egui/src/i18n/hu.tsv | 12 + crates/ui-egui/src/i18n/id.tsv | 12 + crates/ui-egui/src/i18n/it.tsv | 12 + crates/ui-egui/src/i18n/ja.tsv | 12 + crates/ui-egui/src/i18n/ka.tsv | 12 + crates/ui-egui/src/i18n/ko.tsv | 12 + crates/ui-egui/src/i18n/nl.tsv | 12 + crates/ui-egui/src/i18n/pl.tsv | 12 + crates/ui-egui/src/i18n/pt-br.tsv | 12 + crates/ui-egui/src/i18n/ru.tsv | 12 + crates/ui-egui/src/i18n/sv.tsv | 12 + crates/ui-egui/src/i18n/tests.rs | 36 +++ crates/ui-egui/src/i18n/tr.tsv | 12 + crates/ui-egui/src/i18n/uk.tsv | 12 + crates/ui-egui/src/i18n/vi.tsv | 12 + crates/ui-egui/src/i18n/zh-hans.tsv | 12 + crates/ui-egui/src/i18n/zh-hant.tsv | 12 + crates/ui-egui/src/menus/run.rs | 1 + crates/ui-egui/src/menus/tree.rs | 1 + crates/ui-egui/src/menus/ui_commands.rs | 24 ++ crates/ui-egui/src/panels.rs | 3 + crates/ui-egui/src/panels/retype.rs | 258 ++++++++++++++++++ crates/ui-egui/src/panels/retype/tests.rs | 198 ++++++++++++++ crates/ui-egui/src/state.rs | 5 + docs/gaps.md | 2 +- docs/mcp.md | 33 +++ docs/target-app-parity.md | 4 + docs/type-parity.md | 2 +- docs/ui-parity.md | 3 +- 49 files changed, 1263 insertions(+), 4 deletions(-) create mode 100644 crates/engine/src/cmd/retype_fonts.rs create mode 100644 crates/engine/src/cmd/retype_fonts_tests.rs create mode 100644 crates/ui-egui/src/panels/retype.rs create mode 100644 crates/ui-egui/src/panels/retype/tests.rs diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index 926fd8713a..b42f5a230f 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -324,6 +324,7 @@ pub fn command_specs() -> &'static [CommandSpec] { v.extend(compoundshape::specs()); v.extend(typecmd::specs()); v.extend(retype::specs()); + v.extend(retype::fonts::specs()); v.extend(menucmds::specs()); v.extend(live::specs()); v.extend(colorcmds::specs()); diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index 2beda9c924..9cfc6d14a5 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -690,6 +690,7 @@ pub(super) const ALLOWED: &[&str] = &[ "type.resetHorizontalScale", "type.resetTracking", "type.retype", + "type.retypeFonts", "type.ruby", "type.scaleTextAttributes", "type.size.decrease", diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index 23774aaaa7..cb548bd46e 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -45,6 +45,9 @@ pub fn specs() -> Vec { )] } +#[path = "retype_fonts.rs"] +pub(super) mod fonts; + /// A shape to match: a path or compound path, in document space. struct Piece { id: NodeId, diff --git a/crates/engine/src/cmd/retype_fonts.rs b/crates/engine/src/cmd/retype_fonts.rs new file mode 100644 index 0000000000..57b3b57380 --- /dev/null +++ b/crates/engine/src/cmd/retype_fonts.rs @@ -0,0 +1,141 @@ +//! Retype's matching fonts (`type.retypeFonts`): the fonts whose glyphs the selected outlined text +//! is, ranked, for the Retype panel's list +//! (, +//! ). +//! The panel lists ten fonts and five more on request. Each selected glyph shape is compared with +//! the glyphs of up to 96 loaded fonts, those of the document's live type first, by the same +//! matching as `type.retype` (exact matches only). Of two versions of one font, only the version its +//! family and style name gives is compared. The order is VectorCraft's own: a font ranks by how many +//! of the shapes it matches, then by how closely, on average, and then by name. The query changes +//! nothing. + +use std::collections::BTreeSet; +use std::sync::Arc; + +use serde_json::{Value, json}; +use vectorcraft_text::FontDb; +use vectorcraft_text::retype::{RetypeIndex, shape_key}; + +use super::super::edit::selected_roots; +use super::super::{CommandSpec, EngineError, Result, Session, bad, cmd, has_selected_path}; +use super::{candidate_faces, collect}; + +pub(in crate::cmd) fn specs() -> Vec { + vec![cmd!( + query "type.retypeFonts", + "Find Matching Fonts", + [], + None, + "{count?: 1..96 (default 10)} the fonts whose glyphs the selected outlined text is, as the Retype panel lists them: each selected shape (paths and compound paths, inside groups too) is compared with the glyphs of up to 96 loaded fonts, those of the document's live type first, by type.retype's matching (exact matches only); of two versions of a font loaded at once, only the version its family and style name gives is compared, the one choosing the font sets; the fonts rank by how many shapes each matches, then by the mean distance left after fitting, then by family and style name; the document does not change → {fonts: [{family, style, matched (shapes it matches)}] (the first count), shapes (shapes compared), more (more fonts match than count), truncated (shapes past the limits were left out)}; a count that is not a whole number from 1 to 96 is an error", + has_selected_path, + retype_fonts + )] +} + +/// The fonts listed when `count` is left out. +pub(super) const DEFAULT_COUNT: usize = 10; +/// The most fonts one query lists: every face the matching indexes. +pub(super) const MAX_COUNT: usize = vectorcraft_text::retype::MAX_FACES; + +/// One font that matched some of the shapes. +struct Ranked { + face: Arc, + /// How many shapes it matched. + matched: usize, + /// The sum of those matches' leftover distances. + residual: f64, +} + +impl Ranked { + fn mean(&self) -> f64 { + self.residual / self.matched.max(1) as f64 + } +} + +pub(super) fn retype_fonts(s: &mut Session, p: &Value) -> Result { + retype_fonts_in(s, p, FontDb::global()) +} + +/// [`retype_fonts`] with the fonts of `db`. +fn retype_fonts_in(s: &mut Session, p: &Value, db: &FontDb) -> Result { + const C: &str = "type.retypeFonts"; + let count = match p.get("count") { + None | Some(Value::Null) => DEFAULT_COUNT, + Some(v) => v + .as_u64() + .and_then(|n| usize::try_from(n).ok()) + .filter(|n| (1..=MAX_COUNT).contains(n)) + .ok_or_else(|| bad(C, "`count` must be a whole number from 1 to 96"))?, + }; + let roots = selected_roots(s)?; + let d = &s.doc()?.doc; + let mut pieces = vec![]; + let (mut barrier, mut truncated) = (true, false); + for r in &roots { + if let Some(n) = d.node(*r) { + collect(n, d.parent_of(*r), 0, &mut barrier, &mut truncated, &mut pieces); + } + } + if pieces.is_empty() { + return Err(EngineError::Other("Retype: select outlined text (paths or compound paths)".into())); + } + // Only glyphs with a selected shape's key (segments per contour) can match one. + let wanted: BTreeSet = pieces.iter().filter_map(|pc| shape_key(&pc.path)).collect(); + // A font is chosen by its family and style, which set the version the name gives: of two + // versions of one font, only that one is compared. The other versions do not take the places + // of fonts loaded after them. + let by_name = |f: &Arc| db.face(&f.family, &f.style).is_some_and(|g| g.id() == f.id()); + let mut faces: Vec<_> = candidate_faces(db, d, &[]).into_iter().filter(by_name).collect(); + for f in db.loaded_faces() { + if faces.len() >= vectorcraft_text::retype::MAX_FACES { + break; + } + if by_name(&f) && !faces.iter().any(|k| k.id() == f.id()) { + faces.push(f); + } + } + // No shape has a key: no font is read. + let index = if wanted.is_empty() { RetypeIndex::default() } else { RetypeIndex::build(db, faces, &wanted) }; + // A shape's paint does not change which glyph it is: shapes that would stay outlines count too. + let mut ranked: Vec = vec![]; + for pc in &pieces { + // A shape can fit several glyphs or poses of one font: it counts once for the font, at its + // closest fit. + let mut best: Vec<(Arc, f64)> = vec![]; + for m in index.all_matches(&pc.path) { + match best.iter_mut().find(|(f, _)| f.id() == m.face.id()) { + Some(b) => b.1 = b.1.min(m.residual), + None => best.push((m.face, m.residual)), + } + } + for (face, residual) in best { + match ranked.iter_mut().find(|r| r.face.id() == face.id()) { + Some(r) => { + r.matched += 1; + r.residual += residual; + } + None => ranked.push(Ranked { face, matched: 1, residual }), + } + } + } + ranked.sort_by(|a, b| { + b.matched + .cmp(&a.matched) + .then(a.mean().total_cmp(&b.mean())) + .then_with(|| a.face.family.to_lowercase().cmp(&b.face.family.to_lowercase())) + .then_with(|| a.face.style.to_lowercase().cmp(&b.face.style.to_lowercase())) + .then(a.face.id().cmp(&b.face.id())) + }); + let more = ranked.len() > count; + ranked.truncate(count); + Ok(json!({ + "fonts": ranked.iter().map(|r| json!({"family": r.face.family, "style": r.face.style, "matched": r.matched})).collect::>(), + "shapes": pieces.len(), + "more": more, + "truncated": truncated, + })) +} + +#[cfg(test)] +#[path = "retype_fonts_tests.rs"] +mod tests; diff --git a/crates/engine/src/cmd/retype_fonts_tests.rs b/crates/engine/src/cmd/retype_fonts_tests.rs new file mode 100644 index 0000000000..2c10cba2ca --- /dev/null +++ b/crates/engine/src/cmd/retype_fonts_tests.rs @@ -0,0 +1,144 @@ +use std::sync::OnceLock; + +use serde_json::{Value, json}; +use vectorcraft_text::FontDb; + +use crate::Session; + +fn session() -> Session { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 600, "height": 400})).unwrap(); + s +} + +/// The bundled fonts alone: other tests add copies of them to the global database, and a copy +/// ties with its original, so the ranking is read against a database of its own. +fn bundled() -> &'static FontDb { + static DB: OnceLock = OnceLock::new(); + DB.get_or_init(|| FontDb::with_font_dirs(vec![])) +} + +/// `type.retypeFonts` with `params`, comparing the fonts of `db`. +fn query(s: &mut Session, params: Value, db: &FontDb) -> Value { + super::retype_fonts_in(s, ¶ms, db).unwrap() +} + +/// Point text, outlined: the id of the outlines' group. +fn outlined(s: &mut Session, p: Value) -> u64 { + let id = s.execute("text.create", &p).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap() +} + +fn names(r: &Value) -> Vec<(String, String, u64)> { + r["fonts"] + .as_array() + .unwrap() + .iter() + .map(|f| (f["family"].as_str().unwrap().to_string(), f["style"].as_str().unwrap().to_string(), f["matched"].as_u64().unwrap())) + .collect() +} + +#[test] +fn matching_fonts_rank_by_how_many_shapes_each_matches() { + let mut s = session(); + // Seven shapes in Source Sans 3 Bold, three in Source Serif 4. + let a = outlined(&mut s, json!({"x": 40, "y": 100, "text": "Ranking", "size": 30, "font": "Source Sans 3", "style": "Bold"})); + let b = outlined(&mut s, json!({"x": 40, "y": 200, "text": "Wxy", "size": 30, "font": "Source Serif 4", "style": "Regular"})); + s.execute("select.set", &json!({"ids": [a, b]})).unwrap(); + let before = s.doc().unwrap().doc.clone(); + let r = query(&mut s, json!({}), bundled()); + assert_eq!(r["shapes"], json!(10), "{r}"); + let fonts = names(&r); + assert_eq!(fonts.first(), Some(&("Source Sans 3".to_string(), "Bold".to_string(), 7)), "{r}"); + let serif = fonts.iter().position(|f| f.0 == "Source Serif 4" && f.1 == "Regular").expect("the serif is listed"); + assert_eq!(fonts[serif].2, 3, "{r}"); + // Each font once, and no font matches more shapes than one listed before it. + for (i, f) in fonts.iter().enumerate() { + assert!(!fonts[..i].iter().any(|g| g.0 == f.0 && g.1 == f.1), "{f:?} is listed twice: {r}"); + assert!(fonts[..i].iter().all(|g| g.2 >= f.2), "{f:?} ranks after a font that matches fewer shapes: {r}"); + } + assert_eq!(r["truncated"], json!(false)); + // The command: a query, so the document stays as it was, and there is no undo step for it. + let r = s.execute("type.retypeFonts", &json!({})).unwrap(); + assert_eq!(r["shapes"], json!(10), "{r}"); + assert!(s.doc().unwrap().doc == before, "nothing changes"); + s.execute("edit.undo", &json!({})).unwrap(); + assert!(s.doc().unwrap().doc != before, "undo takes back the last outlining, not the query"); +} + +#[test] +fn count_lists_the_first_fonts_and_more_says_others_match() { + let mut s = session(); + let a = outlined(&mut s, json!({"x": 40, "y": 100, "text": "Aa", "size": 30, "font": "Source Sans 3", "style": "Regular"})); + let b = outlined(&mut s, json!({"x": 40, "y": 200, "text": "B", "size": 30, "font": "Source Serif 4", "style": "Regular"})); + s.execute("select.set", &json!({"ids": [a, b]})).unwrap(); + let all = query(&mut s, json!({"count": 96}), bundled()); + assert!(names(&all).len() >= 2, "{all}"); + assert_eq!(all["more"], json!(false), "{all}"); + let one = query(&mut s, json!({"count": 1}), bundled()); + assert_eq!(names(&one), vec![("Source Sans 3".to_string(), "Regular".to_string(), 2)], "{one}"); + assert_eq!(one["more"], json!(true), "{one}"); + assert_eq!(query(&mut s, json!({"count": null}), bundled()), query(&mut s, json!({}), bundled())); +} + +#[test] +fn a_count_that_is_not_a_whole_number_from_1_to_96_is_an_error() { + let mut s = session(); + let a = outlined(&mut s, json!({"x": 40, "y": 100, "text": "A", "size": 30})); + s.execute("select.set", &json!({"ids": [a]})).unwrap(); + for bad in [json!(0), json!(97), json!(-1), json!(2.5), json!("10"), json!(true)] { + let e = s.execute("type.retypeFonts", &json!({"count": bad})).unwrap_err().to_string(); + assert!(e.contains("`count` must be a whole number from 1 to 96"), "{bad}: {e}"); + } +} + +#[test] +fn shapes_that_are_no_glyph_list_no_font() { + let mut s = session(); + let rect = s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 80, "height": 40})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [rect]})).unwrap(); + let r = query(&mut s, json!({}), bundled()); + assert_eq!(r, json!({"fonts": [], "shapes": 1, "more": false, "truncated": false})); + // Live type alone holds no shape to compare. + let t = s.execute("text.create", &json!({"x": 10, "y": 100, "text": "live"})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [t]})).unwrap(); + assert!(s.execute("type.retypeFonts", &json!({})).is_err()); +} + +/// Two versions of one font: choosing the font by name sets the version the name gives, so only +/// that version is compared, and a font whose other version alone matches is not listed. +#[test] +fn of_two_versions_only_the_one_the_name_gives_is_listed() { + use vectorcraft_text::test_fonts::named_copy; + const FAMILY: &str = "Versiontest Sans"; + // A database of its own, so that no other test sees these fonts. + let db = FontDb::with_font_dirs(vec![]); + // The first version loaded (Source Sans 3's glyphs) is the one the name gives. + db.add_font(named_copy(false, (FAMILY, "Regular", "Version 1.000", "VersiontestSans-Regular")).unwrap()); + db.add_font(named_copy(true, (FAMILY, "Regular", "Version 2.000", "VersiontestSans-Regular")).unwrap()); + assert_eq!(db.face(FAMILY, "Regular").unwrap().version, "Version 1.000"); + let mut s = session(); + let inter = outlined(&mut s, json!({"x": 40, "y": 100, "text": "Kg", "size": 40, "font": "Inter", "style": "Regular"})); + s.execute("select.set", &json!({"ids": [inter]})).unwrap(); + let r = query(&mut s, json!({"count": 96}), &db); + let fonts = names(&r); + assert!(fonts.iter().any(|f| f.0 == "Inter"), "{r}"); + assert!(!fonts.iter().any(|f| f.0 == FAMILY), "version 2 matches, but choosing the font sets version 1: {r}"); + let source = outlined(&mut s, json!({"x": 40, "y": 200, "text": "Kg", "size": 40, "font": "Source Sans 3", "style": "Regular"})); + s.execute("select.set", &json!({"ids": [source]})).unwrap(); + let r = query(&mut s, json!({"count": 96}), &db); + assert_eq!(names(&r).iter().filter(|f| f.0 == FAMILY).count(), 1, "version 1 matches and is listed once: {r}"); +} + +#[test] +fn shapes_that_stay_outlines_still_name_their_font() { + // A glyph with paint type cannot take (two fills) is not retyped, but it is still that font's glyph. + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "M", "size": 40, "font": "Source Serif 4", "style": "Regular"})); + let glyph = s.doc().unwrap().doc.node(vectorcraft_doc::NodeId(g)).unwrap().children().unwrap()[0].id.0; + s.execute("select.set", &json!({"ids": [glyph]})).unwrap(); + s.execute("appearance.addFill", &json!({})).unwrap(); + let r = query(&mut s, json!({}), bundled()); + assert_eq!(names(&r).first().map(|f| (f.0.as_str(), f.1.as_str())), Some(("Source Serif 4", "Regular")), "{r}"); +} diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 7ca1aa679e..e31c6d850b 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -780,6 +780,30 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} clear the Learn panel's progress, every tutorial finished and every step marked done, as Reset progress under the list of skills does; open documents, opened practice samples and the Learn view stay as they are; returns what learn.list returns", ), + ( + "retype.find", + "Find Matching Fonts", + "", + "{more?: bool} show the Retype panel and list the fonts whose glyphs the selected outlined text is, ranked as type.retypeFonts ranks them: ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a selection with no path or compound path, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", + ), + ( + "retype.list", + "List Matching Fonts", + "", + "{} what the Retype panel shows: {searched (a search ran since the last reset), fonts: [{family, style, matched (shapes it matches)}], shapes (shapes the last search compared), more (more fonts match than the list holds), size: small|medium|large, text (the samples' text; empty for a generic sample)}", + ), + ( + "retype.preview", + "Retype Preview", + "", + "{size?: small|medium|large, text?: string} the size of the Retype panel's samples, as its panel menu sets it, and the text they show, as its sample field sets it (at most 100 characters; empty for a generic sample); any other value is an error and changes nothing; returns what retype.list returns", + ), + ( + "retype.reset", + "Reset Retype Panel", + "", + "{} clear the Retype panel's list of matching fonts, as Reset Retype Panel in its panel menu does; the samples' size and text stay; returns what retype.list returns", + ), ("window.brightness", "UI Brightness", "", "{brightness: dark|mediumDark|mediumLight|light}"), ( "window.workspace", diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs index 4c636aa1cd..d7c7be71d6 100644 --- a/crates/text/src/retype.rs +++ b/crates/text/src/retype.rs @@ -187,6 +187,14 @@ impl RetypeIndex { /// the upright-most comes first and the others are kept in [`GlyphMatch::alts`]. The line /// around the shape chooses among them. At most [`MAX_CANDIDATES`]. pub fn matches(&self, shape: &BezPath) -> Vec { + let mut out = self.all_matches(shape); + out.truncate(MAX_CANDIDATES); + out + } + + /// Every glyph `shape` fits exactly, in every face, in the order of [`RetypeIndex::matches`], + /// which returns the first [`MAX_CANDIDATES`] of them. + pub fn all_matches(&self, shape: &BezPath) -> Vec { let variants = signatures(shape, true); let Some(first) = variants.first() else { return vec![] }; let Some(list) = self.buckets.get(&first.contours) else { return vec![] }; @@ -247,7 +255,6 @@ impl RetypeIndex { out.sort_by(|a, b| { upright(&a.1).cmp(&upright(&b.1)).then(a.1.residual.total_cmp(&b.1.residual)).then(a.0.cmp(&b.0)).then(a.1.ch.cmp(&b.1.ch)) }); - out.truncate(MAX_CANDIDATES); out.into_iter().map(|(_, m)| m).collect() } } @@ -908,4 +915,31 @@ mod tests { assert!(!outlines_agree(&square, &bow, 1.0), "every corner lies on the other, the edges do not"); assert!(outlines_agree(&square, &square, 1.0)); } + + /// A glyph that more than [`MAX_CANDIDATES`] faces share: `matches` gives the first + /// [`MAX_CANDIDATES`] fits, and `all_matches` gives the fits in every face. + #[test] + fn all_matches_lists_every_face_a_shape_fits() { + let db = FontDb::with_font_dirs(vec![]); + let copies = MAX_CANDIDATES + 4; + let mut faces = vec![]; + for i in 0..copies { + let (family, postscript) = (format!("Copytest {i:02}"), format!("Copytest{i:02}-Regular")); + assert_eq!(db.add_font(crate::test_fonts::named_copy(false, (&family, "Regular", "Version 1.000", &postscript)).unwrap()), 1); + faces.push(db.face(&family, "Regular").unwrap()); + } + let face = faces[0].clone(); + let shape = Affine::scale(0.03) * db.outline_uncached(&face, face.glyph_for('o')); + let keys = std::iter::once(shape_key(&shape).unwrap()).collect(); + let index = RetypeIndex::build(&db, faces, &keys); + let ids = |ms: &[GlyphMatch]| ms.iter().map(|m| m.face.id()).collect::>().len(); + assert_eq!(index.matches(&shape).len(), MAX_CANDIDATES); + assert!(ids(&index.matches(&shape)) < copies); + let all = index.all_matches(&shape); + assert_eq!(ids(&all), copies, "every copy of the font fits the o"); + assert_eq!( + all[..MAX_CANDIDATES].iter().map(|m| m.face.id()).collect::>(), + index.matches(&shape).iter().map(|m| m.face.id()).collect::>() + ); + } } diff --git a/crates/ui-egui/src/font_menu.rs b/crates/ui-egui/src/font_menu.rs index 855bc3a3f4..f7a4b5cbaf 100644 --- a/crates/ui-egui/src/font_menu.rs +++ b/crates/ui-egui/src/font_menu.rs @@ -1874,6 +1874,17 @@ pub(crate) fn menu_item_sample(ui: &Ui, slot: egui::Rect, family: &str, on_white } } +/// A sample of `family` in `style` drawn in `slot`: `text` set in it (a generic sample when it is +/// `None` or the font lacks its characters), filling the slot's height (the Retype panel's rows). +/// With `on_white` (Show samples on white), the sample is drawn in dark type on a white slot. +pub(crate) fn styled_sample(ui: &Ui, slot: egui::Rect, family: &str, style: &str, text: Option<&str>, on_white: bool) { + let ink = sample_ink(on_white, Tokens::get(ui.ctx()).text); + let area = sample_area(ui, slot, ink, PAPER_INSET); + if let Some(tex) = sample_texture(ui.ctx(), family, Some(style), text, area.height()) { + paint_sample(ui, area, &tex, ink); + } +} + /// What a sample is drawn on with Show samples on white. pub(crate) const SAMPLE_PAPER: Color32 = Color32::WHITE; diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 056fbd715b..770765ff13 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -1256,6 +1256,18 @@ font-technology Variable Променливи Find and Replace… Търсене и замяна… Find Font Търсене на шрифт Find Font… Търсене на шрифт… + Retype Повторно набиране + Find Matching Fonts Търсене на съответстващи шрифтове + Find more font matches Търсене на още съответстващи шрифтове + Type your text to preview Въведете текст за преглед + Select outlined text, then Find Matching Fonts. Изберете текст, превърнат в контури, след това „Търсене на съответстващи шрифтове“. + No font matches the selected shapes. Никой шрифт не съответства на избраните фигури. + Reset Retype Panel Нулиране на панела „Повторно набиране“ + List Matching Fonts Списък на съответстващите шрифтове + Retype Preview Преглед в панела „Повторно набиране“ +@msg `count` must be a whole number from 1 to 96 `count` трябва да е цяло число от 1 до 96 +@msg `size` must be small, medium or large `size` трябва да е small, medium или large +@msg `text` must be a string of at most 100 characters `text` трябва да е низ с най-много 100 знака Find Next Търсене на следващ Find Objects Търсене на обекти Compare with Image Сравняване с изображение diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index e6c0ccce78..79dc8c7ce5 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -422,6 +422,18 @@ Break Thread Prekini nit Fit Headline Uklopi naslov Find Font… Pronađi font… + Retype Ponovo otkucaj + Find Matching Fonts Pronađi odgovarajuće fontove + Find more font matches Pronađi još odgovarajućih fontova + Type your text to preview Upišite tekst za pregled + Select outlined text, then Find Matching Fonts. Odaberite tekst pretvoren u obrise, zatim Pronađi odgovarajuće fontove. + No font matches the selected shapes. Nijedan font ne odgovara odabranim oblicima. + Reset Retype Panel Vrati panel Ponovo otkucaj na početno + List Matching Fonts Prikaži odgovarajuće fontove + Retype Preview Pregled u panelu Ponovo otkucaj +@msg `count` must be a whole number from 1 to 96 `count` mora biti cijeli broj od 1 do 96 +@msg `size` must be small, medium or large `size` mora biti small, medium ili large +@msg `text` must be a string of at most 100 characters `text` mora biti niz od najviše 100 znakova Change Case Promijeni veličinu slova UPPERCASE VELIKA SLOVA lowercase mala slova diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 77183ad8c7..26f1538c1a 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1773,6 +1773,18 @@ digits Malayalam Malaiàlam Find Fonts Cerca tipus de lletra Find Fonts in Folder… Cerca tipus de lletra en una carpeta… Find Font… Cerca un tipus de lletra… + Retype Torna a escriure + Find Matching Fonts Cerca tipus de lletra coincidents + Find more font matches Cerca més tipus de lletra coincidents + Type your text to preview Escriviu el text de la previsualització + Select outlined text, then Find Matching Fonts. Seleccioneu text contornejat i després Cerca tipus de lletra coincidents. + No font matches the selected shapes. Cap tipus de lletra no coincideix amb les formes seleccionades. + Reset Retype Panel Restableix el panell Torna a escriure + List Matching Fonts Llista els tipus de lletra coincidents + Retype Preview Previsualització del panell Torna a escriure +@msg `count` must be a whole number from 1 to 96 `count` ha de ser un nombre enter entre 1 i 96 +@msg `size` must be small, medium or large `size` ha de ser small, medium o large +@msg `text` must be a string of at most 100 characters `text` ha de ser una cadena de 100 caràcters com a màxim Find in Folder… Cerca en una carpeta… Find Linked Files Cerca fitxers enllaçats Find Linked Files in Folder… Cerca fitxers enllaçats en una carpeta… diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 869e47483f..0c612dcd49 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -427,6 +427,18 @@ Break Thread Přerušit zřetězení Fit Headline Přizpůsobit titulek Find Font… Najít písmo… + Retype Přepsat + Find Matching Fonts Najít odpovídající písma + Find more font matches Najít další odpovídající písma + Type your text to preview Zadejte text pro náhled + Select outlined text, then Find Matching Fonts. Vyberte text převedený na křivky a pak zvolte Najít odpovídající písma. + No font matches the selected shapes. Vybraným tvarům neodpovídá žádné písmo. + Reset Retype Panel Obnovit panel Přepsat + List Matching Fonts Vypsat odpovídající písma + Retype Preview Náhled v panelu Přepsat +@msg `count` must be a whole number from 1 to 96 `count` musí být celé číslo od 1 do 96 +@msg `size` must be small, medium or large `size` musí být small, medium nebo large +@msg `text` must be a string of at most 100 characters `text` musí být řetězec o nejvýše 100 znacích Change Case Změnit velikost písmen UPPERCASE VELKÁ PÍSMENA lowercase malá písmena diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index a2966f09f1..b5cdb6268d 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3121,6 +3121,18 @@ liquify-list-end {0}, {1} {0} og {1} Break Thread Bryd sammenkædning Fit Headline Tilpas overskrift Find Font… Find skrifttype… + Retype Genindtast + Find Matching Fonts Find matchende skrifttyper + Find more font matches Find flere matchende skrifttyper + Type your text to preview Skriv teksten til forhåndsvisningen + Select outlined text, then Find Matching Fonts. Markér tekst konverteret til konturer, og vælg derefter Find matchende skrifttyper. + No font matches the selected shapes. Ingen skrifttype matcher de markerede former. + Reset Retype Panel Nulstil panelet Genindtast + List Matching Fonts Vis matchende skrifttyper + Retype Preview Forhåndsvisning i panelet Genindtast +@msg `count` must be a whole number from 1 to 96 `count` skal være et heltal fra 1 til 96 +@msg `size` must be small, medium or large `size` skal være small, medium eller large +@msg `text` must be a string of at most 100 characters `text` skal være en streng på højst 100 tegn Change Case Ændr store/små bogstaver UPPERCASE STORE BOGSTAVER lowercase små bogstaver diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index bef5d6b62f..876b2fec3b 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1295,6 +1295,18 @@ font-technology Variable Variabel Find and Replace… Suchen und ersetzen… Find Font Schrift suchen Find Font… Schrift suchen… + Retype Neu setzen + Find Matching Fonts Passende Schriften suchen + Find more font matches Weitere passende Schriften suchen + Type your text to preview Text für die Vorschau eingeben + Select outlined text, then Find Matching Fonts. Wählen Sie in Pfade umgewandelten Text aus und dann „Passende Schriften suchen“. + No font matches the selected shapes. Keine Schrift passt zu den ausgewählten Formen. + Reset Retype Panel Bedienfeld „Neu setzen“ zurücksetzen + List Matching Fonts Passende Schriften auflisten + Retype Preview Vorschau im Bedienfeld „Neu setzen“ +@msg `count` must be a whole number from 1 to 96 `count` muss eine ganze Zahl von 1 bis 96 sein +@msg `size` must be small, medium or large `size` muss small, medium oder large sein +@msg `text` must be a string of at most 100 characters `text` muss eine Zeichenfolge mit höchstens 100 Zeichen sein Find Next Weitersuchen Find Objects Objekte suchen Compare with Image Mit Bild vergleichen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index cf4ef52e41..14e0b3f349 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -1245,6 +1245,18 @@ font-technology Variable Μεταβλητές Find and Replace… Εύρεση και αντικατάσταση… Find Font Εύρεση γραμματοσειράς Find Font… Εύρεση γραμματοσειράς… + Retype Επαναπληκτρολόγηση + Find Matching Fonts Εύρεση αντίστοιχων γραμματοσειρών + Find more font matches Εύρεση περισσότερων αντίστοιχων γραμματοσειρών + Type your text to preview Πληκτρολογήστε κείμενο για προεπισκόπηση + Select outlined text, then Find Matching Fonts. Επιλέξτε κείμενο που έχει μετατραπεί σε περιγράμματα και μετά Εύρεση αντίστοιχων γραμματοσειρών. + No font matches the selected shapes. Καμία γραμματοσειρά δεν αντιστοιχεί στα επιλεγμένα σχήματα. + Reset Retype Panel Επαναφορά πίνακα Επαναπληκτρολόγησης + List Matching Fonts Λίστα αντίστοιχων γραμματοσειρών + Retype Preview Προεπισκόπηση πίνακα Επαναπληκτρολόγησης +@msg `count` must be a whole number from 1 to 96 Το `count` πρέπει να είναι ακέραιος από 1 έως 96 +@msg `size` must be small, medium or large Το `size` πρέπει να είναι small, medium ή large +@msg `text` must be a string of at most 100 characters Το `text` πρέπει να είναι συμβολοσειρά έως 100 χαρακτήρων Find Next Εύρεση επόμενου Find Objects Εύρεση αντικειμένων Compare with Image Σύγκριση με εικόνα diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index d3ead234fd..ff7efbdc0a 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1320,6 +1320,18 @@ font-technology Variable Variables Find and Replace… Buscar y reemplazar… Find Font Buscar fuente Find Font… Buscar fuente… + Retype Reescribir + Find Matching Fonts Buscar fuentes coincidentes + Find more font matches Buscar más fuentes coincidentes + Type your text to preview Escriba el texto de la vista previa + Select outlined text, then Find Matching Fonts. Seleccione texto contorneado y luego Buscar fuentes coincidentes. + No font matches the selected shapes. Ninguna fuente coincide con las formas seleccionadas. + Reset Retype Panel Restablecer panel Reescribir + List Matching Fonts Enumerar fuentes coincidentes + Retype Preview Vista previa del panel Reescribir +@msg `count` must be a whole number from 1 to 96 `count` debe ser un número entero entre 1 y 96 +@msg `size` must be small, medium or large `size` debe ser small, medium o large +@msg `text` must be a string of at most 100 characters `text` debe ser una cadena de 100 caracteres como máximo Find Next Buscar siguiente Find Objects Buscar objetos Compare with Image Comparar con imagen diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 06a710fbca..15f180ef74 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -424,6 +424,18 @@ Break Thread Katkaise ketjutus Fit Headline Sovita otsikko Find Font… Etsi fontti… + Retype Kirjoita uudelleen + Find Matching Fonts Etsi vastaavat fontit + Find more font matches Etsi lisää vastaavia fontteja + Type your text to preview Kirjoita esikatseltava teksti + Select outlined text, then Find Matching Fonts. Valitse ääriviivoiksi muunnettu teksti ja sitten Etsi vastaavat fontit. + No font matches the selected shapes. Mikään fontti ei vastaa valittuja muotoja. + Reset Retype Panel Palauta Kirjoita uudelleen -paneeli + List Matching Fonts Luettele vastaavat fontit + Retype Preview Kirjoita uudelleen -paneelin esikatselu +@msg `count` must be a whole number from 1 to 96 `count` on oltava kokonaisluku 1–96 +@msg `size` must be small, medium or large `size` on oltava small, medium tai large +@msg `text` must be a string of at most 100 characters `text` on oltava enintään 100 merkin merkkijono Change Case Vaihda kirjainkoko UPPERCASE ISOT KIRJAIMET lowercase pienet kirjaimet diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 60bc389a9a..b6b2b31e99 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1310,6 +1310,18 @@ font-technology Variable Variables Find and Replace… Rechercher et remplacer… Find Font Rechercher une police Find Font… Rechercher une police… + Retype Retaper + Find Matching Fonts Rechercher les polices correspondantes + Find more font matches Rechercher d’autres polices correspondantes + Type your text to preview Saisissez le texte à prévisualiser + Select outlined text, then Find Matching Fonts. Sélectionnez du texte vectorisé, puis Rechercher les polices correspondantes. + No font matches the selected shapes. Aucune police ne correspond aux formes sélectionnées. + Reset Retype Panel Réinitialiser le panneau Retaper + List Matching Fonts Lister les polices correspondantes + Retype Preview Aperçu du panneau Retaper +@msg `count` must be a whole number from 1 to 96 `count` doit être un nombre entier compris entre 1 et 96 +@msg `size` must be small, medium or large `size` doit valoir small, medium ou large +@msg `text` must be a string of at most 100 characters `text` doit être une chaîne d’au plus 100 caractères Find Next Rechercher le suivant Find Objects Rechercher des objets Compare with Image Comparer à une image diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 139a5b2db9..e227b293a2 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -1429,6 +1429,18 @@ Find Fonts ફૉન્ટ્સ શોધો Find Fonts in Folder… ફોલ્ડરમાં ફૉન્ટ્સ શોધો… Find Font… ફૉન્ટ શોધો… + Retype ફરી ટાઇપ કરો + Find Matching Fonts મેળ ખાતા ફૉન્ટ શોધો + Find more font matches વધુ મેળ ખાતા ફૉન્ટ શોધો + Type your text to preview પૂર્વાવલોકન માટે તમારું લખાણ ટાઇપ કરો + Select outlined text, then Find Matching Fonts. આઉટલાઇન કરેલું લખાણ પસંદ કરો, પછી મેળ ખાતા ફૉન્ટ શોધો. + No font matches the selected shapes. કોઈ ફૉન્ટ પસંદ કરેલા આકારો સાથે મેળ ખાતો નથી. + Reset Retype Panel ફરી ટાઇપ કરો પેનલ રીસેટ કરો + List Matching Fonts મેળ ખાતા ફૉન્ટની યાદી + Retype Preview ફરી ટાઇપ કરો પેનલનું પૂર્વાવલોકન +@msg `count` must be a whole number from 1 to 96 `count` 1 થી 96 સુધીની પૂર્ણ સંખ્યા હોવી જોઈએ +@msg `size` must be small, medium or large `size` small, medium અથવા large હોવું જોઈએ +@msg `text` must be a string of at most 100 characters `text` વધુમાં વધુ 100 અક્ષરોની સ્ટ્રિંગ હોવી જોઈએ Find In આમાં શોધો Find Linked Files લિંક્ડ ફાઇલો શોધો Find Linked Files in Folder… ફોલ્ડરમાં લિંક્ડ ફાઇલો શોધો… diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 0ca6ee299a..050151cabf 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1965,6 +1965,18 @@ antiAlias Sharp शार्प Find Font फ़ॉन्ट खोजें Find Font Files फ़ॉन्ट फ़ाइल का पता लगाएं Find Font… फ़ॉन्ट खोजें… + Retype फिर से टाइप करें + Find Matching Fonts मिलते-जुलते फ़ॉन्ट खोजें + Find more font matches और मिलते-जुलते फ़ॉन्ट खोजें + Type your text to preview प्रीव्यू के लिए अपना टेक्स्ट टाइप करें + Select outlined text, then Find Matching Fonts. आउटलाइन किया गया टेक्स्ट चुनें, फिर मिलते-जुलते फ़ॉन्ट खोजें। + No font matches the selected shapes. कोई फ़ॉन्ट चुने गए आकारों से मेल नहीं खाता। + Reset Retype Panel फिर से टाइप करें पैनल रीसेट करें + List Matching Fonts मिलते-जुलते फ़ॉन्ट की सूची + Retype Preview फिर से टाइप करें पैनल का प्रीव्यू +@msg `count` must be a whole number from 1 to 96 `count` 1 से 96 तक पूरी संख्या होना चाहिए +@msg `size` must be small, medium or large `size` को small, medium या large होना चाहिए +@msg `text` must be a string of at most 100 characters `text` अधिकतम 100 वर्णों की स्ट्रिंग होनी चाहिए Find Fonts फाइंड फ़ॉन्ट Find Fonts in Folder… फ़ोल्डर में फ़ॉन्ट खोजें… Find in Folder… फ़ोल्डर में खोजें… diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 79d6bcb16d..3318e5b8d3 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -1635,6 +1635,18 @@ digits Malayalam Malajálam Find Fonts Betűtípusok keresése Find Fonts in Folder… Betűtípusok keresése mappában… Find Font… Betűtípus keresése… + Retype Újragépelés + Find Matching Fonts Egyező betűtípusok keresése + Find more font matches További egyező betűtípusok keresése + Type your text to preview Írja be az előnézet szövegét + Select outlined text, then Find Matching Fonts. Jelöljön ki körvonalakká alakított szöveget, majd válassza az Egyező betűtípusok keresése parancsot. + No font matches the selected shapes. Egyik betűtípus sem egyezik a kijelölt alakzatokkal. + Reset Retype Panel Újragépelés panel visszaállítása + List Matching Fonts Egyező betűtípusok listázása + Retype Preview Újragépelés panel előnézete +@msg `count` must be a whole number from 1 to 96 `count`: 1 és 96 közötti egész szám kell +@msg `size` must be small, medium or large `size`: small, medium vagy large kell +@msg `text` must be a string of at most 100 characters `text`: legfeljebb 100 karakteres karakterlánc kell Find in Folder… Keresés mappában… Find Next Következő keresése Find Objects Objektumok keresése diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 63d3c06972..bc00f25fe9 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -390,6 +390,18 @@ Break Thread Putus rangkaian Fit Headline Sesuaikan judul Find Font… Cari font… + Retype Ketik Ulang + Find Matching Fonts Temukan font yang cocok + Find more font matches Temukan lebih banyak font yang cocok + Type your text to preview Ketik teks untuk pratinjau + Select outlined text, then Find Matching Fonts. Pilih teks yang sudah dijadikan kerangka, lalu Temukan font yang cocok. + No font matches the selected shapes. Tidak ada font yang cocok dengan bentuk yang dipilih. + Reset Retype Panel Setel ulang panel Ketik Ulang + List Matching Fonts Daftar font yang cocok + Retype Preview Pratinjau panel Ketik Ulang +@msg `count` must be a whole number from 1 to 96 `count` harus bilangan bulat dari 1 sampai 96 +@msg `size` must be small, medium or large `size` harus small, medium, atau large +@msg `text` must be a string of at most 100 characters `text` harus string dengan paling banyak 100 karakter Change Case Ubah huruf besar-kecil UPPERCASE HURUF BESAR lowercase huruf kecil diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index e4ca09e0ea..4df75bd87a 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1332,6 +1332,18 @@ font-technology Variable Variabili Find and Replace… Trova e sostituisci… Find Font Trova font Find Font… Trova font… + Retype Ridigita + Find Matching Fonts Trova font corrispondenti + Find more font matches Trova altri font corrispondenti + Type your text to preview Digita il testo dell’anteprima + Select outlined text, then Find Matching Fonts. Seleziona testo vettorializzato, poi Trova font corrispondenti. + No font matches the selected shapes. Nessun font corrisponde alle forme selezionate. + Reset Retype Panel Reimposta pannello Ridigita + List Matching Fonts Elenca font corrispondenti + Retype Preview Anteprima del pannello Ridigita +@msg `count` must be a whole number from 1 to 96 `count` deve essere un numero intero compreso tra 1 e 96 +@msg `size` must be small, medium or large `size` deve essere small, medium o large +@msg `text` must be a string of at most 100 characters `text` deve essere una stringa di al massimo 100 caratteri Find Next Trova successivo Find Objects Trova oggetti Compare with Image Confronta con immagine diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 4caa8ba8db..40b655dfc1 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -475,6 +475,18 @@ digits Malayalam マラヤーラム数字 Highlight Tracking トラッキングをハイライト Step Type 文字を段階的に調整 Find Font… フォントの検索と置換… + Retype リタイプ + Find Matching Fonts 一致するフォントを検索 + Find more font matches 一致するフォントをさらに検索 + Type your text to preview プレビューするテキストを入力 + Select outlined text, then Find Matching Fonts. アウトライン化したテキストを選択してから、一致するフォントを検索してください。 + No font matches the selected shapes. 選択したシェイプに一致するフォントはありません。 + Reset Retype Panel リタイプパネルをリセット + List Matching Fonts 一致するフォントの一覧 + Retype Preview リタイプパネルのプレビュー +@msg `count` must be a whole number from 1 to 96 `count` には 1 から 96 の整数を指定してください +@msg `size` must be small, medium or large `size` には small、medium、large のいずれかを指定してください +@msg `text` must be a string of at most 100 characters `text` には 100 文字以内の文字列を指定してください Change Case 大文字と小文字の変更 UPPERCASE すべて大文字 lowercase すべて小文字 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 0158c52367..d27a51fb8b 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -2556,6 +2556,18 @@ Break Thread დაკავშირების გაწყვეტა Fit Headline სათაურის მორგება Find Font… შრიფტის ძებნა… + Retype ხელახლა აკრეფა + Find Matching Fonts შესაბამისი შრიფტების ძებნა + Find more font matches მეტი შესაბამისი შრიფტის ძებნა + Type your text to preview აკრიფეთ ტექსტი წინასწარი ნახვისთვის + Select outlined text, then Find Matching Fonts. მონიშნეთ კონტურებად გარდაქმნილი ტექსტი, შემდეგ აირჩიეთ შესაბამისი შრიფტების ძებნა. + No font matches the selected shapes. არცერთი შრიფტი არ შეესაბამება მონიშნულ ფიგურებს. + Reset Retype Panel ხელახლა აკრეფის პანელის ჩამოყრა + List Matching Fonts შესაბამისი შრიფტების სია + Retype Preview ხელახლა აკრეფის პანელის წინასწარი ნახვა +@msg `count` must be a whole number from 1 to 96 `count` უნდა იყოს მთელი რიცხვი 1-დან 96-მდე +@msg `size` must be small, medium or large `size` უნდა იყოს small, medium ან large +@msg `text` must be a string of at most 100 characters `text` უნდა იყოს არაუმეტეს 100 სიმბოლოს სტრიქონი Change Case რეგისტრის შეცვლა UPPERCASE მთავრული lowercase პატარა ასოები diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index a877bb5299..1454ace361 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -468,6 +468,18 @@ digits Malayalam 말라얄람어 Highlight Tracking 자간 강조 표시 Step Type 단계별 문자 Find Font… 글꼴 찾기… + Retype 리타입 + Find Matching Fonts 일치하는 글꼴 찾기 + Find more font matches 일치하는 글꼴 더 찾기 + Type your text to preview 미리 볼 텍스트 입력 + Select outlined text, then Find Matching Fonts. 윤곽선으로 만든 텍스트를 선택한 다음 일치하는 글꼴 찾기를 누르세요. + No font matches the selected shapes. 선택한 모양과 일치하는 글꼴이 없습니다. + Reset Retype Panel 리타입 패널 재설정 + List Matching Fonts 일치하는 글꼴 목록 + Retype Preview 리타입 패널 미리 보기 +@msg `count` must be a whole number from 1 to 96 `count`는 1에서 96 사이의 정수여야 합니다 +@msg `size` must be small, medium or large `size`는 small, medium 또는 large여야 합니다 +@msg `text` must be a string of at most 100 characters `text`는 최대 100자의 문자열이어야 합니다 Change Case 대소문자 변경 UPPERCASE 대문자 lowercase 소문자 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 4b2cd0615c..da880f9706 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -992,6 +992,18 @@ liquify-list-end {0}, {1} {0} en {1} Break Thread Koppeling verbreken Fit Headline Kop passend maken Find Font… Lettertype zoeken… + Retype Opnieuw typen + Find Matching Fonts Overeenkomende lettertypen zoeken + Find more font matches Meer overeenkomende lettertypen zoeken + Type your text to preview Typ de tekst voor het voorbeeld + Select outlined text, then Find Matching Fonts. Selecteer omgezette tekst en kies dan Overeenkomende lettertypen zoeken. + No font matches the selected shapes. Geen lettertype komt overeen met de geselecteerde vormen. + Reset Retype Panel Paneel Opnieuw typen herstellen + List Matching Fonts Overeenkomende lettertypen weergeven + Retype Preview Voorbeeld in paneel Opnieuw typen +@msg `count` must be a whole number from 1 to 96 `count` moet een geheel getal van 1 tot 96 zijn +@msg `size` must be small, medium or large `size` moet small, medium of large zijn +@msg `text` must be a string of at most 100 characters `text` moet een tekenreeks van hoogstens 100 tekens zijn Change Case Hoofdlettergebruik wijzigen UPPERCASE HOOFDLETTERS lowercase kleine letters diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 1ddd0a1355..bdef720e16 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -386,6 +386,18 @@ Break Thread Przerwij wątek Fit Headline Dopasuj nagłówek Find Font… Znajdź czcionkę… + Retype Przepisz + Find Matching Fonts Znajdź pasujące czcionki + Find more font matches Znajdź więcej pasujących czcionek + Type your text to preview Wpisz tekst do podglądu + Select outlined text, then Find Matching Fonts. Zaznacz tekst zamieniony na kontury, a następnie wybierz Znajdź pasujące czcionki. + No font matches the selected shapes. Żadna czcionka nie pasuje do zaznaczonych kształtów. + Reset Retype Panel Resetuj panel Przepisz + List Matching Fonts Wyświetl pasujące czcionki + Retype Preview Podgląd w panelu Przepisz +@msg `count` must be a whole number from 1 to 96 `count` musi być liczbą całkowitą od 1 do 96 +@msg `size` must be small, medium or large `size` musi mieć wartość small, medium lub large +@msg `text` must be a string of at most 100 characters `text` musi być ciągiem o długości co najwyżej 100 znaków Change Case Zmień wielkość liter UPPERCASE WIELKIE LITERY lowercase małe litery diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index c054dfd3a9..6fa28c0b32 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1202,6 +1202,18 @@ antiAlias Sharp Nítido Find Localizar Find Font Localizar Fonte Find Font… Localizar Fonte… + Retype Redigitar + Find Matching Fonts Localizar Fontes Correspondentes + Find more font matches Localizar mais fontes correspondentes + Type your text to preview Digite o texto da visualização + Select outlined text, then Find Matching Fonts. Selecione texto contornado e depois Localizar Fontes Correspondentes. + No font matches the selected shapes. Nenhuma fonte corresponde às formas selecionadas. + Reset Retype Panel Redefinir Painel Redigitar + List Matching Fonts Listar Fontes Correspondentes + Retype Preview Visualização do Painel Redigitar +@msg `count` must be a whole number from 1 to 96 `count` deve ser um número inteiro de 1 a 96 +@msg `size` must be small, medium or large `size` deve ser small, medium ou large +@msg `text` must be a string of at most 100 characters `text` deve ser uma string de no máximo 100 caracteres Find Next Localizar Próximo Find and Replace… Localizar e Substituir… First Page Primeira Página diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 5a59fc7243..23b566469f 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1318,6 +1318,18 @@ font-technology Variable Вариативные Find and Replace… Найти и заменить… Find Font Найти шрифт Find Font… Найти шрифт… + Retype Перенабор + Find Matching Fonts Найти подходящие шрифты + Find more font matches Найти другие подходящие шрифты + Type your text to preview Введите текст для просмотра + Select outlined text, then Find Matching Fonts. Выделите текст, преобразованный в кривые, затем выберите «Найти подходящие шрифты». + No font matches the selected shapes. Ни один шрифт не подходит к выделенным фигурам. + Reset Retype Panel Сбросить панель «Перенабор» + List Matching Fonts Список подходящих шрифтов + Retype Preview Просмотр в панели «Перенабор» +@msg `count` must be a whole number from 1 to 96 `count` должно быть целым числом от 1 до 96 +@msg `size` must be small, medium or large `size` должно быть small, medium или large +@msg `text` must be a string of at most 100 characters `text` должно быть строкой длиной не более 100 символов Find Next Найти далее Find Objects Найти объекты Compare with Image Сравнить с изображением diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 40b2085ae4..74e73b693d 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1279,6 +1279,18 @@ font-technology Variable Variabla Find and Replace… Sök och ersätt… Find Font Sök typsnitt Find Font… Sök typsnitt… + Retype Skriv om + Find Matching Fonts Sök matchande typsnitt + Find more font matches Sök fler matchande typsnitt + Type your text to preview Skriv texten för förhandsgranskningen + Select outlined text, then Find Matching Fonts. Markera text som gjorts om till konturer och välj sedan Sök matchande typsnitt. + No font matches the selected shapes. Inget typsnitt matchar de markerade formerna. + Reset Retype Panel Återställ panelen Skriv om + List Matching Fonts Lista matchande typsnitt + Retype Preview Förhandsgranskning i panelen Skriv om +@msg `count` must be a whole number from 1 to 96 `count` måste vara ett heltal från 1 till 96 +@msg `size` must be small, medium or large `size` måste vara small, medium eller large +@msg `text` must be a string of at most 100 characters `text` måste vara en sträng på högst 100 tecken Find Next Sök nästa Find Objects Sök objekt Compare with Image Jämför med bild diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 79ba20d44b..e65dcd473b 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -2890,6 +2890,42 @@ fn svg_variable_kinds_left_out_translate_in_every_complete_catalog() { assert_eq!(message(Lang::EN, &english), english); } +/// The Retype panel's labels and the errors its commands give. +#[test] +fn retype_panel_strings_are_in_complete_catalogs() { + let mut missing = vec![]; + for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) { + for label in [ + "Retype", + "Find Matching Fonts", + "Find more font matches", + "Type your text to preview", + "Select outlined text, then Find Matching Fonts.", + "No font matches the selected shapes.", + "Reset Retype Panel", + "List Matching Fonts", + "Retype Preview", + ] { + if lang.catalog().plain(label).is_none() { + missing.push(format!("{} {label}", lang.code)); + } + } + } + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + for m in [ + "`count` must be a whole number from 1 to 96", + "`size` must be small, medium or large", + "`text` must be a string of at most 100 characters", + ] { + if message(lang, m) == m { + missing.push(format!("{code} @msg {m}")); + } + } + } + assert!(missing.is_empty(), "{missing:?}"); +} + /// Every complete-message catalog has a row for each error that `type.compositeFonts.set`, /// `.export` and `.import`, the composite font checks behind them and the Composite Fonts dialog /// give, and translates them with the font name, the key and the class key kept, and the reason diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index b6b9a97705..8a36e2a56a 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -1269,6 +1269,18 @@ font-technology Variable Değişken Find and Replace… Bul ve Değiştir… Find Font Yazı Tipi Bul Find Font… Yazı Tipi Bul… + Retype Yeniden Yaz + Find Matching Fonts Eşleşen Yazı Tiplerini Bul + Find more font matches Daha fazla eşleşen yazı tipi bul + Type your text to preview Önizleme için metninizi yazın + Select outlined text, then Find Matching Fonts. Anahatlara dönüştürülmüş metni seçin, ardından Eşleşen Yazı Tiplerini Bul komutunu seçin. + No font matches the selected shapes. Seçili şekillerle eşleşen yazı tipi yok. + Reset Retype Panel Yeniden Yaz Panelini Sıfırla + List Matching Fonts Eşleşen Yazı Tiplerini Listele + Retype Preview Yeniden Yaz Paneli Önizlemesi +@msg `count` must be a whole number from 1 to 96 `count` 1 ile 96 arasında bir tam sayı olmalıdır +@msg `size` must be small, medium or large `size` small, medium veya large olmalıdır +@msg `text` must be a string of at most 100 characters `text` en fazla 100 karakterlik bir dize olmalıdır Find Next Sonrakini Bul Find Objects Nesneleri Bul Compare with Image Görüntüyle Karşılaştır diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 3ce4ecf5a1..5d865d9946 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1326,6 +1326,18 @@ font-technology Variable Варіативні Find and Replace… Знайти та замінити… Find Font Знайти шрифт Find Font… Знайти шрифт… + Retype Повторний набір + Find Matching Fonts Знайти відповідні шрифти + Find more font matches Знайти інші відповідні шрифти + Type your text to preview Введіть текст для перегляду + Select outlined text, then Find Matching Fonts. Виділіть текст, перетворений на криві, потім виберіть «Знайти відповідні шрифти». + No font matches the selected shapes. Жоден шрифт не відповідає виділеним фігурам. + Reset Retype Panel Скинути панель «Повторний набір» + List Matching Fonts Список відповідних шрифтів + Retype Preview Перегляд у панелі «Повторний набір» +@msg `count` must be a whole number from 1 to 96 `count` має бути цілим числом від 1 до 96 +@msg `size` must be small, medium or large `size` має бути small, medium або large +@msg `text` must be a string of at most 100 characters `text` має бути рядком довжиною не більше 100 символів Find Next Знайти далі Find Objects Знайти об’єкти Compare with Image Порівняти із зображенням diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 29dce22126..2dc6a229d8 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -1548,6 +1548,18 @@ digits Malayalam Malayalam Find Fonts Tìm phông chữ Find Fonts in Folder… Tìm phông chữ trong thư mục… Find Font… Tìm phông… + Retype Gõ lại + Find Matching Fonts Tìm phông khớp + Find more font matches Tìm thêm phông khớp + Type your text to preview Nhập văn bản để xem trước + Select outlined text, then Find Matching Fonts. Chọn văn bản đã chuyển thành đường viền, rồi Tìm phông khớp. + No font matches the selected shapes. Không có phông nào khớp với các hình đã chọn. + Reset Retype Panel Đặt lại bảng Gõ lại + List Matching Fonts Liệt kê phông khớp + Retype Preview Xem trước trong bảng Gõ lại +@msg `count` must be a whole number from 1 to 96 `count` phải là số nguyên từ 1 đến 96 +@msg `size` must be small, medium or large `size` phải là small, medium hoặc large +@msg `text` must be a string of at most 100 characters `text` phải là chuỗi tối đa 100 ký tự Find in Folder… Tìm trong thư mục… Find Linked Files Tìm tệp liên kết Find Linked Files in Folder… Tìm tệp liên kết trong thư mục… diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index d4a957a4b8..aa1d6f12e0 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1263,6 +1263,18 @@ antiAlias Sharp 锐利 Find and Replace… 查找和替换… Find Font 查找字体 Find Font… 查找字体… + Retype 重新键入 + Find Matching Fonts 查找匹配字体 + Find more font matches 查找更多匹配字体 + Type your text to preview 输入要预览的文本 + Select outlined text, then Find Matching Fonts. 选择已转为轮廓的文字,然后查找匹配字体。 + No font matches the selected shapes. 没有字体与所选形状匹配。 + Reset Retype Panel 重置重新键入面板 + List Matching Fonts 列出匹配字体 + Retype Preview 重新键入面板预览 +@msg `count` must be a whole number from 1 to 96 `count` 必须是 1 到 96 之间的整数 +@msg `size` must be small, medium or large `size` 必须是 small、medium 或 large +@msg `text` must be a string of at most 100 characters `text` 必须是不超过 100 个字符的字符串 Find Next 查找下一个 Find Objects 查找对象 Compare with Image 与图像比较 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 5cfacaca19..f4b17c5c19 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1297,6 +1297,18 @@ font-technology Variable 可變 Find and Replace… 尋找與取代… Find Font 尋找字體 Find Font… 尋找字體… + Retype 重新鍵入 + Find Matching Fonts 尋找相符字體 + Find more font matches 尋找更多相符字體 + Type your text to preview 輸入要預覽的文字 + Select outlined text, then Find Matching Fonts. 選取已轉為外框的文字,然後尋找相符字體。 + No font matches the selected shapes. 沒有字體與所選形狀相符。 + Reset Retype Panel 重設重新鍵入面板 + List Matching Fonts 列出相符字體 + Retype Preview 重新鍵入面板預覽 +@msg `count` must be a whole number from 1 to 96 `count` 必須是介於 1 到 96 的整數 +@msg `size` must be small, medium or large `size` 必須是 small、medium 或 large +@msg `text` must be a string of at most 100 characters `text` 必須是不超過 100 個字元的字串 Find Next 尋找下一個 Find Objects 尋找物件 Compare with Image 與影像比較 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index d5ec92b934..90b3d1a18a 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -116,6 +116,7 @@ pub fn run_ui_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option Vec<(&'static str, Vec)> { panel("Pattern Options", "patternOptions"), panel("Properties", "properties"), panel("Production Preflight", crate::panels::preflight::ID), + panel("Retype", crate::panels::retype::ID), panel("Script Console", crate::panels::script_console::ID), panel("Separations Preview", "separations"), panel("Stroke", "stroke"), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index e8b5eddf5b..4bfabe9314 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -781,6 +781,30 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} clear the Learn panel's progress, every tutorial finished and every step marked done, as Reset progress under the list of skills does; open documents, opened practice samples and the Learn view stay as they are; returns what learn.list returns", ), + ( + "retype.find", + "Find Matching Fonts", + "", + "{more?: bool} show the Retype panel and list the fonts whose glyphs the selected outlined text is, ranked as type.retypeFonts ranks them: ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a selection with no path or compound path, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", + ), + ( + "retype.list", + "List Matching Fonts", + "", + "{} what the Retype panel shows: {searched (a search ran since the last reset), fonts: [{family, style, matched (shapes it matches)}], shapes (shapes the last search compared), more (more fonts match than the list holds), size: small|medium|large, text (the samples' text; empty for a generic sample)}", + ), + ( + "retype.preview", + "Retype Preview", + "", + "{size?: small|medium|large, text?: string} the size of the Retype panel's samples, as its panel menu sets it, and the text they show, as its sample field sets it (at most 100 characters; empty for a generic sample); any other value is an error and changes nothing; returns what retype.list returns", + ), + ( + "retype.reset", + "Reset Retype Panel", + "", + "{} clear the Retype panel's list of matching fonts, as Reset Retype Panel in its panel menu does; the samples' size and text stay; returns what retype.list returns", + ), ("window.brightness", "UI Brightness", "", "{brightness: dark|mediumDark|mediumLight|light}"), ( "window.workspace", diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 9734f76867..2ff92680b8 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -40,6 +40,7 @@ pub mod pathfinder; pub mod pattern_options; pub mod preflight; pub mod properties; +pub mod retype; pub mod script_console; pub mod separations; pub mod stroke; @@ -196,6 +197,7 @@ pub fn show_icon_panel(app: &mut VectorcraftApp, ui: &mut Ui, id: &str) { script_console::ID => script_console::show(app, ui), learn::ID => learn::show(app, ui), discover::ID => discover::show(app, ui), + retype::ID => retype::show(app, ui), crate::addons::cleanup::ID => crate::addons::cleanup::show(app, ui), crate::addons::color::ID => crate::addons::color::show(app, ui), crate::addons::packaging::ID => crate::addons::packaging::show(app, ui), @@ -256,6 +258,7 @@ pub fn panel_menu_items(app: &mut VectorcraftApp, ui: &mut Ui, id: &str) -> bool css_properties::ID => css_properties::menu(app, ui), variables::ID => variables::menu(app, ui), script_console::ID => script_console::menu(app, ui), + retype::ID => retype::menu(app, ui), "actions" => actions::menu(app, ui), crate::addons::packaging::ID => crate::addons::packaging::panel_menu(app, ui), id if library_panel::parse(id).is_some() => library_panel::menu(app, ui, id), diff --git a/crates/ui-egui/src/panels/retype.rs b/crates/ui-egui/src/panels/retype.rs new file mode 100644 index 0000000000..e8594490f5 --- /dev/null +++ b/crates/ui-egui/src/panels/retype.rs @@ -0,0 +1,258 @@ +//! Retype panel (Window › Retype): the fonts whose glyphs the selected outlined text is, ranked by +//! how many of its shapes each matches (`type.retypeFonts`), each with a sample +//! (, +//! ). +//! Find Matching Fonts lists ten, and Find more font matches at the end of the list five more. The +//! list stays after the selection changes, so choosing a font in it sets that font on the live text +//! selected then, as the font menus do. The sample field sets the text the samples show, and the +//! panel menu sets their size; Reset Retype Panel clears the list. `retype.find`, `retype.list`, +//! `retype.preview` and `retype.reset` do the same. + +use egui::{Sense, Ui, vec2}; +use serde_json::{Value, json}; + +use crate::VectorcraftApp; +use crate::theme::Tokens; +use crate::widgets::{self, menu_item}; + +pub const ID: &str = "retype"; + +/// The fonts Find Matching Fonts lists. +const FIRST: usize = 10; +/// The fonts Find more font matches adds. +const MORE: usize = 5; +/// The most fonts the list holds (`type.retypeFonts`' largest count). +const MAX: usize = 96; +/// The longest sample text, in characters. +const MAX_TEXT: usize = 100; + +/// How large the samples are drawn (the panel menu's three sizes). +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum Size { + Small, + #[default] + Medium, + Large, +} + +/// Each size with the name `retype.preview` takes for it and its row height. +const SIZES: [(Size, &str, f32); 3] = [(Size::Small, "small", 22.0), (Size::Medium, "medium", 32.0), (Size::Large, "large", 48.0)]; + +/// One font in the list. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Found { + pub family: String, + pub style: String, + /// How many of the shapes it matched. + pub matched: u64, +} + +/// What the panel shows, kept while the app runs. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct View { + /// A search has run since the panel was last reset. + pub searched: bool, + /// The fonts the list shows. + pub fonts: Vec, + /// The fonts the last search found after those, in rank order. Find more font matches moves + /// the next five of them to the list. + pub rest: Vec, + /// The shapes the last search compared. + pub shapes: u64, + pub size: Size, + /// The samples' text (empty: a generic sample). + pub text: String, +} + +fn size_name(size: Size) -> &'static str { + SIZES.iter().find(|s| s.0 == size).map_or("medium", |s| s.1) +} + +fn row_height(size: Size) -> f32 { + SIZES.iter().find(|s| s.0 == size).map_or(32.0, |s| s.2) +} + +pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { + let mut run: Option<(&str, Value)> = None; + let has_path = vectorcraft_engine::cmd::has_selected_path(&app.session).is_ok(); + if widgets::primary_button_enabled(ui, tl!("Find Matching Fonts"), has_path).clicked() { + run = Some(("retype.find", json!({}))); + } + ui.add_space(4.0); + let mut text = app.ui.retype.text.clone(); + let field = ui.add( + egui::TextEdit::singleline(&mut text) + .id(ui.make_persistent_id("retype-sample")) + .char_limit(MAX_TEXT) + .hint_text(egui::RichText::new(tl!("Type your text to preview")).italics()) + .desired_width(ui.available_width()), + ); + if field.changed() { + run = Some(("retype.preview", json!({ "text": text }))); + } + widgets::divider(ui); + let view = app.ui.retype.clone(); + if !view.searched { + widgets::dim_label(ui, tl!("Select outlined text, then Find Matching Fonts.")); + } else if view.fonts.is_empty() { + widgets::dim_label(ui, tl!("No font matches the selected shapes.")); + } else { + let live = live_text_selected(app); + let sample = (!view.text.trim().is_empty()).then_some(view.text.as_str()); + let height = row_height(view.size); + let on_white = app.session.prefs.font_samples_on_white; + let mut chosen = None; + egui::ScrollArea::vertical().show(ui, |ui| { + for f in &view.fonts { + if font_row(ui, f, sample, height, on_white, live) { + chosen = Some(f.clone()); + } + } + if !view.rest.is_empty() && ui.link(tl!("Find more font matches")).clicked() { + run = Some(("retype.find", json!({ "more": true }))); + } + }); + if let Some(f) = chosen { + crate::font_menu::apply(app, ui.ctx(), crate::font_menu::FontPick::Chosen(f.family, Some(f.style))); + } + } + if let Some((id, p)) = run + && let Err(e) = app.run(id, p) + { + app.status(e); + } +} + +/// A font's row: its name and style over its sample. A click chooses it when `live` text is +/// selected. +fn font_row(ui: &mut Ui, f: &Found, sample: Option<&str>, height: f32, on_white: bool, live: bool) -> bool { + let t = Tokens::get(ui.ctx()); + let name = format!("{} {}", f.family, f.style); + let (rect, resp) = ui.allocate_exact_size(vec2(ui.available_width(), height + 16.0), if live { Sense::click() } else { Sense::hover() }); + widgets::list_item_info(&resp, false, || name.clone()); + if live && resp.hovered() { + ui.painter().rect_filled(rect, 2.0, t.hover); + } + let label = egui::Rect::from_min_size(rect.min + vec2(4.0, 0.0), vec2(rect.width() - 8.0, 14.0)); + ui.painter().text(label.left_center(), egui::Align2::LEFT_CENTER, &name, egui::FontId::proportional(11.0), t.text_dim); + let slot = egui::Rect::from_min_size(rect.min + vec2(4.0, 15.0), vec2(rect.width() - 8.0, height)); + crate::font_menu::styled_sample(ui, slot, &f.family, &f.style, sample, on_white); + live && resp.clicked() +} + +/// Live type is selected, inside a selected group too, or being edited: what choosing a font sets +/// it on, as the font menus do. +fn live_text_selected(app: &VectorcraftApp) -> bool { + crate::panels::character::text_editing(app).is_some() || !crate::panels::character::selected_stories(app).is_empty() +} + +pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { + for (size, name, _) in SIZES { + let label = match size { + Size::Small => tl!("Small"), + Size::Medium => tl!("Medium"), + Size::Large => tl!("Large"), + }; + if menu_item(ui, label, true, app.ui.retype.size == size) + && let Err(e) = app.run("retype.preview", json!({ "size": name })) + { + app.status(e); + } + } + ui.separator(); + if menu_item(ui, tl!("Reset Retype Panel"), app.ui.retype.searched, false) + && let Err(e) = app.run("retype.reset", json!({})) + { + app.status(e); + } +} + +/// The Retype panel's UI commands: `retype.find`, `retype.list`, `retype.preview` and +/// `retype.reset`. +pub(crate) fn command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option> { + Some(match id { + "retype.find" => find(app, p), + "retype.list" => Ok(list(&app.ui.retype)), + "retype.preview" => preview(app, p), + "retype.reset" => { + let v = &mut app.ui.retype; + (v.searched, v.fonts, v.rest, v.shapes) = (false, vec![], vec![], 0); + Ok(list(&app.ui.retype)) + } + _ => return None, + }) +} + +/// `retype.list`: what the panel shows → `{searched, fonts: [{family, style, matched}], shapes, +/// more, size, text}`. +fn list(v: &View) -> Value { + json!({ + "searched": v.searched, + "fonts": v.fonts.iter().map(|f| json!({"family": f.family, "style": f.style, "matched": f.matched})).collect::>(), + "shapes": v.shapes, + "more": !v.rest.is_empty(), + "size": size_name(v.size), + "text": v.text, + }) +} + +/// `retype.find {more?}`: show the panel and list the first ten fonts matching the selected +/// outlined text, or with `more` add the next five the last search found, whatever is selected +/// now → what `retype.list` returns. The list stays as it was when the search fails. +fn find(app: &mut VectorcraftApp, p: &Value) -> Result { + let more = crate::menus::opt_bool(p, "more")?.unwrap_or(false); + if more && app.ui.retype.searched { + // The panel shows first: a failure leaves the list as it was. + crate::panel_docking::reveal_panel(app, ID)?; + let v = &mut app.ui.retype; + let next: Vec = v.rest.drain(..v.rest.len().min(MORE)).collect(); + v.fonts.extend(next); + return Ok(list(&app.ui.retype)); + } + let r = app.session.execute("type.retypeFonts", &json!({ "count": MAX })).map_err(|e| e.to_string())?; + crate::panel_docking::reveal_panel(app, ID)?; + let mut fonts: Vec = r["fonts"] + .as_array() + .map(|a| { + a.iter() + .filter_map(|f| { + Some(Found { + family: f["family"].as_str()?.to_string(), + style: f["style"].as_str()?.to_string(), + matched: f["matched"].as_u64()?, + }) + }) + .collect() + }) + .unwrap_or_default(); + let rest = fonts.split_off(fonts.len().min(FIRST)); + let v = &mut app.ui.retype; + (v.searched, v.fonts, v.rest, v.shapes) = (true, fonts, rest, r["shapes"].as_u64().unwrap_or(0)); + Ok(list(&app.ui.retype)) +} + +/// `retype.preview {size?, text?}`: the samples' size (small, medium or large) and text (at most +/// 100 characters; empty for a generic sample) → what `retype.list` returns. A bad value is an +/// error and changes nothing. +fn preview(app: &mut VectorcraftApp, p: &Value) -> Result { + let size = match p.get("size") { + None | Some(Value::Null) => None, + Some(v) => Some(v.as_str().and_then(|s| SIZES.iter().find(|x| x.1 == s)).map(|x| x.0).ok_or("`size` must be small, medium or large")?), + }; + let text = match p.get("text") { + None | Some(Value::Null) => None, + Some(Value::String(s)) if s.chars().count() <= MAX_TEXT => Some(s.clone()), + Some(_) => return Err("`text` must be a string of at most 100 characters".into()), + }; + let v = &mut app.ui.retype; + if let Some(s) = size { + v.size = s; + } + if let Some(t) = text { + v.text = t; + } + Ok(list(&app.ui.retype)) +} + +#[cfg(test)] +mod tests; diff --git a/crates/ui-egui/src/panels/retype/tests.rs b/crates/ui-egui/src/panels/retype/tests.rs new file mode 100644 index 0000000000..19ad086747 --- /dev/null +++ b/crates/ui-egui/src/panels/retype/tests.rs @@ -0,0 +1,198 @@ +use egui::accesskit::Node; +use serde_json::{Value, json}; +use vectorcraft_doc::{NodeId, NodeKind}; +use vectorcraft_engine::Session; + +use super::{ID, Size, menu, show}; +use crate::VectorcraftApp; + +const SCREEN: egui::Rect = egui::Rect::from_min_max(egui::Pos2::ZERO, egui::pos2(600.0, 900.0)); + +fn app() -> VectorcraftApp { + crate::i18n::set_current(crate::i18n::Lang::EN); + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 600, "height": 400})).unwrap(); + app +} + +/// Point text, outlined: the id of the outlines' group. +fn outlined(app: &mut VectorcraftApp, p: Value) -> u64 { + let id = app.session.execute("text.create", &p).unwrap()["id"].as_u64().unwrap(); + app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); + app.session.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap() +} + +fn select(app: &mut VectorcraftApp, ids: &[u64]) { + app.session.execute("select.set", &json!({ "ids": ids })).unwrap(); +} + +/// One frame of `draw` with screen-reader nodes on → the nodes. +fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec, draw: fn(&mut VectorcraftApp, &mut egui::Ui)) -> Vec { + let mut out = ctx.run_ui(egui::RawInput { events, screen_rect: Some(SCREEN), ..Default::default() }, |ui| draw(app, ui)); + out.textures_delta.clear(); + out.platform_output.accesskit_update.map(|u| u.nodes.into_iter().map(|(_, n)| n).collect()).unwrap_or_default() +} + +fn center(nodes: &[Node], name: &str) -> Option { + let b = nodes.iter().find(|n| n.label().is_some_and(|l| l == name))?.bounds()?; + Some(egui::pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32)) +} + +/// Click the node labeled `name` in the panel. +fn click(app: &mut VectorcraftApp, ctx: &egui::Context, name: &str) { + frame(app, ctx, vec![], show); + let at = center(&frame(app, ctx, vec![], show), name).unwrap_or_else(|| panic!("{name} is drawn")); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + frame(app, ctx, vec![egui::Event::PointerMoved(at), press(true)], show); + frame(app, ctx, vec![press(false)], show); +} + +fn context() -> egui::Context { + let ctx = egui::Context::default(); + ctx.enable_accesskit(); + crate::theme::install_fonts(&ctx); + ctx +} + +fn families(list: &Value) -> Vec<(String, String)> { + list["fonts"].as_array().unwrap().iter().map(|f| (f["family"].as_str().unwrap().to_string(), f["style"].as_str().unwrap().to_string())).collect() +} + +#[test] +fn find_lists_the_matching_fonts_and_shows_the_panel() { + let mut app = app(); + let g = outlined(&mut app, json!({"x": 40, "y": 100, "text": "Find me", "size": 30, "font": "Source Sans 3", "style": "Bold"})); + select(&mut app, &[g]); + let before = app.session.active().unwrap().doc.clone(); + let r = app.run("retype.find", json!({})).unwrap(); + assert_eq!(r["searched"], json!(true), "{r}"); + assert_eq!(r["shapes"], json!(6)); + assert_eq!(families(&r).first(), Some(&("Source Sans 3".to_string(), "Bold".to_string())), "{r}"); + assert!(families(&r).len() <= 10, "ten at first: {r}"); + assert!(crate::panel_docking::showing(&app.ui, ID), "the panel shows"); + assert!(app.session.active().unwrap().doc == before, "the document does not change"); + assert_eq!(app.run("retype.list", json!({})).unwrap(), r); +} + +#[test] +fn more_adds_fonts_until_none_is_left() { + let mut app = app(); + let g = outlined(&mut app, json!({"x": 40, "y": 100, "text": "More", "size": 30})); + select(&mut app, &[g]); + let first = app.run("retype.find", json!({})).unwrap(); + // How many fonts match depends on the fonts loaded: ask until none is left. + let mut last = first.clone(); + for _ in 0..20 { + if last["more"] == json!(false) { + break; + } + let next = app.run("retype.find", json!({"more": true})).unwrap(); + let added = families(&next).len() - families(&last).len(); + assert!((1..=5).contains(&added), "{added} added: {next}"); + last = next; + } + assert_eq!(last["more"], json!(false), "{last}"); + assert_eq!(app.run("retype.find", json!({"more": true})).unwrap(), last, "nothing is left to add"); + // Before any search, more is a first search. + app.run("retype.reset", json!({})).unwrap(); + assert_eq!(app.run("retype.find", json!({"more": true})).unwrap(), first); + assert!(app.run("retype.find", json!({"more": "yes"})).is_err()); +} + +#[test] +fn more_shows_the_next_five_the_search_found_whatever_is_selected_now() { + let mut app = app(); + let font = |i: usize| super::Found { family: format!("Family {i}"), style: "Regular".into(), matched: 1 }; + app.ui.retype.searched = true; + app.ui.retype.fonts = (0..10).map(font).collect(); + app.ui.retype.rest = (10..17).map(font).collect(); + // Live type is selected to take a listed font: it holds no shape to compare. + let t = app.session.execute("text.create", &json!({"x": 10, "y": 300, "text": "live"})).unwrap()["id"].as_u64().unwrap(); + select(&mut app, &[t]); + let r = app.run("retype.find", json!({"more": true})).unwrap(); + assert_eq!(families(&r).len(), 15, "{r}"); + assert_eq!(families(&r)[10].0, "Family 10"); + assert_eq!(r["more"], json!(true), "two are left"); + let r = app.run("retype.find", json!({"more": true})).unwrap(); + assert_eq!(families(&r).len(), 17, "{r}"); + assert_eq!(r["more"], json!(false)); + assert_eq!(app.run("retype.find", json!({"more": true})).unwrap(), r, "nothing is left to add"); +} + +#[test] +fn a_failed_search_leaves_the_list_as_it_was() { + let mut app = app(); + let g = outlined(&mut app, json!({"x": 40, "y": 100, "text": "Kept", "size": 30})); + select(&mut app, &[g]); + let listed = app.run("retype.find", json!({})).unwrap(); + let t = app.session.execute("text.create", &json!({"x": 10, "y": 300, "text": "live"})).unwrap()["id"].as_u64().unwrap(); + select(&mut app, &[t]); + assert!(app.run("retype.find", json!({})).is_err(), "live type alone holds no shape"); + assert_eq!(app.run("retype.list", json!({})).unwrap(), listed); +} + +#[test] +fn preview_sets_the_size_and_text_and_reset_keeps_them() { + let mut app = app(); + let r = app.run("retype.preview", json!({"size": "large", "text": "Hamburg"})).unwrap(); + assert_eq!((r["size"].clone(), r["text"].clone()), (json!("large"), json!("Hamburg"))); + assert_eq!(app.ui.retype.size, Size::Large); + for bad in [json!({"size": "huge"}), json!({"size": 2}), json!({"text": 5}), json!({"text": "x".repeat(101)})] { + assert!(app.run("retype.preview", bad.clone()).is_err(), "{bad}"); + } + assert_eq!(app.ui.retype.size, Size::Large, "a bad value changes nothing"); + assert_eq!(app.ui.retype.text, "Hamburg"); + let g = outlined(&mut app, json!({"x": 40, "y": 100, "text": "R", "size": 30})); + select(&mut app, &[g]); + app.run("retype.find", json!({})).unwrap(); + let r = app.run("retype.reset", json!({})).unwrap(); + assert_eq!(r, json!({"searched": false, "fonts": [], "shapes": 0, "more": false, "size": "large", "text": "Hamburg"})); +} + +#[test] +fn choosing_a_listed_font_sets_it_on_the_selected_live_text() { + let mut app = app(); + let g = outlined(&mut app, json!({"x": 40, "y": 100, "text": "Serif", "size": 30, "font": "Source Serif 4", "style": "Regular"})); + select(&mut app, &[g]); + app.run("retype.find", json!({})).unwrap(); + let t = app.session.execute("text.create", &json!({"x": 10, "y": 300, "text": "live", "font": "Source Sans 3"})).unwrap()["id"].as_u64().unwrap(); + select(&mut app, &[t]); + let ctx = context(); + click(&mut app, &ctx, "Source Serif 4 Regular"); + let doc = &app.session.active().unwrap().doc; + let NodeKind::Text(text) = &doc.node(NodeId(t)).unwrap().kind else { panic!("text") }; + assert_eq!(text.first_style().font_family, "Source Serif 4"); + // Live type inside a selected group takes the font too, as with the font menus. + let inner = + app.session.execute("text.create", &json!({"x": 10, "y": 350, "text": "grouped", "font": "Source Sans 3"})).unwrap()["id"].as_u64().unwrap(); + select(&mut app, &[inner]); + let group = app.session.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap(); + select(&mut app, &[group]); + click(&mut app, &ctx, "Source Serif 4 Regular"); + let doc = &app.session.active().unwrap().doc; + let NodeKind::Text(text) = &doc.node(NodeId(inner)).unwrap().kind else { panic!("text") }; + assert_eq!(text.first_style().font_family, "Source Serif 4"); + // With no live text selected the rows choose nothing. + select(&mut app, &[g]); + let before = app.session.active().unwrap().doc.clone(); + click(&mut app, &ctx, "Source Serif 4 Regular"); + assert!(app.session.active().unwrap().doc == before); +} + +#[test] +fn panel_and_menu_draw_headless() { + let mut app = app(); + let ctx = context(); + frame(&mut app, &ctx, vec![], show); + frame(&mut app, &ctx, vec![], menu); + let g = outlined(&mut app, json!({"x": 40, "y": 100, "text": "Draw", "size": 30})); + select(&mut app, &[g]); + click(&mut app, &ctx, "Find Matching Fonts"); + assert!(app.ui.retype.searched, "the button searches"); + assert!(!app.ui.retype.fonts.is_empty()); + for size in ["small", "medium", "large"] { + app.run("retype.preview", json!({ "size": size, "text": "Abc" })).unwrap(); + frame(&mut app, &ctx, vec![], show); + } + frame(&mut app, &ctx, vec![], menu); +} diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 79b35e9392..76fdf24244 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -227,6 +227,7 @@ pub const ICON_PANELS: &[(&str, &str, &str)] = &[ (crate::panels::script_console::ID, "Script Console", "message-circle"), (crate::panels::learn::ID, "Learn", "graduation-cap"), (crate::panels::discover::ID, "VectorCraft Help…", "search"), + (crate::panels::retype::ID, "Retype", "type"), (crate::addons::cleanup::ID, "Artwork Cleanup", "sparkles"), (crate::addons::color::ID, "Color Effects", "sun"), (crate::addons::packaging::ID, "Fold Lines", "scissors"), @@ -432,6 +433,9 @@ pub struct UiState { pub learn: crate::panels::learn::View, #[serde(skip)] pub discover: crate::panels::discover::View, + /// The Retype panel's list of matching fonts and its sample settings, kept while the app runs. + #[serde(skip)] + pub retype: crate::panels::retype::View, /// The tool whose place a Learn tutorial step's link shows (`learn.locateTool`), while its mark /// is on screen. Not saved. #[serde(skip)] @@ -1187,6 +1191,7 @@ impl Default for UiState { constrain_pie_angle: false, learn: Default::default(), discover: Default::default(), + retype: Default::default(), learn_locate: None, learn_practice: Default::default(), learn_progress: Default::default(), diff --git a/docs/gaps.md b/docs/gaps.md index 670d4c6110..2953a3e015 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -478,7 +478,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Missing:** CJK vertical composition (custom mojikumi sets and the Mojikumi Settings dialog, kinsoku settings #633, manual tate-chu-yoko), Middle Eastern features beyond bidi, digit types, Character Direction and Kashidas (a split caret; the Middle Eastern & South Asian composers are done, #4935), - Touch Type, Retype beyond exact matches of available fonts (phase 1 is in, #4934; near matches, the ranked font list and text in images remain), Snap to Glyph; optional preservation of font sizes during group scaling (#1034 enhancement). + Touch Type, Retype beyond exact matches of available fonts (phase 1 is in, #4934, and the Retype panel lists the exactly matching fonts; near matches, installed fonts not yet loaded and text in images remain), Snap to Glyph; optional preservation of font sizes during group scaling (#1034 enhancement). Itemized in [type-parity.md](type-parity.md). - **Impact:** professional typography and Japanese/Chinese publishing. - **Estimate:** 34–47 h (type core 14–19 h blocks beta). diff --git a/docs/mcp.md b/docs/mcp.md index 8fbc770ca7..6e46535dff 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -11487,6 +11487,39 @@ on an open path that are not drawn because they fall before the path's start can {"name":"run_command","arguments":{"command":"text.touchType","params":{"id":7,"start":1,"dx":10,"dy":4}}} ``` +## Retype panel + +`type.retypeFonts {count?}` lists the fonts whose glyphs the selected outlined text is. It compares each selected path +and compound path, inside groups too, with the glyphs of up to 96 loaded fonts, those of the document's live type +first, by the matching `type.retype` uses, and it counts only exact matches. When two versions of a font are loaded, +only the version its family and style name gives is compared, which is the version that choosing the font sets. The +fonts rank by how many shapes each matches, then by the mean distance left after fitting, then by family and style +name. `count` is a whole number from 1 to 96 (default 10); any other value is an error. The reply is +`{fonts: [{family, style, matched}], shapes, more, truncated}`: `matched` is the number of shapes the font matches, +`shapes` the number of shapes compared, `more` is true when more fonts match than `count`, and `truncated` is true when +shapes past the limits of `type.retype` were left out. Shapes that `type.retype` would keep as outlines because of +their paint still count. The command does not change the document and records no undo step. With no path or compound +path selected it is an error. + +Window › Retype shows the Retype panel. Find Matching Fonts runs `retype.find {}`, which shows the panel, ranks up to +96 fonts and lists the first ten. Find more font matches, at the end of the list when `more` is true, runs +`retype.find {more: true}`, which adds the next five fonts that search found, whatever is selected now. Before any +search, `retype.find {more: true}` runs a first search. A search that fails is an error and leaves the list as it +was. Each row shows the font's family and style over a sample of the font. While live type is selected or edited, a +click on a row sets that font on it, as the font menus do; live type inside a selected group counts too. The list +stays when the selection changes. + +`retype.list {}` → `{searched, fonts: [{family, style, matched}], shapes, more, size, text}`. `searched` is false +until a search runs and after a reset. `size` is `small`, `medium` or `large`, and `text` is the samples' text (empty +for a generic sample). The panel menu's Small, Medium and Large items and the sample field run +`retype.preview {size?, text?}`. `text` holds at most 100 characters; any other value of either key is an error and +changes nothing. Reset Retype Panel in the panel menu runs `retype.reset {}`, which clears the list and keeps the size +and text. `retype.find`, `retype.preview` and `retype.reset` return what `retype.list` returns. + +```json +{"name":"run_command","arguments":{"command":"type.retypeFonts","params":{"count":5}}} +``` + ## Alternate glyphs The Glyphs panel's Show › Alternates for Current Selection lists the alternate glyphs of the character selected with diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 97c019247b..1d6c14951d 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2883,6 +2883,10 @@ Check Spelling followed (2026-11-15): Edit › Spelling › Check Spelling… (` The public pages describe Retype finding the fonts that match selected outlined text (or text in an image), from the fonts on the device among others, and applying them to live text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html)). Phase 1 (#4934) is local and exact: Type › Retype (`type.retype`) compares each selected glyph shape with the glyphs of the loaded fonts, the document's fonts and any families named in `fonts`, the same up to uniform scale, rotation and translation, and sets the matched characters as point text in that font and size at the same baseline, one object per line, in one undo step. Shapes that match no font stay and are reported. The search is bounded, not exhaustive: at most 96 faces (named families first, then the document's fonts, then the other loaded faces), the first 65,536 encoded characters of each, and glyphs of plain-shape characters (box drawing, blocks, geometric shapes, private use) are left out; a glyph outside those limits is reported as matching no font. Exact matching also reads a curve an exporter split in two as a different shape (phase 2, with the other near matches). Tested by round trips through Create Outlines (plain, bold and turned, serif, word spaces), a drawn shape and a mixed selection (`crates/engine/src/cmd/retype_tests.rs`). Near matches, the ranked font list, installed fonts not yet loaded and images remain (phase 2). +## Retype panel (2026-11-18) + +The identify-fonts page has the Retype panel list ten matching fonts ordered by closeness, with five more on request, previews in one of three text sizes and the user's own sample text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html)). Window › Retype shows the Retype panel. Find Matching Fonts (`retype.find`, on `type.retypeFonts`) lists the fonts whose glyphs the selected shapes exactly match; Find more font matches adds five. The order is VectorCraft's own: by how many shapes each font matches, then by how closely. The sample sizes (Small, Medium, Large) and the 100-character sample text limit are VectorCraft's own too. Each row shows a sample in the font, in the size the panel menu sets and with the text typed in the panel, and a click on a row sets the font on the selected live type. Tested in `crates/engine/src/cmd/retype_fonts_tests.rs` and `crates/ui-egui/src/panels/retype/tests.rs`. Opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, near matches, installed fonts not yet loaded and images remain. + ## Control bar: Paragraph section while type is selected (2026-11-06) With type selected, the Control bar shows a Paragraph: link and the Align left, Align center and Align right buttons after its Character controls, as the public documentation has the Control panel format paragraphs while the Type tool is in use, with a way to the Paragraph panel ([Paragraph panel overview](https://helpx.adobe.com/illustrator/using/formatting-paragraphs.html)), and its alignment buttons align text as the Paragraph panel's do ([Align text](https://helpx.adobe.com/illustrator/using/align-text.html)). A button aligns the selected type (`text.setStyle {justify}`, one undo step) and the shared alignment shows selected; the link opens the Paragraph panel in a popover under it, as Character: opens the Character panel. Keeping to the three alignments that don't justify is our choice, for the bar's room; the popover has all seven. Short of room the bar leaves controls out from its right end: the inline X/Y/W/H fields, the Distribute and Align buttons, area type's vertical alignment, then these buttons and last the link, keeping room for the Transform link; on a 1536 pt bar with one point type object, the buttons show (pinned by a headless test, #5372). diff --git a/docs/type-parity.md b/docs/type-parity.md index e327f19d1b..63b3b680c8 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -56,7 +56,7 @@ against Illustrator's public documentation; **estimated** unless noted. | Alt + numeric-keypad codes while typing (Windows: `Alt+0176` → °) | partial | #5108: on Windows the character Windows posts when Alt comes up after keypad digits is typed at the caret like any other, in the typing's undo step, and the keypad digits typed with Alt run no shortcut. With NumLock off the keypad keys (Insert, End, arrows, Clear, Home, Page Up/Down without the extended-key flag) count as digits too and don't move the caret (`windows_alt_codes` unit tests; neither NumLock on nor off has been tried on a Windows machine yet). `type.insert {code}` (Windows Alt+0 code, Windows-1252 for 128–159) and `{unicode}` (hex code point) insert a character by its code (`menucmds::insert_a_character_by_its_code`). macOS and Linux have no such system convention and egui reports a keypad digit as the top-row digit, so there it does nothing; a floating panel window doesn't receive the character | | Caret: the arrows and Delete step over whole clusters (Thai consonant with its marks, combining accents, emoji); Backspace removes one character | done | in text with right-to-left characters the arrows move in visual order and stop on both sides of a character drawn with no width, such as a zero width non-joiner | | Touch Type tool | done | moves, scales and rotates one character through its kerning, baseline shift, scales and rotation (`text.touchType`); a character with a preceding logical character on the same line can move along the line in either reading direction; the first logical character moves only up and down. Positive `dx` follows reading order. These direction rules are VectorCraft's choices. | -| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), the ranked list of matching fonts with previews, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | +| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Window › Retype shows the Retype panel, which lists the fonts the selected outlined text exactly matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), filtering the list by font source, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | | Snap to Glyph | done | View › Snap to Glyph (`view.snapToGlyph`): with Smart Guides on, new point type and drawing tools snap to live-text baselines and glyph bounds, the corners of each glyph's box included, turning with rotated type (#5112; `guides::tests::a_drawn_point_lands_on_a_corner_of_a_glyphs_bounds`, `Targets::for_drawing`, `tools::text_tests::snap_to_glyph_lines_up_new_point_type_with_a_baseline`). With Alignment Guides on as well, and Snap to Grid and Snap to Pixel off, both ends of a Measure or Measure & Inspect drag snap to those guides and show them during the drag (`Targets::for_measure`, `xform::measure::tests::its_ends_land_on_glyph_guides_with_snap_to_glyph`). That the Measure tools take the guides is VectorCraft's choice; they leave out Anchor Point, which [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/snap-to-glyph.html) limits to the Pen tool and objects moved with the Selection tool. Character panel menu › Show Snap to Glyph Options: Baseline, x-height, Glyph Bounds, Proximity Guides, Angular Guides and Anchor Point each turn their guides on or off (`view.snapToGlyph.options`, all on by default; #4232), after a Snap to Glyph checkbox for View › Snap to Glyph; showing them scrolls the panel to them (#5273) | | Thai, Lao, Khmer, Myanmar: shaping (marks, reordering), lines broken between words, word-by-word caret and double-click | done | words found by ICU4X's line segmenter: dictionaries on the desktop, LSTM models on the web | | Middle Eastern: bidirectional layout, Paragraph Direction | done | PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import still needs ActualText support (#6165); separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index db8acdeedb..7d5b0ef4bf 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -479,7 +479,8 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Layers panel row context menu | done | Right-clicking a layer/group/object row shows a context menu with Options…, Duplicate, Delete, Lock/Hide Others, Locate Object, and Collect for Export — matching standard desktop layer panel conventions. | | Swatches item context menu (G12) | done | List and thumbnail items offer Swatch Options…, Duplicate Swatch and Delete Swatch for the clicked item. Right-click selects without applying paint; reserved/missing items disable actions. All 39 Swatches tests pass, including all five views and Undo; the regression fails with the menu hooks removed. Rendered headless menus inspected. Full workspace CI passed on Linux/WSL on the merged branch (all 13 gates), including the test-helper correction for the upstream compile error tracked in #7727; native Windows full CI has two unchanged engine-test failures. | | SVG Interactivity panel: JavaScript for each object's events and the document's linked JavaScript files, written to SVG and read back as text | done | `svgInteractivity.*`, `ui.javascriptFilesDialog` | -| Retype, Comments, Version History panels | missing | the last two are cloud features (out of scope) | +| Retype panel | partial | Window › Retype lists the fonts that exactly match the selected outlined text, ten and then five more, with samples in three sizes and the user's own text; a click sets the font on selected live type (`retype.find`, `type.retypeFonts`). Opening it from the Type menu, the context menu and the Properties panel, filtering by font source and favorites, near matches, installed fonts not yet loaded and text in images are missing (#4934) | +| Comments, Version History panels | missing | cloud features (out of scope) | | Blend panel (30.7) | partial | Window › Blend provides Type (Ease In, Ease Out, Ease In Out, Ease Out In), Ramp 0–100% and independent color Shift, alongside the existing blend controls. Easing is disabled without a spine. Original polynomial distributions approximate the publicly documented behavior. On-canvas Appearance and Easing widgets set Shift and Ramp; a blend without a spine shows the Appearance widget alone. [Public source](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blend-panel-overview.html) | | Gradient panel: Dither (30.0) | done | Dither box under the stops (`paint.editGradient` `dither`); dimmed behind the Stroke proxy, fills only; `panels::gradient` test | | Gradient panel: Method, Classic or Perceptual (30.0) | done | Method menu under the Stroke buttons for linear and radial gradients (`paint.editGradient` `method`); [public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/create-and-edit-gradients/control-perceptual-interpolation-in-gradients.html); `panels::gradient` test | From e8d070ea377d54afc8d8dcf29236487a30d3ae12 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 15:55:37 -0800 Subject: [PATCH 2/4] Retype: the panel says when a search left shapes out retype.find keeps the `truncated` flag type.retypeFonts returns, and retype.list returns it. When shapes past the first 2,048, or more than 16 groups deep, were not compared, the panel says so under the field. - Rows for that line and for the "Retype: select outlined text (paths or compound paths)" error in every complete catalog. The panel shows that error when a search finds no path to compare. - The params text and docs/mcp.md say "the fonts whose glyphs match the selected outlined text". docs/type-parity.md's Retype row lists the missing Type menu, context menu and Quick Actions entry points and the favorites filter, as the other two docs do. - Font samples: when eight samples are rendering, finished ones join the ready samples before a new one starts. Samples whose text changed while they rendered were never asked for again, so after eight of them no sample started; typing in the panel's sample field reaches that. - The panel test that checks the first-ranked font accepts a tie with a renamed copy that other tests load into the shared font database. Part of #4934. --- crates/engine/src/cmd/retype_fonts.rs | 6 ++-- crates/engine/src/cmd/retype_fonts_tests.rs | 15 ++++++++++ crates/mcp/src/ui_catalog.rs | 4 +-- crates/ui-egui/src/font_menu.rs | 17 +++++++++++ crates/ui-egui/src/font_menu/tests.rs | 24 +++++++++++++++ crates/ui-egui/src/i18n/bg.tsv | 2 ++ crates/ui-egui/src/i18n/bs.tsv | 2 ++ crates/ui-egui/src/i18n/ca.tsv | 2 ++ crates/ui-egui/src/i18n/cs.tsv | 2 ++ crates/ui-egui/src/i18n/da.tsv | 2 ++ crates/ui-egui/src/i18n/de.tsv | 2 ++ crates/ui-egui/src/i18n/el.tsv | 2 ++ crates/ui-egui/src/i18n/es.tsv | 2 ++ crates/ui-egui/src/i18n/fi.tsv | 2 ++ crates/ui-egui/src/i18n/fr.tsv | 2 ++ crates/ui-egui/src/i18n/gu.tsv | 2 ++ crates/ui-egui/src/i18n/hi.tsv | 2 ++ crates/ui-egui/src/i18n/hu.tsv | 2 ++ crates/ui-egui/src/i18n/id.tsv | 2 ++ crates/ui-egui/src/i18n/it.tsv | 2 ++ crates/ui-egui/src/i18n/ja.tsv | 2 ++ crates/ui-egui/src/i18n/ka.tsv | 2 ++ crates/ui-egui/src/i18n/ko.tsv | 2 ++ crates/ui-egui/src/i18n/nl.tsv | 2 ++ crates/ui-egui/src/i18n/pl.tsv | 2 ++ crates/ui-egui/src/i18n/pt-br.tsv | 2 ++ crates/ui-egui/src/i18n/ru.tsv | 2 ++ crates/ui-egui/src/i18n/sv.tsv | 2 ++ crates/ui-egui/src/i18n/tests.rs | 2 ++ crates/ui-egui/src/i18n/tr.tsv | 2 ++ crates/ui-egui/src/i18n/uk.tsv | 2 ++ crates/ui-egui/src/i18n/vi.tsv | 2 ++ crates/ui-egui/src/i18n/zh-hans.tsv | 2 ++ crates/ui-egui/src/i18n/zh-hant.tsv | 2 ++ crates/ui-egui/src/menus/ui_commands.rs | 4 +-- crates/ui-egui/src/panels/retype.rs | 16 +++++++--- crates/ui-egui/src/panels/retype/tests.rs | 33 +++++++++++++++++++-- docs/mcp.md | 9 +++--- docs/type-parity.md | 2 +- 39 files changed, 170 insertions(+), 18 deletions(-) diff --git a/crates/engine/src/cmd/retype_fonts.rs b/crates/engine/src/cmd/retype_fonts.rs index 57b3b57380..dc9a413d5f 100644 --- a/crates/engine/src/cmd/retype_fonts.rs +++ b/crates/engine/src/cmd/retype_fonts.rs @@ -1,5 +1,5 @@ -//! Retype's matching fonts (`type.retypeFonts`): the fonts whose glyphs the selected outlined text -//! is, ranked, for the Retype panel's list +//! Retype's matching fonts (`type.retypeFonts`): the fonts whose glyphs match the selected outlined +//! text, ranked, for the Retype panel's list //! (, //! ). //! The panel lists ten fonts and five more on request. Each selected glyph shape is compared with @@ -26,7 +26,7 @@ pub(in crate::cmd) fn specs() -> Vec { "Find Matching Fonts", [], None, - "{count?: 1..96 (default 10)} the fonts whose glyphs the selected outlined text is, as the Retype panel lists them: each selected shape (paths and compound paths, inside groups too) is compared with the glyphs of up to 96 loaded fonts, those of the document's live type first, by type.retype's matching (exact matches only); of two versions of a font loaded at once, only the version its family and style name gives is compared, the one choosing the font sets; the fonts rank by how many shapes each matches, then by the mean distance left after fitting, then by family and style name; the document does not change → {fonts: [{family, style, matched (shapes it matches)}] (the first count), shapes (shapes compared), more (more fonts match than count), truncated (shapes past the limits were left out)}; a count that is not a whole number from 1 to 96 is an error", + "{count?: 1..96 (default 10)} the fonts whose glyphs match the selected outlined text, as the Retype panel lists them: each selected shape (paths and compound paths, inside groups too) is compared with the glyphs of up to 96 loaded fonts, those of the document's live type first, by type.retype's matching (exact matches only); of two versions of a font loaded at once, only the version its family and style name gives is compared, the one choosing the font sets; the fonts rank by how many shapes each matches, then by the mean distance left after fitting, then by family and style name; the document does not change → {fonts: [{family, style, matched (shapes it matches)}] (the first count), shapes (shapes compared), more (more fonts match than count), truncated (shapes past the limits were left out)}; a count that is not a whole number from 1 to 96 is an error", has_selected_path, retype_fonts )] diff --git a/crates/engine/src/cmd/retype_fonts_tests.rs b/crates/engine/src/cmd/retype_fonts_tests.rs index 2c10cba2ca..d7e675f503 100644 --- a/crates/engine/src/cmd/retype_fonts_tests.rs +++ b/crates/engine/src/cmd/retype_fonts_tests.rs @@ -106,6 +106,21 @@ fn shapes_that_are_no_glyph_list_no_font() { assert!(s.execute("type.retypeFonts", &json!({})).is_err()); } +#[test] +fn shapes_past_the_limits_are_reported_as_left_out() { + let mut s = session(); + let top = outlined(&mut s, json!({"x": 40, "y": 100, "text": "A", "size": 40})); + // B, nested deeper than Retype looks. + let mut deep = outlined(&mut s, json!({"x": 40, "y": 200, "text": "B", "size": 40})); + for _ in 0..20 { + s.execute("select.set", &json!({"ids": [deep]})).unwrap(); + deep = s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap(); + } + s.execute("select.set", &json!({"ids": [top, deep]})).unwrap(); + let r = query(&mut s, json!({}), bundled()); + assert_eq!((r["shapes"].clone(), r["truncated"].clone()), (json!(1), json!(true)), "{r}"); +} + /// Two versions of one font: choosing the font by name sets the version the name gives, so only /// that version is compared, and a font whose other version alone matches is not listed. #[test] diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index e31c6d850b..d82b32e3ad 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -784,13 +784,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "retype.find", "Find Matching Fonts", "", - "{more?: bool} show the Retype panel and list the fonts whose glyphs the selected outlined text is, ranked as type.retypeFonts ranks them: ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a selection with no path or compound path, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", + "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, ranked as type.retypeFonts ranks them: ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a selection with no path or compound path, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", ), ( "retype.list", "List Matching Fonts", "", - "{} what the Retype panel shows: {searched (a search ran since the last reset), fonts: [{family, style, matched (shapes it matches)}], shapes (shapes the last search compared), more (more fonts match than the list holds), size: small|medium|large, text (the samples' text; empty for a generic sample)}", + "{} what the Retype panel shows: {searched (a search ran since the last reset), fonts: [{family, style, matched (shapes it matches)}], shapes (shapes the last search compared), more (more fonts match than the list holds), truncated (the last search left out shapes past type.retype's limits), size: small|medium|large, text (the samples' text; empty for a generic sample)}", ), ( "retype.preview", diff --git a/crates/ui-egui/src/font_menu.rs b/crates/ui-egui/src/font_menu.rs index f7a4b5cbaf..e121493234 100644 --- a/crates/ui-egui/src/font_menu.rs +++ b/crates/ui-egui/src/font_menu.rs @@ -2005,6 +2005,23 @@ fn sample_texture(ctx: &egui::Context, family: &str, style: Option<&str>, sample s.ready.insert(key, tex.clone()); return tex; } + if s.pending.len() >= MAX_PENDING { + // Finished samples join the ready ones, so samples nobody asks for again (their + // text or size changed) do not keep new ones from starting. + let mut done = vec![]; + for (k, rx) in &s.pending { + match rx.try_recv() { + Err(std::sync::mpsc::TryRecvError::Empty) => {} + Ok(img) => done.push((k.clone(), img)), + Err(std::sync::mpsc::TryRecvError::Disconnected) => done.push((k.clone(), None)), + } + } + for (k, img) in done { + s.pending.remove(&k); + let tex = img.map(|img| ctx.load_texture(format!("font-sample-{}-{}", k.0, k.3), img, egui::TextureOptions::LINEAR)); + s.ready.insert(k, tex); + } + } if s.pending.len() >= MAX_PENDING || !s.take_budget(ctx) { return None; } diff --git a/crates/ui-egui/src/font_menu/tests.rs b/crates/ui-egui/src/font_menu/tests.rs index 7d930b7af5..e6dbdcca4e 100644 --- a/crates/ui-egui/src/font_menu/tests.rs +++ b/crates/ui-egui/src/font_menu/tests.rs @@ -1729,3 +1729,27 @@ fn a_new_preview_size_keeps_the_list_on_its_rows() { assert!((large.0 - expected).abs() < 0.5, "the view starts {rows_down} rows down: offset {} for {expected}", large.0); super::wait_for_samples(&ctx); } + +/// Finished samples that are not drawn again (the sample text changed while they rendered) do not +/// keep new samples from starting. +#[cfg(not(target_arch = "wasm32"))] +#[test] +fn finished_samples_no_longer_drawn_do_not_block_new_ones() { + let ctx = egui::Context::default(); + super::SAMPLES.with(|s| { + let mut s = s.borrow_mut(); + for i in 0..super::MAX_PENDING { + let (tx, rx) = std::sync::mpsc::channel(); + tx.send(None).unwrap(); + s.pending.insert((format!("Old {i}"), "Regular".to_string(), "typed".to_string(), 20), rx); + } + }); + assert!(super::sample_texture(&ctx, "Source Sans 3", Some("Regular"), Some("typed more"), 20.0).is_none()); + let (started, kept) = super::SAMPLES.with(|s| { + let s = s.borrow(); + (s.pending.keys().any(|k| k.2 == "typed more"), s.ready.keys().filter(|k| k.0.starts_with("Old ")).count()) + }); + assert!(started, "the new sample is rendering"); + assert_eq!(kept, super::MAX_PENDING, "the finished samples are kept"); + super::wait_for_samples(&ctx); +} diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 770765ff13..8e84b4c14c 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -1262,12 +1262,14 @@ font-technology Variable Променливи Type your text to preview Въведете текст за преглед Select outlined text, then Find Matching Fonts. Изберете текст, превърнат в контури, след това „Търсене на съответстващи шрифтове“. No font matches the selected shapes. Никой шрифт не съответства на избраните фигури. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Фигурите след първите 2048 или вложени на повече от 16 нива групи не бяха сравнени. Reset Retype Panel Нулиране на панела „Повторно набиране“ List Matching Fonts Списък на съответстващите шрифтове Retype Preview Преглед в панела „Повторно набиране“ @msg `count` must be a whole number from 1 to 96 `count` трябва да е цяло число от 1 до 96 @msg `size` must be small, medium or large `size` трябва да е small, medium или large @msg `text` must be a string of at most 100 characters `text` трябва да е низ с най-много 100 знака +@msg Retype: select outlined text (paths or compound paths) Повторно набиране: изберете текст, превърнат в контури (пътища или съставни пътища) Find Next Търсене на следващ Find Objects Търсене на обекти Compare with Image Сравняване с изображение diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 79dc8c7ce5..19c62ef30d 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -428,12 +428,14 @@ Type your text to preview Upišite tekst za pregled Select outlined text, then Find Matching Fonts. Odaberite tekst pretvoren u obrise, zatim Pronađi odgovarajuće fontove. No font matches the selected shapes. Nijedan font ne odgovara odabranim oblicima. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Oblici nakon prvih 2.048, ili dublje od 16 grupa, nisu upoređeni. Reset Retype Panel Vrati panel Ponovo otkucaj na početno List Matching Fonts Prikaži odgovarajuće fontove Retype Preview Pregled u panelu Ponovo otkucaj @msg `count` must be a whole number from 1 to 96 `count` mora biti cijeli broj od 1 do 96 @msg `size` must be small, medium or large `size` mora biti small, medium ili large @msg `text` must be a string of at most 100 characters `text` mora biti niz od najviše 100 znakova +@msg Retype: select outlined text (paths or compound paths) Ponovo otkucaj: odaberite tekst pretvoren u obrise (putanje ili složene putanje) Change Case Promijeni veličinu slova UPPERCASE VELIKA SLOVA lowercase mala slova diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 26f1538c1a..e5e23ec908 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1779,12 +1779,14 @@ digits Malayalam Malaiàlam Type your text to preview Escriviu el text de la previsualització Select outlined text, then Find Matching Fonts. Seleccioneu text contornejat i després Cerca tipus de lletra coincidents. No font matches the selected shapes. Cap tipus de lletra no coincideix amb les formes seleccionades. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Les formes després de les primeres 2.048, o a més de 16 grups de profunditat, no s’han comparat. Reset Retype Panel Restableix el panell Torna a escriure List Matching Fonts Llista els tipus de lletra coincidents Retype Preview Previsualització del panell Torna a escriure @msg `count` must be a whole number from 1 to 96 `count` ha de ser un nombre enter entre 1 i 96 @msg `size` must be small, medium or large `size` ha de ser small, medium o large @msg `text` must be a string of at most 100 characters `text` ha de ser una cadena de 100 caràcters com a màxim +@msg Retype: select outlined text (paths or compound paths) Torna a escriure: seleccioneu text contornejat (camins o camins compostos) Find in Folder… Cerca en una carpeta… Find Linked Files Cerca fitxers enllaçats Find Linked Files in Folder… Cerca fitxers enllaçats en una carpeta… diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 0c612dcd49..d23d7e4a68 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -433,12 +433,14 @@ Type your text to preview Zadejte text pro náhled Select outlined text, then Find Matching Fonts. Vyberte text převedený na křivky a pak zvolte Najít odpovídající písma. No font matches the selected shapes. Vybraným tvarům neodpovídá žádné písmo. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Tvary za prvními 2 048 nebo vnořené hlouběji než 16 skupin nebyly porovnány. Reset Retype Panel Obnovit panel Přepsat List Matching Fonts Vypsat odpovídající písma Retype Preview Náhled v panelu Přepsat @msg `count` must be a whole number from 1 to 96 `count` musí být celé číslo od 1 do 96 @msg `size` must be small, medium or large `size` musí být small, medium nebo large @msg `text` must be a string of at most 100 characters `text` musí být řetězec o nejvýše 100 znacích +@msg Retype: select outlined text (paths or compound paths) Přepsat: vyberte text převedený na křivky (cesty nebo složené cesty) Change Case Změnit velikost písmen UPPERCASE VELKÁ PÍSMENA lowercase malá písmena diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index b5cdb6268d..8316afe451 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3127,12 +3127,14 @@ liquify-list-end {0}, {1} {0} og {1} Type your text to preview Skriv teksten til forhåndsvisningen Select outlined text, then Find Matching Fonts. Markér tekst konverteret til konturer, og vælg derefter Find matchende skrifttyper. No font matches the selected shapes. Ingen skrifttype matcher de markerede former. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Former ud over de første 2.048 eller mere end 16 grupper dybt blev ikke sammenlignet. Reset Retype Panel Nulstil panelet Genindtast List Matching Fonts Vis matchende skrifttyper Retype Preview Forhåndsvisning i panelet Genindtast @msg `count` must be a whole number from 1 to 96 `count` skal være et heltal fra 1 til 96 @msg `size` must be small, medium or large `size` skal være small, medium eller large @msg `text` must be a string of at most 100 characters `text` skal være en streng på højst 100 tegn +@msg Retype: select outlined text (paths or compound paths) Genindtast: markér tekst konverteret til konturer (stier eller sammensatte stier) Change Case Ændr store/små bogstaver UPPERCASE STORE BOGSTAVER lowercase små bogstaver diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 876b2fec3b..392898b3b3 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1301,12 +1301,14 @@ font-technology Variable Variabel Type your text to preview Text für die Vorschau eingeben Select outlined text, then Find Matching Fonts. Wählen Sie in Pfade umgewandelten Text aus und dann „Passende Schriften suchen“. No font matches the selected shapes. Keine Schrift passt zu den ausgewählten Formen. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Formen nach den ersten 2.048 oder mehr als 16 Gruppen tief wurden nicht verglichen. Reset Retype Panel Bedienfeld „Neu setzen“ zurücksetzen List Matching Fonts Passende Schriften auflisten Retype Preview Vorschau im Bedienfeld „Neu setzen“ @msg `count` must be a whole number from 1 to 96 `count` muss eine ganze Zahl von 1 bis 96 sein @msg `size` must be small, medium or large `size` muss small, medium oder large sein @msg `text` must be a string of at most 100 characters `text` muss eine Zeichenfolge mit höchstens 100 Zeichen sein +@msg Retype: select outlined text (paths or compound paths) Neu setzen: Wählen Sie in Pfade umgewandelten Text aus (Pfade oder zusammengesetzte Pfade) Find Next Weitersuchen Find Objects Objekte suchen Compare with Image Mit Bild vergleichen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 14e0b3f349..2c1a33ebde 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -1251,12 +1251,14 @@ font-technology Variable Μεταβλητές Type your text to preview Πληκτρολογήστε κείμενο για προεπισκόπηση Select outlined text, then Find Matching Fonts. Επιλέξτε κείμενο που έχει μετατραπεί σε περιγράμματα και μετά Εύρεση αντίστοιχων γραμματοσειρών. No font matches the selected shapes. Καμία γραμματοσειρά δεν αντιστοιχεί στα επιλεγμένα σχήματα. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Τα σχήματα μετά τα πρώτα 2.048 ή σε βάθος πάνω από 16 ομάδες δεν συγκρίθηκαν. Reset Retype Panel Επαναφορά πίνακα Επαναπληκτρολόγησης List Matching Fonts Λίστα αντίστοιχων γραμματοσειρών Retype Preview Προεπισκόπηση πίνακα Επαναπληκτρολόγησης @msg `count` must be a whole number from 1 to 96 Το `count` πρέπει να είναι ακέραιος από 1 έως 96 @msg `size` must be small, medium or large Το `size` πρέπει να είναι small, medium ή large @msg `text` must be a string of at most 100 characters Το `text` πρέπει να είναι συμβολοσειρά έως 100 χαρακτήρων +@msg Retype: select outlined text (paths or compound paths) Επαναπληκτρολόγηση: επιλέξτε κείμενο που έχει μετατραπεί σε περιγράμματα (διαδρομές ή σύνθετες διαδρομές) Find Next Εύρεση επόμενου Find Objects Εύρεση αντικειμένων Compare with Image Σύγκριση με εικόνα diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index ff7efbdc0a..5feee92389 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1326,12 +1326,14 @@ font-technology Variable Variables Type your text to preview Escriba el texto de la vista previa Select outlined text, then Find Matching Fonts. Seleccione texto contorneado y luego Buscar fuentes coincidentes. No font matches the selected shapes. Ninguna fuente coincide con las formas seleccionadas. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Las formas después de las primeras 2048, o a más de 16 grupos de profundidad, no se compararon. Reset Retype Panel Restablecer panel Reescribir List Matching Fonts Enumerar fuentes coincidentes Retype Preview Vista previa del panel Reescribir @msg `count` must be a whole number from 1 to 96 `count` debe ser un número entero entre 1 y 96 @msg `size` must be small, medium or large `size` debe ser small, medium o large @msg `text` must be a string of at most 100 characters `text` debe ser una cadena de 100 caracteres como máximo +@msg Retype: select outlined text (paths or compound paths) Reescribir: seleccione texto contorneado (trazados o trazados compuestos) Find Next Buscar siguiente Find Objects Buscar objetos Compare with Image Comparar con imagen diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 15f180ef74..a26b54b05c 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -430,12 +430,14 @@ Type your text to preview Kirjoita esikatseltava teksti Select outlined text, then Find Matching Fonts. Valitse ääriviivoiksi muunnettu teksti ja sitten Etsi vastaavat fontit. No font matches the selected shapes. Mikään fontti ei vastaa valittuja muotoja. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Ensimmäisten 2 048 jälkeisiä tai yli 16 ryhmän syvyydellä olevia muotoja ei verrattu. Reset Retype Panel Palauta Kirjoita uudelleen -paneeli List Matching Fonts Luettele vastaavat fontit Retype Preview Kirjoita uudelleen -paneelin esikatselu @msg `count` must be a whole number from 1 to 96 `count` on oltava kokonaisluku 1–96 @msg `size` must be small, medium or large `size` on oltava small, medium tai large @msg `text` must be a string of at most 100 characters `text` on oltava enintään 100 merkin merkkijono +@msg Retype: select outlined text (paths or compound paths) Kirjoita uudelleen: valitse ääriviivoiksi muunnettu teksti (polut tai yhdistelmäpolut) Change Case Vaihda kirjainkoko UPPERCASE ISOT KIRJAIMET lowercase pienet kirjaimet diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index b6b2b31e99..8a136d67ba 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1316,12 +1316,14 @@ font-technology Variable Variables Type your text to preview Saisissez le texte à prévisualiser Select outlined text, then Find Matching Fonts. Sélectionnez du texte vectorisé, puis Rechercher les polices correspondantes. No font matches the selected shapes. Aucune police ne correspond aux formes sélectionnées. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Les formes au-delà des 2 048 premières, ou à plus de 16 niveaux de groupe, n’ont pas été comparées. Reset Retype Panel Réinitialiser le panneau Retaper List Matching Fonts Lister les polices correspondantes Retype Preview Aperçu du panneau Retaper @msg `count` must be a whole number from 1 to 96 `count` doit être un nombre entier compris entre 1 et 96 @msg `size` must be small, medium or large `size` doit valoir small, medium ou large @msg `text` must be a string of at most 100 characters `text` doit être une chaîne d’au plus 100 caractères +@msg Retype: select outlined text (paths or compound paths) Pour Retaper, sélectionnez du texte vectorisé (tracés ou tracés composés) Find Next Rechercher le suivant Find Objects Rechercher des objets Compare with Image Comparer à une image diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index e227b293a2..c3dc625912 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -1435,12 +1435,14 @@ Type your text to preview પૂર્વાવલોકન માટે તમારું લખાણ ટાઇપ કરો Select outlined text, then Find Matching Fonts. આઉટલાઇન કરેલું લખાણ પસંદ કરો, પછી મેળ ખાતા ફૉન્ટ શોધો. No font matches the selected shapes. કોઈ ફૉન્ટ પસંદ કરેલા આકારો સાથે મેળ ખાતો નથી. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. પહેલા 2,048 પછીના, અથવા 16 થી વધુ જૂથ ઊંડે આવેલા આકારો સરખાવ્યા નથી. Reset Retype Panel ફરી ટાઇપ કરો પેનલ રીસેટ કરો List Matching Fonts મેળ ખાતા ફૉન્ટની યાદી Retype Preview ફરી ટાઇપ કરો પેનલનું પૂર્વાવલોકન @msg `count` must be a whole number from 1 to 96 `count` 1 થી 96 સુધીની પૂર્ણ સંખ્યા હોવી જોઈએ @msg `size` must be small, medium or large `size` small, medium અથવા large હોવું જોઈએ @msg `text` must be a string of at most 100 characters `text` વધુમાં વધુ 100 અક્ષરોની સ્ટ્રિંગ હોવી જોઈએ +@msg Retype: select outlined text (paths or compound paths) ફરી ટાઇપ કરો: આઉટલાઇન કરેલું લખાણ પસંદ કરો (પાથ અથવા કમ્પાઉન્ડ પાથ) Find In આમાં શોધો Find Linked Files લિંક્ડ ફાઇલો શોધો Find Linked Files in Folder… ફોલ્ડરમાં લિંક્ડ ફાઇલો શોધો… diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 050151cabf..76f8c7bf2c 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1971,12 +1971,14 @@ antiAlias Sharp शार्प Type your text to preview प्रीव्यू के लिए अपना टेक्स्ट टाइप करें Select outlined text, then Find Matching Fonts. आउटलाइन किया गया टेक्स्ट चुनें, फिर मिलते-जुलते फ़ॉन्ट खोजें। No font matches the selected shapes. कोई फ़ॉन्ट चुने गए आकारों से मेल नहीं खाता। + Shapes past the first 2,048, or more than 16 groups deep, were not compared. पहले 2,048 के बाद के, या 16 से अधिक समूहों की गहराई वाले आकारों की तुलना नहीं की गई। Reset Retype Panel फिर से टाइप करें पैनल रीसेट करें List Matching Fonts मिलते-जुलते फ़ॉन्ट की सूची Retype Preview फिर से टाइप करें पैनल का प्रीव्यू @msg `count` must be a whole number from 1 to 96 `count` 1 से 96 तक पूरी संख्या होना चाहिए @msg `size` must be small, medium or large `size` को small, medium या large होना चाहिए @msg `text` must be a string of at most 100 characters `text` अधिकतम 100 वर्णों की स्ट्रिंग होनी चाहिए +@msg Retype: select outlined text (paths or compound paths) फिर से टाइप करें: आउटलाइन किया गया टेक्स्ट चुनें (पाथ या कंपाउंड पाथ) Find Fonts फाइंड फ़ॉन्ट Find Fonts in Folder… फ़ोल्डर में फ़ॉन्ट खोजें… Find in Folder… फ़ोल्डर में खोजें… diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 3318e5b8d3..f0260764a2 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -1641,12 +1641,14 @@ digits Malayalam Malajálam Type your text to preview Írja be az előnézet szövegét Select outlined text, then Find Matching Fonts. Jelöljön ki körvonalakká alakított szöveget, majd válassza az Egyező betűtípusok keresése parancsot. No font matches the selected shapes. Egyik betűtípus sem egyezik a kijelölt alakzatokkal. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Az első 2048 utáni, illetve 16 csoportnál mélyebben lévő alakzatok összehasonlítása elmaradt. Reset Retype Panel Újragépelés panel visszaállítása List Matching Fonts Egyező betűtípusok listázása Retype Preview Újragépelés panel előnézete @msg `count` must be a whole number from 1 to 96 `count`: 1 és 96 közötti egész szám kell @msg `size` must be small, medium or large `size`: small, medium vagy large kell @msg `text` must be a string of at most 100 characters `text`: legfeljebb 100 karakteres karakterlánc kell +@msg Retype: select outlined text (paths or compound paths) Újragépelés: jelöljön ki körvonalakká alakított szöveget (útvonalakat vagy összetett útvonalakat) Find in Folder… Keresés mappában… Find Next Következő keresése Find Objects Objektumok keresése diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index bc00f25fe9..ca15b438d7 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -396,12 +396,14 @@ Type your text to preview Ketik teks untuk pratinjau Select outlined text, then Find Matching Fonts. Pilih teks yang sudah dijadikan kerangka, lalu Temukan font yang cocok. No font matches the selected shapes. Tidak ada font yang cocok dengan bentuk yang dipilih. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Bentuk setelah 2.048 pertama, atau lebih dalam dari 16 grup, tidak dibandingkan. Reset Retype Panel Setel ulang panel Ketik Ulang List Matching Fonts Daftar font yang cocok Retype Preview Pratinjau panel Ketik Ulang @msg `count` must be a whole number from 1 to 96 `count` harus bilangan bulat dari 1 sampai 96 @msg `size` must be small, medium or large `size` harus small, medium, atau large @msg `text` must be a string of at most 100 characters `text` harus string dengan paling banyak 100 karakter +@msg Retype: select outlined text (paths or compound paths) Ketik Ulang: pilih teks yang sudah dijadikan kerangka (path atau path gabungan) Change Case Ubah huruf besar-kecil UPPERCASE HURUF BESAR lowercase huruf kecil diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 4df75bd87a..9749ba2b3a 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1338,12 +1338,14 @@ font-technology Variable Variabili Type your text to preview Digita il testo dell’anteprima Select outlined text, then Find Matching Fonts. Seleziona testo vettorializzato, poi Trova font corrispondenti. No font matches the selected shapes. Nessun font corrisponde alle forme selezionate. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Le forme oltre le prime 2.048, o a più di 16 gruppi di profondità, non sono state confrontate. Reset Retype Panel Reimposta pannello Ridigita List Matching Fonts Elenca font corrispondenti Retype Preview Anteprima del pannello Ridigita @msg `count` must be a whole number from 1 to 96 `count` deve essere un numero intero compreso tra 1 e 96 @msg `size` must be small, medium or large `size` deve essere small, medium o large @msg `text` must be a string of at most 100 characters `text` deve essere una stringa di al massimo 100 caratteri +@msg Retype: select outlined text (paths or compound paths) Ridigita: seleziona testo vettorializzato (tracciati o tracciati composti) Find Next Trova successivo Find Objects Trova oggetti Compare with Image Confronta con immagine diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 40b655dfc1..f037626b93 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -481,12 +481,14 @@ digits Malayalam マラヤーラム数字 Type your text to preview プレビューするテキストを入力 Select outlined text, then Find Matching Fonts. アウトライン化したテキストを選択してから、一致するフォントを検索してください。 No font matches the selected shapes. 選択したシェイプに一致するフォントはありません。 + Shapes past the first 2,048, or more than 16 groups deep, were not compared. 最初の 2,048 個より後のシェイプと、グループの入れ子が 16 階層より深いシェイプは比較していません。 Reset Retype Panel リタイプパネルをリセット List Matching Fonts 一致するフォントの一覧 Retype Preview リタイプパネルのプレビュー @msg `count` must be a whole number from 1 to 96 `count` には 1 から 96 の整数を指定してください @msg `size` must be small, medium or large `size` には small、medium、large のいずれかを指定してください @msg `text` must be a string of at most 100 characters `text` には 100 文字以内の文字列を指定してください +@msg Retype: select outlined text (paths or compound paths) リタイプ: アウトライン化したテキスト (パスまたは複合パス) を選択してください Change Case 大文字と小文字の変更 UPPERCASE すべて大文字 lowercase すべて小文字 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index d27a51fb8b..d107aa10bb 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -2562,12 +2562,14 @@ Type your text to preview აკრიფეთ ტექსტი წინასწარი ნახვისთვის Select outlined text, then Find Matching Fonts. მონიშნეთ კონტურებად გარდაქმნილი ტექსტი, შემდეგ აირჩიეთ შესაბამისი შრიფტების ძებნა. No font matches the selected shapes. არცერთი შრიფტი არ შეესაბამება მონიშნულ ფიგურებს. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. პირველი 2048-ის შემდეგი ან 16 ჯგუფზე ღრმად მოთავსებული ფიგურები არ შედარდა. Reset Retype Panel ხელახლა აკრეფის პანელის ჩამოყრა List Matching Fonts შესაბამისი შრიფტების სია Retype Preview ხელახლა აკრეფის პანელის წინასწარი ნახვა @msg `count` must be a whole number from 1 to 96 `count` უნდა იყოს მთელი რიცხვი 1-დან 96-მდე @msg `size` must be small, medium or large `size` უნდა იყოს small, medium ან large @msg `text` must be a string of at most 100 characters `text` უნდა იყოს არაუმეტეს 100 სიმბოლოს სტრიქონი +@msg Retype: select outlined text (paths or compound paths) ხელახლა აკრეფა: მონიშნეთ კონტურებად გარდაქმნილი ტექსტი (კონტურები ან შედგენილი კონტურები) Change Case რეგისტრის შეცვლა UPPERCASE მთავრული lowercase პატარა ასოები diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 1454ace361..4f2696577d 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -474,12 +474,14 @@ digits Malayalam 말라얄람어 Type your text to preview 미리 볼 텍스트 입력 Select outlined text, then Find Matching Fonts. 윤곽선으로 만든 텍스트를 선택한 다음 일치하는 글꼴 찾기를 누르세요. No font matches the selected shapes. 선택한 모양과 일치하는 글꼴이 없습니다. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. 처음 2,048개 이후의 모양이나 16단계보다 깊은 그룹 안의 모양은 비교하지 않았습니다. Reset Retype Panel 리타입 패널 재설정 List Matching Fonts 일치하는 글꼴 목록 Retype Preview 리타입 패널 미리 보기 @msg `count` must be a whole number from 1 to 96 `count`는 1에서 96 사이의 정수여야 합니다 @msg `size` must be small, medium or large `size`는 small, medium 또는 large여야 합니다 @msg `text` must be a string of at most 100 characters `text`는 최대 100자의 문자열이어야 합니다 +@msg Retype: select outlined text (paths or compound paths) 리타입: 윤곽선으로 만든 텍스트(패스 또는 컴파운드 패스)를 선택하세요 Change Case 대소문자 변경 UPPERCASE 대문자 lowercase 소문자 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index da880f9706..75b134c673 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -998,12 +998,14 @@ liquify-list-end {0}, {1} {0} en {1} Type your text to preview Typ de tekst voor het voorbeeld Select outlined text, then Find Matching Fonts. Selecteer omgezette tekst en kies dan Overeenkomende lettertypen zoeken. No font matches the selected shapes. Geen lettertype komt overeen met de geselecteerde vormen. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Vormen na de eerste 2.048, of meer dan 16 groepen diep, zijn niet vergeleken. Reset Retype Panel Paneel Opnieuw typen herstellen List Matching Fonts Overeenkomende lettertypen weergeven Retype Preview Voorbeeld in paneel Opnieuw typen @msg `count` must be a whole number from 1 to 96 `count` moet een geheel getal van 1 tot 96 zijn @msg `size` must be small, medium or large `size` moet small, medium of large zijn @msg `text` must be a string of at most 100 characters `text` moet een tekenreeks van hoogstens 100 tekens zijn +@msg Retype: select outlined text (paths or compound paths) Opnieuw typen: selecteer omgezette tekst (paden of samengestelde paden) Change Case Hoofdlettergebruik wijzigen UPPERCASE HOOFDLETTERS lowercase kleine letters diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index bdef720e16..9680e5611f 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -392,12 +392,14 @@ Type your text to preview Wpisz tekst do podglądu Select outlined text, then Find Matching Fonts. Zaznacz tekst zamieniony na kontury, a następnie wybierz Znajdź pasujące czcionki. No font matches the selected shapes. Żadna czcionka nie pasuje do zaznaczonych kształtów. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Kształty po pierwszych 2048 lub zagnieżdżone głębiej niż 16 grup nie zostały porównane. Reset Retype Panel Resetuj panel Przepisz List Matching Fonts Wyświetl pasujące czcionki Retype Preview Podgląd w panelu Przepisz @msg `count` must be a whole number from 1 to 96 `count` musi być liczbą całkowitą od 1 do 96 @msg `size` must be small, medium or large `size` musi mieć wartość small, medium lub large @msg `text` must be a string of at most 100 characters `text` musi być ciągiem o długości co najwyżej 100 znaków +@msg Retype: select outlined text (paths or compound paths) Przepisz: zaznacz tekst zamieniony na kontury (ścieżki lub ścieżki złożone) Change Case Zmień wielkość liter UPPERCASE WIELKIE LITERY lowercase małe litery diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 6fa28c0b32..7f5a32f140 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1208,12 +1208,14 @@ antiAlias Sharp Nítido Type your text to preview Digite o texto da visualização Select outlined text, then Find Matching Fonts. Selecione texto contornado e depois Localizar Fontes Correspondentes. No font matches the selected shapes. Nenhuma fonte corresponde às formas selecionadas. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. As formas além das primeiras 2.048, ou a mais de 16 grupos de profundidade, não foram comparadas. Reset Retype Panel Redefinir Painel Redigitar List Matching Fonts Listar Fontes Correspondentes Retype Preview Visualização do Painel Redigitar @msg `count` must be a whole number from 1 to 96 `count` deve ser um número inteiro de 1 a 96 @msg `size` must be small, medium or large `size` deve ser small, medium ou large @msg `text` must be a string of at most 100 characters `text` deve ser uma string de no máximo 100 caracteres +@msg Retype: select outlined text (paths or compound paths) Redigitar: selecione texto contornado (demarcadores ou demarcadores compostos) Find Next Localizar Próximo Find and Replace… Localizar e Substituir… First Page Primeira Página diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 23b566469f..63dfbaa598 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1324,12 +1324,14 @@ font-technology Variable Вариативные Type your text to preview Введите текст для просмотра Select outlined text, then Find Matching Fonts. Выделите текст, преобразованный в кривые, затем выберите «Найти подходящие шрифты». No font matches the selected shapes. Ни один шрифт не подходит к выделенным фигурам. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Фигуры после первых 2048 или вложенные глубже 16 уровней групп не сравнивались. Reset Retype Panel Сбросить панель «Перенабор» List Matching Fonts Список подходящих шрифтов Retype Preview Просмотр в панели «Перенабор» @msg `count` must be a whole number from 1 to 96 `count` должно быть целым числом от 1 до 96 @msg `size` must be small, medium or large `size` должно быть small, medium или large @msg `text` must be a string of at most 100 characters `text` должно быть строкой длиной не более 100 символов +@msg Retype: select outlined text (paths or compound paths) Перенабор: выделите текст, преобразованный в кривые (контуры или составные контуры) Find Next Найти далее Find Objects Найти объекты Compare with Image Сравнить с изображением diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 74e73b693d..4bdef6f01b 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1285,12 +1285,14 @@ font-technology Variable Variabla Type your text to preview Skriv texten för förhandsgranskningen Select outlined text, then Find Matching Fonts. Markera text som gjorts om till konturer och välj sedan Sök matchande typsnitt. No font matches the selected shapes. Inget typsnitt matchar de markerade formerna. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Former efter de första 2 048, eller mer än 16 grupper djupt, jämfördes inte. Reset Retype Panel Återställ panelen Skriv om List Matching Fonts Lista matchande typsnitt Retype Preview Förhandsgranskning i panelen Skriv om @msg `count` must be a whole number from 1 to 96 `count` måste vara ett heltal från 1 till 96 @msg `size` must be small, medium or large `size` måste vara small, medium eller large @msg `text` must be a string of at most 100 characters `text` måste vara en sträng på högst 100 tecken +@msg Retype: select outlined text (paths or compound paths) Skriv om: markera text som gjorts om till konturer (banor eller sammansatta banor) Find Next Sök nästa Find Objects Sök objekt Compare with Image Jämför med bild diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index e65dcd473b..613d9a155f 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -2902,6 +2902,7 @@ fn retype_panel_strings_are_in_complete_catalogs() { "Type your text to preview", "Select outlined text, then Find Matching Fonts.", "No font matches the selected shapes.", + "Shapes past the first 2,048, or more than 16 groups deep, were not compared.", "Reset Retype Panel", "List Matching Fonts", "Retype Preview", @@ -2917,6 +2918,7 @@ fn retype_panel_strings_are_in_complete_catalogs() { "`count` must be a whole number from 1 to 96", "`size` must be small, medium or large", "`text` must be a string of at most 100 characters", + "Retype: select outlined text (paths or compound paths)", ] { if message(lang, m) == m { missing.push(format!("{code} @msg {m}")); diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 8a36e2a56a..69f1794ab5 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -1275,12 +1275,14 @@ font-technology Variable Değişken Type your text to preview Önizleme için metninizi yazın Select outlined text, then Find Matching Fonts. Anahatlara dönüştürülmüş metni seçin, ardından Eşleşen Yazı Tiplerini Bul komutunu seçin. No font matches the selected shapes. Seçili şekillerle eşleşen yazı tipi yok. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. İlk 2.048 şeklin ötesindeki veya 16 gruptan daha derindeki şekiller karşılaştırılmadı. Reset Retype Panel Yeniden Yaz Panelini Sıfırla List Matching Fonts Eşleşen Yazı Tiplerini Listele Retype Preview Yeniden Yaz Paneli Önizlemesi @msg `count` must be a whole number from 1 to 96 `count` 1 ile 96 arasında bir tam sayı olmalıdır @msg `size` must be small, medium or large `size` small, medium veya large olmalıdır @msg `text` must be a string of at most 100 characters `text` en fazla 100 karakterlik bir dize olmalıdır +@msg Retype: select outlined text (paths or compound paths) Yeniden Yaz: anahatlara dönüştürülmüş metni seçin (yollar veya bileşik yollar) Find Next Sonrakini Bul Find Objects Nesneleri Bul Compare with Image Görüntüyle Karşılaştır diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 5d865d9946..73011b1dc8 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1332,12 +1332,14 @@ font-technology Variable Варіативні Type your text to preview Введіть текст для перегляду Select outlined text, then Find Matching Fonts. Виділіть текст, перетворений на криві, потім виберіть «Знайти відповідні шрифти». No font matches the selected shapes. Жоден шрифт не відповідає виділеним фігурам. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Фігури після перших 2048 або вкладені глибше 16 рівнів груп не порівнювалися. Reset Retype Panel Скинути панель «Повторний набір» List Matching Fonts Список відповідних шрифтів Retype Preview Перегляд у панелі «Повторний набір» @msg `count` must be a whole number from 1 to 96 `count` має бути цілим числом від 1 до 96 @msg `size` must be small, medium or large `size` має бути small, medium або large @msg `text` must be a string of at most 100 characters `text` має бути рядком довжиною не більше 100 символів +@msg Retype: select outlined text (paths or compound paths) Повторний набір: виділіть текст, перетворений на криві (контури або складені контури) Find Next Знайти далі Find Objects Знайти об’єкти Compare with Image Порівняти із зображенням diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 2dc6a229d8..cc0301c997 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -1554,12 +1554,14 @@ digits Malayalam Malayalam Type your text to preview Nhập văn bản để xem trước Select outlined text, then Find Matching Fonts. Chọn văn bản đã chuyển thành đường viền, rồi Tìm phông khớp. No font matches the selected shapes. Không có phông nào khớp với các hình đã chọn. + Shapes past the first 2,048, or more than 16 groups deep, were not compared. Các hình sau 2.048 hình đầu tiên, hoặc sâu hơn 16 nhóm, không được so sánh. Reset Retype Panel Đặt lại bảng Gõ lại List Matching Fonts Liệt kê phông khớp Retype Preview Xem trước trong bảng Gõ lại @msg `count` must be a whole number from 1 to 96 `count` phải là số nguyên từ 1 đến 96 @msg `size` must be small, medium or large `size` phải là small, medium hoặc large @msg `text` must be a string of at most 100 characters `text` phải là chuỗi tối đa 100 ký tự +@msg Retype: select outlined text (paths or compound paths) Gõ lại: chọn văn bản đã chuyển thành đường viền (đường dẫn hoặc đường dẫn phức hợp) Find in Folder… Tìm trong thư mục… Find Linked Files Tìm tệp liên kết Find Linked Files in Folder… Tìm tệp liên kết trong thư mục… diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index aa1d6f12e0..7dd55e3e18 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1269,12 +1269,14 @@ antiAlias Sharp 锐利 Type your text to preview 输入要预览的文本 Select outlined text, then Find Matching Fonts. 选择已转为轮廓的文字,然后查找匹配字体。 No font matches the selected shapes. 没有字体与所选形状匹配。 + Shapes past the first 2,048, or more than 16 groups deep, were not compared. 前 2,048 个之后的形状,以及嵌套超过 16 层编组的形状,未进行比较。 Reset Retype Panel 重置重新键入面板 List Matching Fonts 列出匹配字体 Retype Preview 重新键入面板预览 @msg `count` must be a whole number from 1 to 96 `count` 必须是 1 到 96 之间的整数 @msg `size` must be small, medium or large `size` 必须是 small、medium 或 large @msg `text` must be a string of at most 100 characters `text` 必须是不超过 100 个字符的字符串 +@msg Retype: select outlined text (paths or compound paths) 重新键入:选择已转为轮廓的文字(路径或复合路径) Find Next 查找下一个 Find Objects 查找对象 Compare with Image 与图像比较 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index f4b17c5c19..c8bf5078d2 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1303,12 +1303,14 @@ font-technology Variable 可變 Type your text to preview 輸入要預覽的文字 Select outlined text, then Find Matching Fonts. 選取已轉為外框的文字,然後尋找相符字體。 No font matches the selected shapes. 沒有字體與所選形狀相符。 + Shapes past the first 2,048, or more than 16 groups deep, were not compared. 前 2,048 個之後的形狀,以及巢狀超過 16 層群組的形狀,未進行比較。 Reset Retype Panel 重設重新鍵入面板 List Matching Fonts 列出相符字體 Retype Preview 重新鍵入面板預覽 @msg `count` must be a whole number from 1 to 96 `count` 必須是介於 1 到 96 的整數 @msg `size` must be small, medium or large `size` 必須是 small、medium 或 large @msg `text` must be a string of at most 100 characters `text` 必須是不超過 100 個字元的字串 +@msg Retype: select outlined text (paths or compound paths) 重新鍵入:選取已轉為外框的文字(路徑或複合路徑) Find Next 尋找下一個 Find Objects 尋找物件 Compare with Image 與影像比較 diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 4bfabe9314..42c8b009c0 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -785,13 +785,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "retype.find", "Find Matching Fonts", "", - "{more?: bool} show the Retype panel and list the fonts whose glyphs the selected outlined text is, ranked as type.retypeFonts ranks them: ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a selection with no path or compound path, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", + "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, ranked as type.retypeFonts ranks them: ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a selection with no path or compound path, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", ), ( "retype.list", "List Matching Fonts", "", - "{} what the Retype panel shows: {searched (a search ran since the last reset), fonts: [{family, style, matched (shapes it matches)}], shapes (shapes the last search compared), more (more fonts match than the list holds), size: small|medium|large, text (the samples' text; empty for a generic sample)}", + "{} what the Retype panel shows: {searched (a search ran since the last reset), fonts: [{family, style, matched (shapes it matches)}], shapes (shapes the last search compared), more (more fonts match than the list holds), truncated (the last search left out shapes past type.retype's limits), size: small|medium|large, text (the samples' text; empty for a generic sample)}", ), ( "retype.preview", diff --git a/crates/ui-egui/src/panels/retype.rs b/crates/ui-egui/src/panels/retype.rs index e8594490f5..02541cb65d 100644 --- a/crates/ui-egui/src/panels/retype.rs +++ b/crates/ui-egui/src/panels/retype.rs @@ -1,5 +1,5 @@ -//! Retype panel (Window › Retype): the fonts whose glyphs the selected outlined text is, ranked by -//! how many of its shapes each matches (`type.retypeFonts`), each with a sample +//! Retype panel (Window › Retype): the fonts whose glyphs match the selected outlined text, ranked +//! by how many of its shapes each matches (`type.retypeFonts`), each with a sample //! (, //! ). //! Find Matching Fonts lists ten, and Find more font matches at the end of the list five more. The @@ -59,6 +59,9 @@ pub struct View { pub rest: Vec, /// The shapes the last search compared. pub shapes: u64, + /// The last search left out shapes past `type.retype`'s limits (2,048 shapes, 16 nested + /// groups). + pub truncated: bool, pub size: Size, /// The samples' text (empty: a generic sample). pub text: String, @@ -92,6 +95,9 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { } widgets::divider(ui); let view = app.ui.retype.clone(); + if view.searched && view.truncated { + widgets::dim_label(ui, tl!("Shapes past the first 2,048, or more than 16 groups deep, were not compared.")); + } if !view.searched { widgets::dim_label(ui, tl!("Select outlined text, then Find Matching Fonts.")); } else if view.fonts.is_empty() { @@ -176,7 +182,7 @@ pub(crate) fn command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option preview(app, p), "retype.reset" => { let v = &mut app.ui.retype; - (v.searched, v.fonts, v.rest, v.shapes) = (false, vec![], vec![], 0); + (v.searched, v.fonts, v.rest, v.shapes, v.truncated) = (false, vec![], vec![], 0, false); Ok(list(&app.ui.retype)) } _ => return None, @@ -184,13 +190,14 @@ pub(crate) fn command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option Value { json!({ "searched": v.searched, "fonts": v.fonts.iter().map(|f| json!({"family": f.family, "style": f.style, "matched": f.matched})).collect::>(), "shapes": v.shapes, "more": !v.rest.is_empty(), + "truncated": v.truncated, "size": size_name(v.size), "text": v.text, }) @@ -228,6 +235,7 @@ fn find(app: &mut VectorcraftApp, p: &Value) -> Result { let rest = fonts.split_off(fonts.len().min(FIRST)); let v = &mut app.ui.retype; (v.searched, v.fonts, v.rest, v.shapes) = (true, fonts, rest, r["shapes"].as_u64().unwrap_or(0)); + v.truncated = r["truncated"].as_bool().unwrap_or(false); Ok(list(&app.ui.retype)) } diff --git a/crates/ui-egui/src/panels/retype/tests.rs b/crates/ui-egui/src/panels/retype/tests.rs index 19ad086747..8a7370bc5a 100644 --- a/crates/ui-egui/src/panels/retype/tests.rs +++ b/crates/ui-egui/src/panels/retype/tests.rs @@ -67,7 +67,11 @@ fn find_lists_the_matching_fonts_and_shows_the_panel() { let r = app.run("retype.find", json!({})).unwrap(); assert_eq!(r["searched"], json!(true), "{r}"); assert_eq!(r["shapes"], json!(6)); - assert_eq!(families(&r).first(), Some(&("Source Sans 3".to_string(), "Bold".to_string())), "{r}"); + // The panel reads the app's shared font database, where other tests load renamed copies of the + // bundled fonts; a copy ties with its original, so the font is checked among the first rank. + let fonts = r["fonts"].as_array().unwrap(); + let top = fonts.first().map(|f| f["matched"].clone()); + assert!(fonts.iter().any(|f| f["family"] == json!("Source Sans 3") && f["style"] == json!("Bold") && Some(f["matched"].clone()) == top), "{r}"); assert!(families(&r).len() <= 10, "ten at first: {r}"); assert!(crate::panel_docking::showing(&app.ui, ID), "the panel shows"); assert!(app.session.active().unwrap().doc == before, "the document does not change"); @@ -146,7 +150,32 @@ fn preview_sets_the_size_and_text_and_reset_keeps_them() { select(&mut app, &[g]); app.run("retype.find", json!({})).unwrap(); let r = app.run("retype.reset", json!({})).unwrap(); - assert_eq!(r, json!({"searched": false, "fonts": [], "shapes": 0, "more": false, "size": "large", "text": "Hamburg"})); + assert_eq!(r, json!({"searched": false, "fonts": [], "shapes": 0, "more": false, "truncated": false, "size": "large", "text": "Hamburg"})); +} + +#[test] +fn a_search_that_left_out_shapes_says_so() { + let mut app = app(); + let top = outlined(&mut app, json!({"x": 40, "y": 100, "text": "A", "size": 40})); + // B, nested deeper than Retype looks. + let mut deep = outlined(&mut app, json!({"x": 40, "y": 200, "text": "B", "size": 40})); + for _ in 0..20 { + select(&mut app, &[deep]); + deep = app.session.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap(); + } + select(&mut app, &[top, deep]); + let r = app.run("retype.find", json!({})).unwrap(); + assert_eq!((r["shapes"].clone(), r["truncated"].clone()), (json!(1), json!(true)), "{r}"); + let note = "Shapes past the first 2,048, or more than 16 groups deep, were not compared."; + let ctx = context(); + frame(&mut app, &ctx, vec![], show); + assert!(frame(&mut app, &ctx, vec![], show).iter().any(|n| n.label() == Some(note) || n.value() == Some(note)), "the panel says so"); + // A search that left nothing out, and a reset, clear it. + select(&mut app, &[top]); + assert_eq!(app.run("retype.find", json!({})).unwrap()["truncated"], json!(false)); + select(&mut app, &[top, deep]); + app.run("retype.find", json!({})).unwrap(); + assert_eq!(app.run("retype.reset", json!({})).unwrap()["truncated"], json!(false)); } #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 6e46535dff..9994c80535 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -11489,7 +11489,7 @@ on an open path that are not drawn because they fall before the path's start can ## Retype panel -`type.retypeFonts {count?}` lists the fonts whose glyphs the selected outlined text is. It compares each selected path +`type.retypeFonts {count?}` lists the fonts whose glyphs match the selected outlined text. It compares each selected path and compound path, inside groups too, with the glyphs of up to 96 loaded fonts, those of the document's live type first, by the matching `type.retype` uses, and it counts only exact matches. When two versions of a font are loaded, only the version its family and style name gives is compared, which is the version that choosing the font sets. The @@ -11509,9 +11509,10 @@ was. Each row shows the font's family and style over a sample of the font. While click on a row sets that font on it, as the font menus do; live type inside a selected group counts too. The list stays when the selection changes. -`retype.list {}` → `{searched, fonts: [{family, style, matched}], shapes, more, size, text}`. `searched` is false -until a search runs and after a reset. `size` is `small`, `medium` or `large`, and `text` is the samples' text (empty -for a generic sample). The panel menu's Small, Medium and Large items and the sample field run +`retype.list {}` → `{searched, fonts: [{family, style, matched}], shapes, more, truncated, size, text}`. `searched` is +false until a search runs and after a reset. `truncated` is true when the last search left out shapes past the limits +of `type.retype` (2,048 shapes, 16 nested groups); the panel then says that some shapes were not compared. +`size` is `small`, `medium` or `large`, and `text` is the samples' text (empty for a generic sample). The panel menu's Small, Medium and Large items and the sample field run `retype.preview {size?, text?}`. `text` holds at most 100 characters; any other value of either key is an error and changes nothing. Reset Retype Panel in the panel menu runs `retype.reset {}`, which clears the list and keeps the size and text. `retype.find`, `retype.preview` and `retype.reset` return what `retype.list` returns. diff --git a/docs/type-parity.md b/docs/type-parity.md index 63b3b680c8..1517fb22ca 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -56,7 +56,7 @@ against Illustrator's public documentation; **estimated** unless noted. | Alt + numeric-keypad codes while typing (Windows: `Alt+0176` → °) | partial | #5108: on Windows the character Windows posts when Alt comes up after keypad digits is typed at the caret like any other, in the typing's undo step, and the keypad digits typed with Alt run no shortcut. With NumLock off the keypad keys (Insert, End, arrows, Clear, Home, Page Up/Down without the extended-key flag) count as digits too and don't move the caret (`windows_alt_codes` unit tests; neither NumLock on nor off has been tried on a Windows machine yet). `type.insert {code}` (Windows Alt+0 code, Windows-1252 for 128–159) and `{unicode}` (hex code point) insert a character by its code (`menucmds::insert_a_character_by_its_code`). macOS and Linux have no such system convention and egui reports a keypad digit as the top-row digit, so there it does nothing; a floating panel window doesn't receive the character | | Caret: the arrows and Delete step over whole clusters (Thai consonant with its marks, combining accents, emoji); Backspace removes one character | done | in text with right-to-left characters the arrows move in visual order and stop on both sides of a character drawn with no width, such as a zero width non-joiner | | Touch Type tool | done | moves, scales and rotates one character through its kerning, baseline shift, scales and rotation (`text.touchType`); a character with a preceding logical character on the same line can move along the line in either reading direction; the first logical character moves only up and down. Positive `dx` follows reading order. These direction rules are VectorCraft's choices. | -| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Window › Retype shows the Retype panel, which lists the fonts the selected outlined text exactly matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), filtering the list by font source, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | +| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Window › Retype shows the Retype panel, which lists the fonts the selected outlined text exactly matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | | Snap to Glyph | done | View › Snap to Glyph (`view.snapToGlyph`): with Smart Guides on, new point type and drawing tools snap to live-text baselines and glyph bounds, the corners of each glyph's box included, turning with rotated type (#5112; `guides::tests::a_drawn_point_lands_on_a_corner_of_a_glyphs_bounds`, `Targets::for_drawing`, `tools::text_tests::snap_to_glyph_lines_up_new_point_type_with_a_baseline`). With Alignment Guides on as well, and Snap to Grid and Snap to Pixel off, both ends of a Measure or Measure & Inspect drag snap to those guides and show them during the drag (`Targets::for_measure`, `xform::measure::tests::its_ends_land_on_glyph_guides_with_snap_to_glyph`). That the Measure tools take the guides is VectorCraft's choice; they leave out Anchor Point, which [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/snap-to-glyph.html) limits to the Pen tool and objects moved with the Selection tool. Character panel menu › Show Snap to Glyph Options: Baseline, x-height, Glyph Bounds, Proximity Guides, Angular Guides and Anchor Point each turn their guides on or off (`view.snapToGlyph.options`, all on by default; #4232), after a Snap to Glyph checkbox for View › Snap to Glyph; showing them scrolls the panel to them (#5273) | | Thai, Lao, Khmer, Myanmar: shaping (marks, reordering), lines broken between words, word-by-word caret and double-click | done | words found by ICU4X's line segmenter: dictionaries on the desktop, LSTM models on the web | | Middle Eastern: bidirectional layout, Paragraph Direction | done | PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import still needs ActualText support (#6165); separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. | From e2e530710623b0c992df57e13c36ffefd72cd2f2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 17:17:08 -0800 Subject: [PATCH 3/4] Retype: the docs say the panel lists fonts matching any selected shape The Retype panel lists every font whose glyphs exactly match at least one selected outlined shape, ranked by how many shapes each matches. The rows in docs/type-parity.md and docs/ui-parity.md now say so. --- docs/type-parity.md | 2 +- docs/ui-parity.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/type-parity.md b/docs/type-parity.md index 1517fb22ca..e69a7a9e2e 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -56,7 +56,7 @@ against Illustrator's public documentation; **estimated** unless noted. | Alt + numeric-keypad codes while typing (Windows: `Alt+0176` → °) | partial | #5108: on Windows the character Windows posts when Alt comes up after keypad digits is typed at the caret like any other, in the typing's undo step, and the keypad digits typed with Alt run no shortcut. With NumLock off the keypad keys (Insert, End, arrows, Clear, Home, Page Up/Down without the extended-key flag) count as digits too and don't move the caret (`windows_alt_codes` unit tests; neither NumLock on nor off has been tried on a Windows machine yet). `type.insert {code}` (Windows Alt+0 code, Windows-1252 for 128–159) and `{unicode}` (hex code point) insert a character by its code (`menucmds::insert_a_character_by_its_code`). macOS and Linux have no such system convention and egui reports a keypad digit as the top-row digit, so there it does nothing; a floating panel window doesn't receive the character | | Caret: the arrows and Delete step over whole clusters (Thai consonant with its marks, combining accents, emoji); Backspace removes one character | done | in text with right-to-left characters the arrows move in visual order and stop on both sides of a character drawn with no width, such as a zero width non-joiner | | Touch Type tool | done | moves, scales and rotates one character through its kerning, baseline shift, scales and rotation (`text.touchType`); a character with a preceding logical character on the same line can move along the line in either reading direction; the first logical character moves only up and down. Positive `dx` follows reading order. These direction rules are VectorCraft's choices. | -| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Window › Retype shows the Retype panel, which lists the fonts the selected outlined text exactly matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | +| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Window › Retype shows the Retype panel, which lists the fonts whose glyphs exactly match at least one selected outlined shape, ranked by how many shapes each matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | | Snap to Glyph | done | View › Snap to Glyph (`view.snapToGlyph`): with Smart Guides on, new point type and drawing tools snap to live-text baselines and glyph bounds, the corners of each glyph's box included, turning with rotated type (#5112; `guides::tests::a_drawn_point_lands_on_a_corner_of_a_glyphs_bounds`, `Targets::for_drawing`, `tools::text_tests::snap_to_glyph_lines_up_new_point_type_with_a_baseline`). With Alignment Guides on as well, and Snap to Grid and Snap to Pixel off, both ends of a Measure or Measure & Inspect drag snap to those guides and show them during the drag (`Targets::for_measure`, `xform::measure::tests::its_ends_land_on_glyph_guides_with_snap_to_glyph`). That the Measure tools take the guides is VectorCraft's choice; they leave out Anchor Point, which [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/snap-to-glyph.html) limits to the Pen tool and objects moved with the Selection tool. Character panel menu › Show Snap to Glyph Options: Baseline, x-height, Glyph Bounds, Proximity Guides, Angular Guides and Anchor Point each turn their guides on or off (`view.snapToGlyph.options`, all on by default; #4232), after a Snap to Glyph checkbox for View › Snap to Glyph; showing them scrolls the panel to them (#5273) | | Thai, Lao, Khmer, Myanmar: shaping (marks, reordering), lines broken between words, word-by-word caret and double-click | done | words found by ICU4X's line segmenter: dictionaries on the desktop, LSTM models on the web | | Middle Eastern: bidirectional layout, Paragraph Direction | done | PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import still needs ActualText support (#6165); separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 7d5b0ef4bf..913078f210 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -479,7 +479,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Layers panel row context menu | done | Right-clicking a layer/group/object row shows a context menu with Options…, Duplicate, Delete, Lock/Hide Others, Locate Object, and Collect for Export — matching standard desktop layer panel conventions. | | Swatches item context menu (G12) | done | List and thumbnail items offer Swatch Options…, Duplicate Swatch and Delete Swatch for the clicked item. Right-click selects without applying paint; reserved/missing items disable actions. All 39 Swatches tests pass, including all five views and Undo; the regression fails with the menu hooks removed. Rendered headless menus inspected. Full workspace CI passed on Linux/WSL on the merged branch (all 13 gates), including the test-helper correction for the upstream compile error tracked in #7727; native Windows full CI has two unchanged engine-test failures. | | SVG Interactivity panel: JavaScript for each object's events and the document's linked JavaScript files, written to SVG and read back as text | done | `svgInteractivity.*`, `ui.javascriptFilesDialog` | -| Retype panel | partial | Window › Retype lists the fonts that exactly match the selected outlined text, ten and then five more, with samples in three sizes and the user's own text; a click sets the font on selected live type (`retype.find`, `type.retypeFonts`). Opening it from the Type menu, the context menu and the Properties panel, filtering by font source and favorites, near matches, installed fonts not yet loaded and text in images are missing (#4934) | +| Retype panel | partial | Window › Retype lists the fonts whose glyphs exactly match at least one selected outlined shape, ranked by how many shapes each matches, ten and then five more, with samples in three sizes and the user's own text; a click sets the font on selected live type (`retype.find`, `type.retypeFonts`). Opening it from the Type menu, the context menu and the Properties panel, filtering by font source and favorites, near matches, installed fonts not yet loaded and text in images are missing (#4934) | | Comments, Version History panels | missing | cloud features (out of scope) | | Blend panel (30.7) | partial | Window › Blend provides Type (Ease In, Ease Out, Ease In Out, Ease Out In), Ramp 0–100% and independent color Shift, alongside the existing blend controls. Easing is disabled without a spine. Original polynomial distributions approximate the publicly documented behavior. On-canvas Appearance and Easing widgets set Shift and Ramp; a blend without a spine shows the Appearance widget alone. [Public source](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blend-panel-overview.html) | | Gradient panel: Dither (30.0) | done | Dither box under the stops (`paint.editGradient` `dither`); dimmed behind the Stroke proxy, fills only; `panels::gradient` test | From ec0e2f463cb29f903bc3ea3238d0d76c2f856592 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 23:58:04 -0800 Subject: [PATCH 4/4] Retype: describe the 96-font search limit and when retype.find errs Find Matching Fonts compares up to 96 loaded fonts, those of the document's live type first, so a matching font past that limit is not listed. The Retype rows in docs/type-parity.md and docs/target-app-parity.md now say so. The retype.find params text said any selection without a path is an error, but {more: true} after a search adds the cached fonts whatever is selected. It now limits the error to a search. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/target-app-parity.md | 2 +- docs/type-parity.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 9f68d9f778..c9c1a60f2d 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -825,7 +825,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "retype.find", "Find Matching Fonts", "", - "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, ranked as type.retypeFonts ranks them: ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a selection with no path or compound path, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", + "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", ), ( "retype.list", diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 96043fa152..93dc664c6f 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -826,7 +826,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "retype.find", "Find Matching Fonts", "", - "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, ranked as type.retypeFonts ranks them: ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a selection with no path or compound path, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", + "{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns", ), ( "retype.list", diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 46a11bec7c..b2add2055b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2930,7 +2930,7 @@ The public pages describe Retype finding the fonts that match selected outlined ## Retype panel (2026-11-18) -The identify-fonts page has the Retype panel list ten matching fonts ordered by closeness, with five more on request, previews in one of three text sizes and the user's own sample text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html)). Window › Retype shows the Retype panel. Find Matching Fonts (`retype.find`, on `type.retypeFonts`) lists the fonts whose glyphs the selected shapes exactly match; Find more font matches adds five. The order is VectorCraft's own: by how many shapes each font matches, then by how closely. The sample sizes (Small, Medium, Large) and the 100-character sample text limit are VectorCraft's own too. Each row shows a sample in the font, in the size the panel menu sets and with the text typed in the panel, and a click on a row sets the font on the selected live type. Tested in `crates/engine/src/cmd/retype_fonts_tests.rs` and `crates/ui-egui/src/panels/retype/tests.rs`. Opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, near matches, installed fonts not yet loaded and images remain. +The identify-fonts page has the Retype panel list ten matching fonts ordered by closeness, with five more on request, previews in one of three text sizes and the user's own sample text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html)). Window › Retype shows the Retype panel. Find Matching Fonts (`retype.find`, on `type.retypeFonts`) lists the fonts whose glyphs the selected shapes exactly match, comparing up to 96 loaded fonts with those of the document's live type first, so a matching font past that limit is not listed; Find more font matches adds five. The 96-font limit is VectorCraft's own. The order is VectorCraft's own: by how many shapes each font matches, then by how closely. The sample sizes (Small, Medium, Large) and the 100-character sample text limit are VectorCraft's own too. Each row shows a sample in the font, in the size the panel menu sets and with the text typed in the panel, and a click on a row sets the font on the selected live type. Tested in `crates/engine/src/cmd/retype_fonts_tests.rs` and `crates/ui-egui/src/panels/retype/tests.rs`. Opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, near matches, installed fonts not yet loaded and images remain. ## Control bar: Paragraph section while type is selected (2026-11-06) diff --git a/docs/type-parity.md b/docs/type-parity.md index e69a7a9e2e..d97f5bc105 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -56,7 +56,7 @@ against Illustrator's public documentation; **estimated** unless noted. | Alt + numeric-keypad codes while typing (Windows: `Alt+0176` → °) | partial | #5108: on Windows the character Windows posts when Alt comes up after keypad digits is typed at the caret like any other, in the typing's undo step, and the keypad digits typed with Alt run no shortcut. With NumLock off the keypad keys (Insert, End, arrows, Clear, Home, Page Up/Down without the extended-key flag) count as digits too and don't move the caret (`windows_alt_codes` unit tests; neither NumLock on nor off has been tried on a Windows machine yet). `type.insert {code}` (Windows Alt+0 code, Windows-1252 for 128–159) and `{unicode}` (hex code point) insert a character by its code (`menucmds::insert_a_character_by_its_code`). macOS and Linux have no such system convention and egui reports a keypad digit as the top-row digit, so there it does nothing; a floating panel window doesn't receive the character | | Caret: the arrows and Delete step over whole clusters (Thai consonant with its marks, combining accents, emoji); Backspace removes one character | done | in text with right-to-left characters the arrows move in visual order and stop on both sides of a character drawn with no width, such as a zero width non-joiner | | Touch Type tool | done | moves, scales and rotates one character through its kerning, baseline shift, scales and rotation (`text.touchType`); a character with a preceding logical character on the same line can move along the line in either reading direction; the first logical character moves only up and down. Positive `dx` follows reading order. These direction rules are VectorCraft's choices. | -| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Window › Retype shows the Retype panel, which lists the fonts whose glyphs exactly match at least one selected outlined shape, ranked by how many shapes each matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | +| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Window › Retype shows the Retype panel, which lists the fonts whose glyphs exactly match at least one selected outlined shape, comparing up to 96 loaded fonts with those of the document's live type first, ranked by how many shapes each matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | | Snap to Glyph | done | View › Snap to Glyph (`view.snapToGlyph`): with Smart Guides on, new point type and drawing tools snap to live-text baselines and glyph bounds, the corners of each glyph's box included, turning with rotated type (#5112; `guides::tests::a_drawn_point_lands_on_a_corner_of_a_glyphs_bounds`, `Targets::for_drawing`, `tools::text_tests::snap_to_glyph_lines_up_new_point_type_with_a_baseline`). With Alignment Guides on as well, and Snap to Grid and Snap to Pixel off, both ends of a Measure or Measure & Inspect drag snap to those guides and show them during the drag (`Targets::for_measure`, `xform::measure::tests::its_ends_land_on_glyph_guides_with_snap_to_glyph`). That the Measure tools take the guides is VectorCraft's choice; they leave out Anchor Point, which [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/snap-to-glyph.html) limits to the Pen tool and objects moved with the Selection tool. Character panel menu › Show Snap to Glyph Options: Baseline, x-height, Glyph Bounds, Proximity Guides, Angular Guides and Anchor Point each turn their guides on or off (`view.snapToGlyph.options`, all on by default; #4232), after a Snap to Glyph checkbox for View › Snap to Glyph; showing them scrolls the panel to them (#5273) | | Thai, Lao, Khmer, Myanmar: shaping (marks, reordering), lines broken between words, word-by-word caret and double-click | done | words found by ICU4X's line segmenter: dictionaries on the desktop, LSTM models on the web | | Middle Eastern: bidirectional layout, Paragraph Direction | done | PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import still needs ActualText support (#6165); separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. |