DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge justification-dialog: a Justification dialog for the selected paragraphs (#531)
aionggf5ee2689625b
diff --cc ROADMAP.mdindex 020518b92,fcc8d78d8..0c8f1c855--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -129,30 -129,7 +129,31 @@@ list) · [roadmap.md](docs/roadmap.md)Newest first.+ - **2026-10-11:** Type › Justification… (Cmd+Alt+Shift+J, also in the Paragraph panel menu) sets word and letter spacing, glyph scaling and the composer on the selected paragraphs, sharing the Paragraph Style Options section (#531). No readiness percentage change.+- **2026-10-11** · Properties gains InDesign's Pathfinder section (Add, Subtract, Intersect, Exclude Overlap, Minus Back) with several objects selected; section titles and icon buttons have accessible names. No readiness percentage change.+- **2026-10-11** · `transform.move {copy}`, Edit › Duplicate and Step and Repeat return the copies' ids, so a script can go on with them. No readiness percentage change.+- **2026-10-11** · `object.fill` and `object.stroke` refuse a swatch name the document doesn't have (it painted nothing) and suggest the name meant (`Paper` → `[Paper]`). No readiness percentage change.+- **2026-10-11** · Japanese captions now cover print ranges, imported style handling and table+ row/column movement, including row-height distribution. Existing translation and RTL helpers+ handle the display; command IDs, stored option values and user-defined style names are unchanged.+- **2026-10-11** · Moving a sheared and rotated text frame no longer leaves trails of text behind: canvas repaints cover the frame's whole text box, not just its outline. No readiness percentage change.+- **2026-10-11** · Live corners: the yellow widget on a selected rectangle frame shows corner+ diamonds; dragging one rounds the corners, Alt-click steps the corner shape (#186).+- **2026-10-11** · Optical kerning (#181): pairs are spaced from their outlines (ink gap per band,+ pulled towards the font's stem gap, bounded) instead of silently using the font's kern pairs.+- **2026-10-11** · New Document laid out like InDesign's (#325): Recent, Saved, Print, Web and+ Mobile preset tabs beside the preset's details; saved document presets live in the engine+ (`file.savePreset`, `file.deletePreset`, `file.new {preset}`); `file.new` takes intent, units,+ start page and per-edge bleed and slug.+- **2026-10-11** · macOS: fonts that font services and managers activate (Adobe Fonts,+ RightFont) are listed, read from the files CoreText has available (#261, #327).+- **2026-10-11:** Document pages take their parent page's margins and columns (left or right parent page by side) and follow its changes unless they have their own; parent ruler guides draw and snap on the pages based on it. IDML import marks a page margin preference that differs from its parent as the page's own. No readiness percentage change.+- **2026-10-11** · Document Setup laid out like InDesign's: Page Size, Margins (new: every+ page's, `layout.documentSetup {margins}`), Bleed and Slug with links, Adjust Layout.+- **2026-10-11** · IDML reads and writes a spread's view rotation (Rotate Spread) as the+ rotation part of the spread transform (#484).+- **2026-10-11** · The document grid is drawn (View ▸ Grids & Guides ▸ Show/Hide Document Grid,+ ⌘'), on the lines Snap to Document Grid uses, behind or in front of page items (#530).- **2026-10-10 (UI.4–UI.5):** Panel tabs can move into other groups, split the dock, float, resize and return to their saved locations through shared docking transactions. Layouts persist in custom workspaces; UI and control commands share the same validated action path. Shared pane geometry and widget-state theme application retain all five palettes and local fonts. Split panes send keyboard input only to the focused canvas and scope contextual toolbar IDs per pane. No readiness percentage change.- **2026-10-10** · Version 0.6.0; releases add a Linux riscv64 tar.gz (cross-compiled, CLIsmoke-tested under QEMU).diff --cc crates/engine/src/cmd/text.rsindex b8f93cf00,52b829cd7..d9c68a62e--- a/crates/engine/src/cmd/text.rs+++ b/crates/engine/src/cmd/text.rs@@@ -1454,72 -973,35 +1462,95 @@@ fn selection_attrs(s: &mut Session, p:let pi = story.para_at(r.start);let pf = &story.paras[pi];let (pp, base) = st.doc.styles.resolve_para(pf);- let cf = if r.is_empty() { story.char_format_at(r.start) } else { story.format_after(r.start) };- let cp = st.doc.styles.resolve_char(&base, cf);+ let mut cf = if r.is_empty() { story.char_format_at(r.start) } else { story.format_after(r.start) }.clone();+ if let Some(f) = typing_format(s) {+ apply_typing_format(&mut cf, f);+ }+ let cp = st.doc.styles.resolve_char(&base, &cf);- Ok(json!({"story": sid.0, "paragraphStyle": pf.style, "characterStyle": cf.style, "para": pp, "chars": cp,- "paraOverrides": pf.para.count(), "charOverrides": cf.over.count()}))+ let mut out = json!({"story": sid.0, "paragraphStyle": pf.style, "characterStyle": cf.style, "para": pp, "chars": cp,+ "paraOverrides": pf.para.count(), "charOverrides": cf.over.count()});+ if bool_or(p, "mixed", false) {+ out["paraMixed"] = json!(mixed_para_attrs(&st.doc, &targets));+ }+ Ok(out)+ }++ /// The paragraph attributes whose resolved values differ across the paragraphs of `targets`.+ fn mixed_para_attrs(doc: &designcraft_doc::Document, targets: &[Target]) -> Vec<String> {+ let mut first: Option<serde_json::Map<String, Value>> = None;+ let mut mixed = std::collections::BTreeSet::new();+ for t in targets {+ let Some(story) = doc.text_story(t.story, t.cell) else { continue };+ let a = story.para_at(t.range.start);+ let b = story.para_at(t.range.end.max(t.range.start));+ for pf in story.paras.get(a..=b).unwrap_or(&[]) {+ let Ok(Value::Object(v)) = serde_json::to_value(doc.styles.resolve_para(pf).0) else { continue };+ match &first {+ None => first = Some(v),+ Some(f) => mixed.extend(v.into_iter().filter(|(k, x)| f.get(k) != Some(x)).map(|(k, _)| k)),+ }+ }+ }+ mixed.into_iter().collect()}+fn apply_typing_format(cf: &mut designcraft_doc::CharFormat, f: &TypingFormat) {+ cf.over.merge(&f.attrs);+ for k in &f.cleared {+ let _ = cf.over.set_json(k, &Value::Null);+ }+}++/// Bold (`bold`) or italic from the font family (style linking), per run of the selection: on or+/// off as asked, else the opposite of the first selected character.+fn link_style(s: &mut Session, p: &Value, bold: bool) -> Result<Value> {+ let id = if bold { "type.bold" } else { "type.italic" };+ let cur = selection_attrs(s, &json!({}))?;+ let family = cur["chars"]["fontFamily"].as_str().unwrap_or_default().to_string();+ let style = cur["chars"]["fontStyle"].as_str().unwrap_or_default().to_string();+ // The document's own fonts count too.+ let db = designcraft_fonts::FontDb::global().scoped(s.doc()?.doc.font_scope);+ let (weight, italic) = db.traits_of(&family, &style);+ let on = p.get("on").and_then(Value::as_bool).unwrap_or(if bold { weight < 650.0 } else { !italic });+ let (want_bold, want_italic) = if bold { (Some(on), None) } else { (None, Some(on)) };+ let targets = format_targets(s);+ // A caret: the linked style of the format there, for the next typing.+ if let [t] = targets.as_slice()+ && t.range.is_empty()+ {+ let linked = db.linked_style(&family, &style, want_bold, want_italic).ok_or_else(|| bad(id, format!("{family} has no style for that")))?;+ format_chars(s, &json!({"fontStyle": linked}))?;+ return Ok(json!({"on": on, "fontStyle": linked}));+ }+ let mut changed = 0;+ let r = s.edit(|d, _| {+ let styles = d.styles.clone();+ for t in &targets {+ let Some(st) = d.text_story_mut(t.story, t.cell) else { continue };+ for (pi, pr) in st.para_ranges().into_iter().enumerate() {+ let (a, b) = (pr.start.max(t.range.start), pr.end.min(t.range.end));+ if a >= b {+ continue;+ }+ let Some(pf) = st.paras.get(pi) else { continue };+ let (_, pc) = styles.resolve_para(pf);+ st.format_chars(a..b, |f| {+ let cp = styles.resolve_char(&pc, f);+ if let Some(linked) = db.linked_style(&cp.font_family, &cp.font_style, want_bold, want_italic)+ && linked != cp.font_style+ {+ f.over.font_style = Some(linked);+ changed += 1;+ }+ });+ }+ }+ ok()+ });+ r?;+ Ok(json!({"on": on, "changed": changed}))+}+/// Our own filler text (not Adobe's).pub const PLACEHOLDER: &str = "Ovid ellum quisque arcet velut tempora sint, ne veriora pareant laudemque fieri. Lorem novum strata ponet amicos, \et tamen uti ferrum caelo tempus mollit. Quisque sinat oppida retro, nec tenuere longas animi semper vias. \diff --cc crates/ui-egui/src/dialogs.rsindex 923ffc64f,4d2933de9..d15f6fdbf--- a/crates/ui-egui/src/dialogs.rs+++ b/crates/ui-egui/src/dialogs.rs@@@ -1397,25 -1125,14 +1397,26 @@@ pub fn show(app: &mut DesignApp, ctx: &"frameSize" => crate::i18n::tr(&app.ui.language, "Rectangle"),"goToPage" => crate::i18n::tr(&app.ui.language, "Go to Page"),"insertTable" => crate::i18n::tr(&app.ui.language, "Create Table"),+ "cellOptions" => crate::i18n::tr(&app.ui.language, "Cell Options"),"textFrameOptions" => crate::i18n::tr(&app.ui.language, "Text Frame Options"),"documentSetup" => crate::i18n::tr(&app.ui.language, "Document Setup"),+ "numberingSection" => crate::i18n::tr(&app.ui.language, "Numbering & Section Options…").trim_end_matches('…'),"findChange" => crate::i18n::tr(&app.ui.language, "Find/Change"),"paragraphStyleOptions" => crate::i18n::tr(&app.ui.language, "Paragraph Style Options"),+ "deleteParagraphStyle" => crate::i18n::tr(&app.ui.language, "Delete Paragraph Style"),"characterStyleOptions" => crate::i18n::tr(&app.ui.language, "Character Style Options"),+ "deleteCharacterStyle" => crate::i18n::tr(&app.ui.language, "Delete Character Style"),"footnoteOptions" => crate::i18n::tr(&app.ui.language, "Footnote Options"),"paragraphRules" => crate::i18n::tr(&app.ui.language, "Paragraph Rules"),+ "paragraphLocal" => crate::i18n::tr(+ &app.ui.language,+ match d.s("section").as_str() {+ "span" => "Span Columns",+ "bullets" => "Bullets and Numbering",+ _ => "Paragraph Borders and Shading",+ },+ ),+ "justification" => crate::i18n::tr(&app.ui.language, "Justification"),"insertXref" => crate::i18n::tr(&app.ui.language, "New Cross-Reference"),"findFont" => crate::i18n::tr(&app.ui.language, "Find/Replace Font"),"polygonSettings" => crate::i18n::tr(&app.ui.language, "Polygon Settings"),@@@ -1643,7 -1394,10 +1644,11 @@@let current = d.fields.get("current").cloned().unwrap_or_default();paragraph_rules(app, ui, &mut d, "", ¤t);}+ "paragraphLocal" => paragraph_local(app, ui, &mut d),+ "justification" => {+ let current = d.fields.get("current").cloned().unwrap_or_default();+ justification(&app.ui.language, ui, &mut d, "", ¤t);+ }"insertXref" => insert_xref(app, ui, &mut d),"findFont" => find_font(app, ui, &mut d),"colorPicker" => color_picker(ui, &mut d),@@@ -2210,42 -1804,89 +2215,58 @@@ pub fn confirm(app: &mut DesignApp) ->r}"documentSetup" => {- let edges = |k: &str| json!(["Top", "Bottom", "Inside", "Outside"].map(|e| d.m(&format!("{k}{e}")).unwrap_or(0.0)));- app.run(- "layout.documentSetup",- json!({"intent": d.s("intent"), "pages": d.n("pages").unwrap_or(1.0).max(1.0) as u64, "startPage": d.n("startPage").unwrap_or(1.0).max(1.0) as u64,- "facingPages": d.b("facingPages"), "binding": d.s("binding"), "width": d.m("width"), "height": d.m("height"), "bleed": edges("bleed"), "slug": edges("slug"), "adjustLayout": d.b("adjustLayout")}),- )- }- "paragraphStyleOptions" => {- let name = d.s("name");- // What the Justification section showed: the style's own values, or a new style's Based On.- let shown = if d.b("new") { d.s("basedOn") } else { name.clone() };- let base = app.session.active().map(|st| serde_json::to_value(st.doc.styles.resolve_para_style(&shown).0).unwrap_or_default()).unwrap_or_default();- if let Err(e) = check_justification(&d, "p.", &base) {+ // On an error the dialog stays open to be corrected.+ let r = confirm_document_setup(app, &d);+ if let Err(e) = &r {app.status(e.clone());- let mut d = d;- d.fields.insert("justifyError".into(), json!(e));- d.fields.insert("section".into(), json!("justify"));app.ui.dialog = Some(d);- return Err(e);}- let mut para = serde_json::Map::new();- let mut chars = serde_json::Map::new();- for (k, v) in &d.fields {- if let Some(a) = k.strip_prefix("p.") {- // `p.ruleAbove.weight`: one field of a rule (the command keeps the others).- match a.split_once('.') {- Some((attr, field)) => {- if let Value::Object(m) = para.entry(attr).or_insert_with(|| json!({})) {- m.insert(field.into(), v.clone());- }- }- None => {- para.insert(a.into(), v.clone());- }- }- } else if let Some(a) = k.strip_prefix("c.") {- chars.insert(a.into(), v.clone());+ r+ }+ "paragraphStyleOptions" => {+ let mut d = d;+ let r = confirm_paragraph_style_options(app, &mut d);+ if let Err(e) = &r {+ // Keep the dialog open with the reason, on the section it concerns.+ if e.contains("bad GREP") {+ d.fields.insert("section".into(), json!("grep"));}+ d.fields.insert("status".into(), json!(e));+ app.ui.dialog = Some(d);}- let based = d.s("basedOn");- let rename = d.s("rename");- let (r, style) = if d.b("new") {- let mut params = json!({"name": if rename.trim().is_empty() { "Paragraph Style 1" } else { rename.trim() }, "para": para, "chars": chars});- if !based.is_empty() && based != designcraft_doc::NO_PARA_STYLE {- params["basedOn"] = json!(based);- }- let r = app.run("style.paragraph.create", params)?;- let style = r["name"].as_str().unwrap_or_default().to_string();- (r, style)- } else {- let mut params = json!({"name": name, "para": para, "chars": chars});- if !based.is_empty() {- params["basedOn"] = if based == designcraft_doc::NO_PARA_STYLE { Value::Null } else { json!(based) };- }- if !rename.is_empty() && rename != name {- params["rename"] = json!(rename);- }- let style = if !rename.is_empty() && rename != name { rename } else { name };- (app.run("style.paragraph.edit", params)?, style)- };- if d.fields.contains_key("x.tag") {- let tag = d.s("x.tag");- let tag = if tag == "[Automatic]" { String::new() } else { tag };- app.run("style.exportTag", json!({"style": style, "tag": tag, "class": d.s("x.class")}))?;+ r+ }+ "deleteParagraphStyle" => {+ let name = d.s("name");+ let replace = d.s("replaceWith");+ app.run(+ "style.paragraph.delete",+ json!({"name": name, "replaceWith": if replace.is_empty() { json!(designcraft_doc::BASIC_PARAGRAPH) } else { json!(replace) }}),+ )+ }+ "paragraphLocal" => {+ let attrs: Map<String, Value> = d.fields.iter().filter_map(|(k, v)| k.strip_prefix("p.").map(|a| (a.to_string(), v.clone()))).collect();+ if attrs.is_empty() {+ return Ok(Value::Null);}- Ok(r)+ app.run("type.para", json!({"attrs": attrs}))}+ "justification" => {+ let current = d.fields.get("current").cloned().unwrap_or_default();+ if let Err(e) = check_justification(&d, "", ¤t) {+ // The dialog stays open to be corrected.+ app.status(e.clone());+ let mut d = d;+ d.fields.insert("justifyError".into(), json!(e));+ app.ui.dialog = Some(d);+ return Err(e);+ }+ let attrs: Map<String, Value> = JUSTIFY_ATTRS.iter().filter_map(|k| d.fields.get(*k).map(|v| (k.to_string(), v.clone()))).collect();+ if attrs.is_empty() {+ return Ok(Value::Null);+ }+ app.run("type.para", json!({"attrs": attrs}))+ }"paragraphRules" => {let attrs = rule_edits(&d, "");if attrs.is_empty() {@@@ -2623,71 -2229,16 +2644,79 @@@}}-/// Paragraph Style Options: sections in a left list (like InDesign), fields on the right.-/// Edited values are stored as `p.<attr>` / `c.<attr>` fields and applied on OK.-/// Is `p` a pattern the GREP styles can use? (Checked as the user types.)-fn regex_ok(p: &str) -> Result<(), ()> {+/// Why `p` is not a pattern the GREP styles can use, if it isn't. (Checked as the user types.)+fn grep_error(p: &str) -> Option<String> {if p.is_empty() {- return Ok(());+ return None;+ }+ designcraft_compose::grep::Grep::new(p, Default::default()).err().map(|e| e.to_string())+}++fn confirm_paragraph_style_options(app: &mut DesignApp, d: &mut Dialog) -> Result<Value, String> {+ let name = d.s("name");++ // What the Justification section showed: the style's own values, or a new style's Based On.++ let shown = if d.b("new") { d.s("basedOn") } else { name.clone() };++ let base = app.session.active().map(|st| serde_json::to_value(st.doc.styles.resolve_para_style(&shown).0).unwrap_or_default()).unwrap_or_default();++ if let Err(e) = check_justification(d, "p.", &base) {++ // The caller shows the reason in the dialog's status line.++ d.fields.insert("section".into(), json!("justify"));++ return Err(e);++ }+ let mut para = serde_json::Map::new();+ let mut chars = serde_json::Map::new();+ for (k, v) in &d.fields {+ if let Some(a) = k.strip_prefix("p.") {+ // `p.ruleAbove.weight`: one field of a rule (the command keeps the others).+ match a.split_once('.') {+ Some((attr, field)) => {+ if let Value::Object(m) = para.entry(attr).or_insert_with(|| json!({})) {+ m.insert(field.into(), v.clone());+ }+ }+ None => {+ para.insert(a.into(), v.clone());+ }+ }+ } else if let Some(a) = k.strip_prefix("c.") {+ chars.insert(a.into(), v.clone());+ }+ }+ let based = d.s("basedOn");+ let rename = d.s("rename");+ let (r, style) = if d.b("new") {+ let mut params = json!({"name": if rename.trim().is_empty() { "Paragraph Style 1" } else { rename.trim() }, "para": para, "chars": chars});+ if !based.is_empty() && based != designcraft_doc::NO_PARA_STYLE {+ params["basedOn"] = json!(based);+ }+ let r = app.run("style.paragraph.create", params)?;+ let style = r["name"].as_str().unwrap_or_default().to_string();+ (r, style)+ } else {+ let mut params = json!({"name": name, "para": para, "chars": chars});+ if !based.is_empty() {+ params["basedOn"] = if based == designcraft_doc::NO_PARA_STYLE { Value::Null } else { json!(based) };+ }+ if !rename.is_empty() && rename != name {+ params["rename"] = json!(rename);+ }+ let style = if !rename.is_empty() && rename != name { rename } else { name };+ (app.run("style.paragraph.edit", params)?, style)+ };+ // The style now exists under `style`: if a later step fails, the dialog stays open on it and+ // a second OK edits it rather than creating another one.+ d.fields.insert("new".into(), json!(false));+ d.fields.insert("name".into(), json!(&style));+ d.fields.insert("rename".into(), json!(&style));+ if d.fields.contains_key("x.tag") {+ let tag = d.s("x.tag");+ let tag = if tag == "[Automatic]" { String::new() } else { tag };+ app.run("style.exportTag", json!({"style": style, "tag": tag, "class": d.s("x.class")}))?;}- regex::Regex::new(p).map(|_| ()).map_err(|_| ())+ Ok(r)}+/// Paragraph Style Options: sections in a left list (like InDesign), fields on the right.+/// Edited values are stored as `p.<attr>` / `c.<attr>` fields and applied on OK.fn paragraph_style_options(app: &mut DesignApp, ui: &mut egui::Ui, d: &mut Dialog) {let name = d.s("name");let new = d.b("new");@@@ -3098,67 -2589,8 +3127,23 @@@}});}- "justify" => {- egui::Grid::new("psj").num_columns(4).spacing([8.0, 6.0]).show(ui, |ui| {- ui.label("");- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Minimum"));- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Desired"));- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Maximum"));- ui.end_row();- for (label, base) in [("Word Spacing:", "wordSpace"), ("Letter Spacing:", "letterSpace"), ("Glyph Scaling:", "glyphScale")] {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, label));- for suffix in ["Min", "Desired", "Max"] {- let key = format!("{base}{suffix}");- let v = cur(d, &format!("p.{key}"), &pv[key.as_str()]).as_f64().map(|x| x * 100.0);- if let Some(n) = ui.scope(|ui| crate::widgets::number(ui, &format!("ps{key}"), v, "%", 60.0, 0)).inner {- d.fields.insert(format!("p.{key}"), json!(n / 100.0));- }- }- ui.end_row();- }- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Composer:"));- let (single, [paragraph, single_line]) =- crate::panels::properties::composer_choice(cur(d, "p.composer", &pv["composer"]).as_str());- if ui.selectable_label(!single, crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "Paragraph Composer"))).clicked() {- d.fields.insert("p.composer".into(), json!(paragraph));- }- if ui.selectable_label(single, crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "Single-line Composer"))).clicked() {- d.fields.insert("p.composer".into(), json!(single_line));- }- ui.end_row();- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Insert Kashidas:"));- let mut k = cur(d, "p.kashidas", &pv["kashidas"]).as_bool().unwrap_or(true);- if ui.checkbox(&mut k, crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "In justified Arabic text"))).changed() {- d.fields.insert("p.kashidas".into(), json!(k));- }- ui.end_row();- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Korean Line Breaks:"));- let mut kb = cur(d, "p.koreanCharBreaks", &pv["koreanCharBreaks"]).as_bool().unwrap_or(false);- if ui- .checkbox(&mut kb, crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "Between syllables (not only at spaces)")))- .changed()- {- d.fields.insert("p.koreanCharBreaks".into(), json!(kb));- }- ui.end_row();- });- }+ "justify" => justification(&app.ui.language, ui, d, "p.", &pv),"color" => character_color(&app.ui.language, ui, d, &CharFields { base: &cv, sparse: false }, &doc),+ "advanced" => advanced_character_formats(&app.ui.language, ui, d, &CharFields { base: &cv, sparse: false }),+ "openType" => open_type_features(&app.ui.language, ui, d, &CharFields { base: &cv, sparse: false }),+ "underline" => line_options(&app.ui.language, ui, d, &CharFields { base: &cv, sparse: false }, &doc, "underline"),+ "strikethrough" => line_options(&app.ui.language, ui, d, &CharFields { base: &cv, sparse: false }, &doc, "strikethrough"),+ "border" => border_shading(&app.ui.language, ui, d, &pv, &doc, true),+ "shading" => border_shading(&app.ui.language, ui, d, &pv, &doc, false),+ "keep" => keep_options(&app.ui.language, ui, d, &pv),+ "span" => span_columns(&app.ui.language, ui, d, &pv, &doc),+ "bullets" => {+ let (char_styles, families, fonts, scope) = ListUi::new_parts(app);+ let lu =+ ListUi { char_styles: &char_styles, families: &families, fonts: &fonts, scope, family: &cp.font_family, style: &cp.font_style };+ bullets_and_numbering(&app.ui.language, ui, d, &pv, &doc, &lu);+ }+ s if style_cjk::is_section(s) => style_cjk::section_ui(app, ui, d, s, &CharFields { base: &cv, sparse: false }, Some(&pv), &doc),_ => {egui::Grid::new("psg").num_columns(2).spacing([8.0, 6.0]).show(ui, |ui| {crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Style Name:"));@@@ -4617,6 -3178,114 +4602,113 @@@ fn shown_rule(d: &Dialog, prefix: &strValue::Object(r)}+ /// The paragraph attributes of the Justification controls.+ pub const JUSTIFY_ATTRS: [&str; 12] = [+ "wordSpaceMin",+ "wordSpaceDesired",+ "wordSpaceMax",+ "letterSpaceMin",+ "letterSpaceDesired",+ "letterSpaceMax",+ "glyphScaleMin",+ "glyphScaleDesired",+ "glyphScaleMax",+ "composer",+ "kashidas",+ "koreanCharBreaks",+ ];++ /// The spacing rows of the Justification controls: (label, attribute stem, allowed percent range).+ const JUSTIFY_ROWS: [(&str, &str, (f64, f64)); 3] = [+ ("Word Spacing", "wordSpace", (0.0, 1000.0)),+ ("Letter Spacing", "letterSpace", (-100.0, 500.0)),+ ("Glyph Scaling", "glyphScale", (50.0, 200.0)),+ ];++ /// Checks the edited spacing values: each within its range, and minimum ≤ desired ≤ maximum+ /// (values left mixed are not compared).+ fn check_justification(d: &Dialog, prefix: &str, current: &Value) -> Result<(), String> {+ for (label, stem, (lo, hi)) in JUSTIFY_ROWS {+ let mut edited = false;+ let mut known = Vec::new();+ for suffix in ["Min", "Desired", "Max"] {+ let key = format!("{stem}{suffix}");+ let v = match d.fields.get(&format!("{prefix}{key}")) {+ Some(v) => {+ edited = true;+ let pct =+ v.as_f64().map(|x| x * 100.0).filter(|x| x.is_finite()).ok_or_else(|| format!("Justification: {label} is not a number"))?;+ // The fields show whole percents; compare what was shown.+ if pct.round() < lo || pct.round() > hi {+ return Err(format!("Justification: {label} must be between {lo}% and {hi}%"));+ }+ Some(pct)+ }+ None => current[key.as_str()].as_f64().map(|x| x * 100.0),+ };+ known.extend(v);+ }+ if edited && known.windows(2).any(|w| w[0] > w[1] + 1e-9) {+ return Err(format!("Justification: {label} needs Minimum ≤ Desired ≤ Maximum"));+ }+ }+ Ok(())+ }++ /// The Justification controls (the Justification dialog, and the Paragraph Style Options section).+ /// `current` holds the resolved paragraph attributes, `null` where the selected paragraphs differ+ /// (the field shows empty); each edit is stored as `{prefix}{attr}`, so OK changes only the fields+ /// edited.+ fn justification(lang: &str, ui: &mut egui::Ui, d: &mut Dialog, prefix: &str, current: &Value) {+ let cur = |d: &Dialog, k: &str| d.fields.get(&format!("{prefix}{k}")).cloned().unwrap_or_else(|| current[k].clone());+ egui::Grid::new("psj").num_columns(4).spacing([8.0, 6.0]).show(ui, |ui| {+ ui.label("");+ crate::rtl::label(ui, crate::i18n::tr(lang, "Minimum"));+ crate::rtl::label(ui, crate::i18n::tr(lang, "Desired"));+ crate::rtl::label(ui, crate::i18n::tr(lang, "Maximum"));+ ui.end_row();+ for (label, base, _) in JUSTIFY_ROWS {+ crate::rtl::label(ui, crate::i18n::tr(lang, &format!("{label}:")));+ for suffix in ["Min", "Desired", "Max"] {+ let key = format!("{base}{suffix}");+ let v = cur(d, &key).as_f64().map(|x| x * 100.0);+ if let Some(n) = ui.scope(|ui| crate::widgets::number(ui, &format!("ps{key}"), v, "%", 60.0, 0)).inner {+ d.fields.insert(format!("{prefix}{key}"), json!(n / 100.0));+ }+ }+ ui.end_row();+ }+ crate::rtl::label(ui, crate::i18n::tr(lang, "Composer:"));+ let composer = cur(d, "composer");- if ui.selectable_label(composer.as_str() == Some("paragraph"), crate::rtl::widget(ui, crate::i18n::tr(lang, "Paragraph Composer"))).clicked()- {- d.fields.insert(format!("{prefix}composer"), json!("paragraph"));++ // Mixed (null) selects neither; a Japanese composer keeps its kind.++ let (single, [paragraph, single_line]) = crate::panels::properties::composer_choice(composer.as_str());++ let known = !composer.is_null();++ if ui.selectable_label(known && !single, crate::rtl::widget(ui, crate::i18n::tr(lang, "Paragraph Composer"))).clicked() {++ d.fields.insert(format!("{prefix}composer"), json!(paragraph));+ }- if ui- .selectable_label(composer.as_str() == Some("singleLine"), crate::rtl::widget(ui, crate::i18n::tr(lang, "Single-line Composer")))- .clicked()- {- d.fields.insert(format!("{prefix}composer"), json!("singleLine"));++ if ui.selectable_label(known && single, crate::rtl::widget(ui, crate::i18n::tr(lang, "Single-line Composer"))).clicked() {++ d.fields.insert(format!("{prefix}composer"), json!(single_line));+ }+ ui.end_row();+ for (label, key, text, default) in [+ ("Insert Kashidas:", "kashidas", "In justified Arabic text", true),+ ("Korean Line Breaks:", "koreanCharBreaks", "Between syllables (not only at spaces)", false),+ ] {+ crate::rtl::label(ui, crate::i18n::tr(lang, label));+ let v = cur(d, key);+ let mut on = v.as_bool().unwrap_or(default);+ if ui.add(egui::Checkbox::new(&mut on, crate::rtl::widget(ui, crate::i18n::tr(lang, text))).indeterminate(v.is_null())).changed() {+ d.fields.insert(format!("{prefix}{key}"), json!(on));+ }+ ui.end_row();+ }+ });+ if let Some(e) = d.fields.get("justifyError").and_then(Value::as_str) {+ ui.add_space(6.0);+ crate::rtl::label(ui, egui::RichText::new(e).color(ui.visuals().error_fg_color));+ }+ }+/// The rule fields edited in the dialog, as `type.para` attrs: `{ruleAbove?: {…}, ruleBelow?: {…}}`.fn rule_edits(d: &Dialog, prefix: &str) -> Map<String, Value> {let mut out = Map::new();@@@ -5470,381 -4167,108 +5562,479 @@@ mod testsassert_eq!(resolved(&app)["ruleBelow"], rule);}+ /// Opens Paragraph Style Options on "Ruled Child" at each of `sections`, sets `fields` and+ /// clicks OK; returns the resolved attributes of the paragraph styled with it.+ fn style_section_edit(sections: &[&str], fields: Value) -> Value {+ let (mut app, _) = ruled_paragraph();+ let ctx = egui::Context::default();+ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": "Ruled Child"})));+ for section in sections {+ app.ui.dialog.as_mut().unwrap().fields.insert("section".into(), json!(section));+ draw(&mut app, &ctx);+ }+ for (k, v) in fields.as_object().unwrap() {+ app.ui.dialog.as_mut().unwrap().fields.insert(k.clone(), v.clone());+ }+ draw(&mut app, &ctx);+ let before = undo_steps(&app);+ confirm(&mut app).unwrap();+ assert_eq!(undo_steps(&app), before + 1, "one undo step");+ let style = app.session.doc().unwrap().doc.styles.para("Ruled Child").cloned().unwrap();+ let own = serde_json::to_value(&style.para).unwrap();+ for (k, v) in fields.as_object().unwrap() {+ assert_eq!(own[k.trim_start_matches("p.")], *v, "the style sets {k}");+ }+ app.run("type.selectionAttrs", json!({})).unwrap()["para"].clone()+ }++ #[test]+ fn paragraph_style_options_keep_and_border_sections_reach_the_styled_paragraph() {+ let para = style_section_edit(+ &["keep", "border"],+ json!({"p.keepWithNext": 2, "p.keepLinesTogether": true, "p.keepAllLines": false, "p.keepFirst": 3,+ "p.startParagraph": "nextPage", "p.borderOn": true, "p.borderWeights": [2.0, 0.0, 2.0, 0.0]}),+ );+ assert_eq!(para["keepWithNext"], 2);+ assert_eq!(para["keepLinesTogether"], true);+ assert_eq!(para["keepAllLines"], false);+ assert_eq!(para["keepFirst"], 3);+ assert_eq!(para["startParagraph"], "nextPage");+ assert_eq!(para["borderOn"], true);+ assert_eq!(para["borderWeights"], json!([2.0, 0.0, 2.0, 0.0]));+ // Fields not edited keep the resolved value.+ assert_eq!(para["keepLast"], 2);+ assert_eq!(para["ruleBelow"]["weight"], 3.0);+ }++ #[test]+ fn paragraph_style_options_bullets_and_span_sections_reach_the_styled_paragraph() {+ let para = style_section_edit(+ &["bullets", "span"],+ json!({"p.listType": "numbers", "p.numberStyle": "upperRoman", "p.numberExpression": "^#)^t", "p.startAt": 3,+ "p.spanColumns": {"kind": "split", "columns": 3}}),+ );+ assert_eq!(para["listType"], "numbers");+ assert_eq!(para["numberStyle"], "upperRoman");+ assert_eq!(para["numberExpression"], "^#)^t");+ assert_eq!(para["startAt"], 3);+ assert_eq!(para["spanColumns"], json!({"kind": "split", "columns": 3}));+ let props: designcraft_doc::ParaProps = serde_json::from_value(para).unwrap();+ assert_eq!(props.number_label(3), "III)\t");+ }++ #[test]+ fn paragraph_style_options_keep_a_bad_grep_pattern_open_with_the_error() {+ let (mut app, _) = ruled_paragraph();+ let ctx = egui::Context::default();+ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": "Ruled", "section": "general"})));+ draw(&mut app, &ctx);+ app.ui.dialog.as_mut().unwrap().fields.insert("p.grepStyles".into(), json!([{"style": "[None]", "pattern": "(?<=x"}]));+ let e = confirm(&mut app).unwrap_err();+ assert!(e.contains("bad GREP"), "{e}");+ let d = app.ui.dialog.clone().expect("the dialog stays open");+ assert_eq!((d.s("section").as_str(), d.s("status").contains("bad GREP")), ("grep", true));+ assert!(app.session.doc().unwrap().doc.styles.para("Ruled").unwrap().para.grep_styles.is_none(), "nothing saved");+ draw(&mut app, &ctx);+ }++ /// A frame with two paragraphs of [Basic Paragraph]; the first has a local Word Spacing minimum.+ fn two_paragraphs() -> (DesignApp, Value) {+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());+ app.run("file.new", json!({})).unwrap();+ let r = app.run("frame.create", json!({"rect": [72, 72, 300, 400], "content": "text", "text": "One\nTwo"})).unwrap();+ app.run("text.select", json!({"story": r["story"], "anchor": 0, "focus": 0})).unwrap();+ app.run("type.para", json!({"attrs": {"wordSpaceMin": 0.7}})).unwrap();+ (app, r["story"].clone())+ }++ /// The resolved paragraph attribute `key` of the paragraph at byte `at`.+ fn para_attr(app: &mut DesignApp, story: &Value, at: usize, key: &str) -> Value {+ app.run("text.select", json!({"story": story, "anchor": at, "focus": at})).unwrap();+ app.run("type.selectionAttrs", json!({})).unwrap()["para"][key].clone()+ }++ #[test]+ fn justification_dialog_applies_to_a_local_paragraph_and_cancel_changes_nothing() {+ let (mut app, story) = two_paragraphs();+ let ctx = egui::Context::default();+ assert!(crate::menus::menu_enabled(&app, "app.justificationDialog"));+ app.run("app.justificationDialog", json!({})).unwrap();+ draw(&mut app, &ctx);+ let d = app.ui.dialog.clone().unwrap();+ assert_eq!(d.id, "justification");+ assert_eq!(d.fields["current"]["wordSpaceMin"], 0.7);+ assert_eq!(d.fields["current"]["wordSpaceDesired"], 1.0);+ app.ui.dialog.as_mut().unwrap().fields.insert("wordSpaceDesired".into(), json!(1.1));+ draw(&mut app, &ctx);+ let before = undo_steps(&app);+ confirm(&mut app).unwrap();+ assert_eq!(undo_steps(&app), before + 1, "one undo step");+ assert_eq!(para_attr(&mut app, &story, 0, "wordSpaceDesired"), 1.1);+ assert_eq!(para_attr(&mut app, &story, 0, "wordSpaceMin"), 0.7, "unedited fields stay");+ assert_eq!(para_attr(&mut app, &story, 4, "wordSpaceDesired"), 1.0, "only the selected paragraph");+ let style = app.session.doc().unwrap().doc.styles.resolve_para_style(designcraft_doc::story::BASIC_PARAGRAPH).0.word_space_desired;+ assert_eq!(style, 1.0, "the paragraph style keeps its value");++ // Cancel (Escape) leaves the paragraph alone.+ app.run("text.select", json!({"story": story, "anchor": 0, "focus": 0})).unwrap();+ app.run("app.justificationDialog", json!({})).unwrap();+ app.ui.dialog.as_mut().unwrap().fields.insert("wordSpaceDesired".into(), json!(1.2));+ let before = undo_steps(&app);+ let escape = egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() };+ let input = egui::RawInput {+ screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1400.0, 900.0))),+ events: vec![escape],+ ..Default::default()+ };+ let mut out = ctx.run_ui(input, |ui| {+ app.logic(&ui.ctx().clone());+ app.ui(ui);+ });+ out.textures_delta.clear();+ assert!(app.ui.dialog.is_none(), "cancelled");+ assert_eq!(undo_steps(&app), before);+ assert_eq!(para_attr(&mut app, &story, 0, "wordSpaceDesired"), 1.1);++ app.run("edit.deselectAll", json!({})).unwrap();+ assert!(!crate::menus::menu_enabled(&app, "app.justificationDialog"), "nothing to justify");+ assert!(app.run("app.justificationDialog", json!({})).is_err());+ }++ #[test]+ fn justification_dialog_leaves_mixed_fields_alone_and_refuses_bad_values() {+ let (mut app, story) = two_paragraphs();+ let ctx = egui::Context::default();+ app.run("text.select", json!({"story": story, "anchor": 0, "focus": 7})).unwrap();+ app.run("app.justificationDialog", json!({})).unwrap();+ draw(&mut app, &ctx);+ let d = app.ui.dialog.clone().unwrap();+ assert_eq!(d.fields["current"]["wordSpaceMin"], Value::Null, "mixed shows empty");+ assert_eq!(d.fields["current"]["wordSpaceMax"], 1.33);++ // Out of range, and minimum above desired: an error, the dialog stays open, nothing changes.+ let before = undo_steps(&app);+ for (key, v) in [("wordSpaceMax", 20.0), ("glyphScaleMin", 0.2), ("letterSpaceDesired", f64::NAN)] {+ app.ui.dialog = Some(d.clone());+ app.ui.dialog.as_mut().unwrap().fields.insert(key.into(), json!(v));+ assert!(confirm(&mut app).is_err(), "{key} = {v}");+ assert!(app.ui.dialog.as_ref().is_some_and(|d| d.fields.contains_key("justifyError")), "{key}: the dialog shows why");+ }+ app.ui.dialog = Some(d.clone());+ app.ui.dialog.as_mut().unwrap().fields.insert("letterSpaceMin".into(), json!(0.1));+ assert!(confirm(&mut app).is_err(), "letter spacing minimum above desired");+ draw(&mut app, &ctx);+ assert_eq!(undo_steps(&app), before);++ app.ui.dialog = Some(d);+ app.ui.dialog.as_mut().unwrap().fields.insert("wordSpaceMax".into(), json!(1.5));+ confirm(&mut app).unwrap();+ assert_eq!(undo_steps(&app), before + 1);+ for (at, min) in [(0, 0.7), (4, 0.8)] {+ assert_eq!(para_attr(&mut app, &story, at, "wordSpaceMax"), 1.5);+ assert_eq!(para_attr(&mut app, &story, at, "wordSpaceMin"), min, "each paragraph keeps its own minimum");+ }+ }+- fn command_app(id: &str, fields: Value) -> DesignApp {+ fn command_app(id: &str, fields: Value) -> DesignApp {+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());+ app.ui.dialog = Some(Dialog::new(&format!("cmd:{id}"), fields));+ app+ }++ #[test]+ fn generic_new_document_preserves_typed_values_and_text_entry() {+ for pages in [json!(2), json!(" 2 ")] {+ let mut app = command_app(+ "file.new",+ json!({+ "preset": "A4", "pages": pages, "facingPages": false, "gutter": 0,+ "margins": {"top": 10, "bottom": 20, "inside": 30, "outside": 40},+ "title": " ", "status": "internal", "primaryTextFrame": true+ }),+ );+ confirm(&mut app).unwrap();+ let doc = &app.session.active().unwrap().doc;+ assert_eq!(doc.page_count(), 2);+ assert!(!doc.settings.facing_pages);+ assert!(doc.title.starts_with("Untitled-"));+ for page in doc.spreads.iter().flat_map(|s| &s.pages) {+ assert!((page.width - 595.2755905511812).abs() < 0.01);+ assert!((page.height - 841.8897637795277).abs() < 0.01);+ assert_eq!(page.columns.gutter, 0.0);+ assert_eq!(page.margins.top, 10.0);+ assert_eq!(page.margins.outside, 40.0);+ }+ assert!(doc.spreads.iter().all(|s| s.items.is_empty()), "undocumented fields stay excluded");+ assert!(app.ui.dialog.is_none());+ }+ }++ #[test]+ fn numbering_commands_document_their_fields() {+ let names = |id: &str| command_fields(designcraft_engine::find_command(id).unwrap().params).into_iter().map(|f| f.key).collect::<Vec<_>>();+ assert_eq!(names("layout.section"), ["page", "startNumber", "style", "prefix", "includePrefix", "marker", "remove"]);+ assert_eq!(names("layout.chapterNumbering"), ["style", "start", "source"]);+ }++ #[test]+ fn generic_command_preserves_array_geometry() {+ let mut app = command_app("file.new", json!({}));+ confirm(&mut app).unwrap();+ app.ui.dialog = Some(Dialog::new("cmd:frame.create", json!({"rect": [10, 20, 110, 220]})));+ confirm(&mut app).unwrap();+ let doc = &app.session.active().unwrap().doc;+ let item = doc.spreads.iter().flat_map(|s| &s.items).next().unwrap();+ assert_eq!(item.bounds(), designcraft_geom::Rect::new(10.0, 20.0, 110.0, 220.0));+ }++ #[test]+ fn generic_explicit_null_uses_the_commands_existing_semantics() {+ // file.new accepts null width by using the selected preset's width.+ for width in [Value::Null, json!("null")] {+ let mut app = command_app("file.new", json!({"preset": "A4", "width": width, "title": " Sample layout "}));+ confirm(&mut app).unwrap();+ let doc = &app.session.active().unwrap().doc;+ assert_eq!(doc.title, "Sample layout");+ assert!((doc.settings.page_width - 595.2755905511812).abs() < 0.01);+ }+ }++ #[test]+ fn generic_invalid_number_retains_dialog_without_creating_document() {+ let mut app = command_app("file.new", json!({"width": 0}));+ assert!(confirm(&mut app).is_err());+ assert!(app.session.active().is_none());+ let dialog = app.ui.dialog.as_ref().unwrap();+ assert_eq!(dialog.fields["width"], 0);+ assert!(dialog.fields["status"].as_str().unwrap().contains("page size out of range"));+ }++ #[test]+ fn text_frame_options_change_only_what_was_edited() {+ let mut app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());+ app.run("file.new", json!({})).unwrap();+ let r = app.run("frame.create", json!({"rect": [36, 36, 336, 236], "content": "text", "text": "Hello"})).unwrap();+ let id = designcraft_doc::ItemId(r["id"].as_u64().unwrap());+ app.run("object.textFrameOptions", json!({"ids": [id.0], "columns": 2, "inset": [1, 2, 3, 4]})).unwrap();+ let opts = |app: &DesignApp| app.session.doc().unwrap().doc.item(id).unwrap().text_frame().unwrap().options.clone();+ let before = opts(&app);+ let open = |app: &mut DesignApp, fields: &[(&str, Value)]| {+ app.ui.dialog = Some(Dialog::new("textFrameOptions", json!({})));+ let mut d = app.ui.dialog.take().unwrap();+ seed_text_frame_options(app, &mut d);+ for (k, v) in fields {+ d.fields.insert((*k).into(), v.clone());+ }+ app.ui.dialog = Some(d);+ confirm(app)+ };+ // OK without edits changes nothing (no undo step either).+ assert_eq!(open(&mut app, &[]).unwrap(), Value::Null);+ assert_eq!(opts(&app), before);+ // The rule's weight is in points; unequal insets the user didn't touch stay.+ open(&mut app, &[("columnRule", json!(true)), ("columnRuleWeight", json!("6"))]).unwrap();+ let o = opts(&app);+ assert!(o.column_rule && o.column_rule_weight == 6.0, "{o:?}");+ assert_eq!((o.inset, o.columns, o.gutter), (before.inset, before.columns, before.gutter));+ // One of the rule's insets edited: the other rule settings stay.+ open(&mut app, &[("columnRuleBottomInset", json!("0p9")), ("columnRuleTint", json!("40"))]).unwrap();+ let o = opts(&app);+ assert_eq!((o.column_rule_bottom_inset, o.column_rule_top_inset, o.column_rule_offset, o.column_rule_weight), (9.0, 0.0, 0.0, 6.0));+ assert!((o.column_rule_tint - 0.4).abs() < 1e-6 && o.column_rule);+ // One inset side edited: the others keep their values.+ open(&mut app, &[("insetLeft", json!("1p0"))]).unwrap();+ assert_eq!(opts(&app).inset, [1.0, 12.0, 3.0, 4.0]);+ // An unknown swatch is an error and the dialog stays open.+ let e = open(&mut app, &[("columnRuleColor", json!("Mauve"))]).unwrap_err();+ assert!(e.contains("Mauve") && app.ui.dialog.is_some(), "{e}");+ assert_eq!(opts(&app).column_rule_color, designcraft_color::swatch::BLACK);+ // Each OK is one undo step.+ for _ in 0..3 {+ app.run("edit.undo", json!({})).unwrap();+ }+ assert_eq!(opts(&app), before);+ }++ fn dialog_context(language: &str) -> egui::Context {+ let ctx = egui::Context::default();+ crate::theme::install_fonts(&ctx, language);+ crate::theme::apply(&ctx, &crate::theme::Tokens::for_brightness(crate::theme::Brightness::default()));+ ctx+ }++ fn dialog_frame(app: &mut DesignApp, ctx: &egui::Context, screen: egui::Rect, events: Vec<egui::Event>) -> Vec<(String, egui::Rect, egui::Rect)> {+ let time = ctx.input(|i| i.time) + 1.0 / 60.0;+ let mut output = ctx.run_ui(egui::RawInput { screen_rect: Some(screen), time: Some(time), events, ..Default::default() }, |ui| {+ show(app, ui.ctx());+ });+ output.textures_delta.clear();+ fn collect(shape: &egui::Shape, clip: egui::Rect, labels: &mut Vec<(String, egui::Rect, egui::Rect)>) {+ match shape {+ egui::Shape::Text(t) => labels.push((t.galley.job.text.clone(), t.visual_bounding_rect(), clip)),+ egui::Shape::Vec(shapes) => {+ for s in shapes {+ collect(s, clip, labels);+ }+ }+ _ => {}+ }+ }+ let mut labels = Vec::new();+ for shape in output.shapes {+ collect(&shape.shape, shape.clip_rect, &mut labels);+ }+ labels+ }++ fn visible_label(labels: &[(String, egui::Rect, egui::Rect)], screen: egui::Rect, expected: &str) -> egui::Rect {+ let (_, rect, clip) = labels.iter().find(|(text, _, _)| text.trim() == expected).unwrap_or_else(|| panic!("{expected} is painted"));+ assert!(screen.contains_rect(*rect), "{expected} must stay on screen: {rect:?}");+ assert!(clip.contains_rect(*rect), "{expected} must not be clipped: {rect:?}, {clip:?}");+ *rect+ }++ fn click_dialog(app: &mut DesignApp, ctx: &egui::Context, screen: egui::Rect, pos: egui::Pos2) {+ for pressed in [true, false] {+ dialog_frame(+ app,+ ctx,+ screen,+ vec![+ egui::Event::PointerMoved(pos),+ egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE },+ ],+ );+ }+ }++ fn scroll_dialog(app: &mut DesignApp, ctx: &egui::Context, screen: egui::Rect, pos: egui::Pos2, delta: egui::Vec2) {+ dialog_frame(+ app,+ ctx,+ screen,+ vec![+ egui::Event::PointerMoved(pos),+ egui::Event::MouseWheel { unit: egui::MouseWheelUnit::Point, delta, phase: egui::TouchPhase::Move, modifiers: egui::Modifiers::NONE },+ ],+ );+ // Let smooth wheel scrolling and scrollbar visibility settle before clicking.+ for _ in 0..30 {+ dialog_frame(app, ctx, screen, vec![]);+ }+ }++ #[test]+ fn dialog_title_and_actions_fit_scaled_viewports() {+ for language in ["en", "ar"] {+ for size in [egui::vec2(1178.0, 814.0), egui::vec2(589.0, 407.0), egui::vec2(392.0, 271.0), egui::vec2(450.0, 280.0)] {+ for (command, title, ok, cancel) in+ [("app.preferences", "Preferences", "OK", "Cancel"), ("app.newDocumentDialog", "New Document", "Create", "Close")]+ {+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());+ app.ui.language = language.into();+ app.run("file.new", json!({})).unwrap();+ app.run(command, json!({})).unwrap();+ let ctx = dialog_context(language);+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, size);+ for _ in 0..3 {+ dialog_frame(&mut app, &ctx, screen, vec![]);+ }+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ for expected in [title, ok, cancel] {+ visible_label(&labels, screen, crate::i18n::tr(language, expected));+ }+ }+ }+ }+ }++ #[test]+ fn preferences_first_setting_switches_interface_language() {+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());+ app.run("app.preferences", json!({})).unwrap();+ let ctx = dialog_context("");+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1178.0, 814.0));+ for _ in 0..3 {+ dialog_frame(&mut app, &ctx, screen, vec![]);+ }+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ let heading = visible_label(&labels, screen, "Interface Language");+ let combo = visible_label(&labels, screen, "English");+ let scaling = visible_label(&labels, screen, "When Scaling");+ assert!(heading.bottom() <= combo.top() && combo.bottom() <= scaling.top(), "the language comes first: {heading:?} {combo:?} {scaling:?}");+ let pane = labels.iter().filter(|(_, rect, _)| rect.left() >= heading.left() - 1.0 && rect.top() < heading.top());+ assert!(pane.clone().all(|(text, _, _)| text == "Preferences"), "nothing above it: {:?}", pane.collect::<Vec<_>>());++ // Choosing a language applies it at once; the dialog stays open.+ click_dialog(&mut app, &ctx, screen, combo.center());+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ for (_, name) in crate::i18n::LANGUAGES {+ assert!(labels.iter().any(|(text, _, _)| text == name), "{name} is listed by its own name");+ }+ let deutsch = visible_label(&labels, screen, "Deutsch").center();+ click_dialog(&mut app, &ctx, screen, deutsch);+ assert_eq!(app.ui.language, "de");+ assert_eq!(app.ui.dialog.as_ref().map(|d| d.id.as_str()), Some("preferences"));+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ let heading = visible_label(&labels, screen, "Sprache der Oberfläche");+ let combo = visible_label(&labels, screen, "Deutsch");++ // The names stay endonyms in the German interface.+ click_dialog(&mut app, &ctx, screen, combo.center());+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ for name in ["English", "Français", "日本語", "Українська"] {+ assert!(labels.iter().any(|(text, _, _)| text == name), "{name}");+ }+ click_dialog(&mut app, &ctx, screen, heading.center());+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ assert!(!labels.iter().any(|(text, _, _)| text == "Français"), "the list closes");++ // The control channel's command and the combo show the same setting.+ app.run("app.language", json!({"lang": "ja"})).unwrap();+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ assert!(labels.iter().any(|(text, _, _)| text == "日本語"));+ assert!(labels.iter().any(|(text, _, _)| text == crate::i18n::tr("ja", "Interface Language")));++ // Cancel puts back the language the dialog opened with; OK keeps the choice.+ let cancel_button = visible_label(&labels, screen, crate::i18n::tr("ja", "Cancel")).center();+ click_dialog(&mut app, &ctx, screen, cancel_button);+ assert!(app.ui.dialog.is_none());+ assert_eq!(app.ui.language, "");+ app.run("app.preferences", json!({})).unwrap();+ app.run("app.language", json!({"lang": "it"})).unwrap();+ confirm(&mut app).unwrap();+ assert_eq!(app.ui.language, "it");+ app.run("app.preferences", json!({})).unwrap();+ app.run("app.language", json!({"lang": "uk"})).unwrap();+ cancel(&mut app);+ assert_eq!(app.ui.language, "it");+ }++ #[test]+ fn preferences_sidebar_scroll_keeps_selected_options_visible() {let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());- app.ui.dialog = Some(Dialog::new(&format!("cmd:{id}"), fields));- app+ app.run("file.new", json!({})).unwrap();+ app.run("app.preferences", json!({})).unwrap();+ let ctx = dialog_context("en");+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(589.0, 407.0));+ for _ in 0..3 {+ dialog_frame(&mut app, &ctx, screen, vec![]);+ }+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ let sidebar = visible_label(&labels, screen, "General").center();+ assert!(+ !labels.iter().any(|(text, rect, clip)| text == "File Handling" && clip.contains_rect(*rect)),+ "last section starts below the sidebar"+ );+ scroll_dialog(&mut app, &ctx, screen, sidebar, egui::vec2(0.0, -600.0));+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ let files = visible_label(&labels, screen, "File Handling").center();+ click_dialog(&mut app, &ctx, screen, files);+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("section"), "files");+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);+ for expected in ["Document Recovery Data", "Save recovery data every:", "OK", "Cancel"] {+ visible_label(&labels, screen, expected);+ }}#[test]diff --cc crates/ui-egui/src/i18n/ar.rsindex d6c1a4819,dff8a9294..99f67f850--- a/crates/ui-egui/src/i18n/ar.rs+++ b/crates/ui-egui/src/i18n/ar.rs@@@ -1488,130 -1467,7 +1488,131 @@@ pub(super) const TABLE: &[(&str, &str)),("Utilities", "أدوات مساعدة"),("Paragraph Rules…", "خطوط الفقرة…"),+ ("Justification…", "الضبط…"),("Paragraph Rules", "خطوط الفقرة"),("Rule Below", "خط سفلي"),+ ("Left-aligned tab", "علامة جدولة محاذاة لليسار"),+ ("Centered tab", "علامة جدولة توسيط"),+ ("Right-aligned tab", "علامة جدولة محاذاة لليمين"),+ ("Tab aligned on a character", "علامة جدولة محاذاة على حرف"),+ ("X:", "س:"),+ ("Leader:", "الحرف المكرر:"),+ ("Align On:", "المحاذاة على:"),+ ("Position panel above text frame", "وضع اللوحة فوق إطار النص"),+ ("Clear All", "مسح الكل"),+ ("Delete Tab", "حذف علامة الجدولة"),+ ("Repeat Tab", "تكرار علامة الجدولة"),+ ("Reset Indents", "إعادة تعيين المسافات البادئة"),+ ("Paragraph Border", "حد الفقرة"),+ ("Paragraph Shading", "تظليل الفقرة"),+ ("Keep Options", "خيارات الإبقاء"),+ ("Span Columns", "امتداد الأعمدة"),+ ("Top:", "أعلى:"),+ ("Left:", "يسار:"),+ ("Bottom:", "أسفل:"),+ ("Right:", "يمين:"),+ ("Keep with Next:", "الإبقاء مع التالي:"),+ ("Keep Lines Together", "إبقاء الأسطر معًا"),+ ("All Lines in Paragraph", "كل أسطر الفقرة"),+ ("At Start/End of Paragraph", "في بداية الفقرة ونهايتها"),+ ("End:", "النهاية:"),+ ("Start Paragraph:", "بدء الفقرة:"),+ ("Anywhere", "في أي مكان"),+ ("In Next Column", "في العمود التالي"),+ ("In Next Frame", "في الإطار التالي"),+ ("On Next Page", "في الصفحة التالية"),+ ("On Next Odd Page", "في الصفحة الفردية التالية"),+ ("On Next Even Page", "في الصفحة الزوجية التالية"),+ ("Paragraph Layout:", "تخطيط الفقرة:"),+ ("Single Column", "عمود واحد"),+ ("Split Column", "تقسيم العمود"),+ ("Columns:", "الأعمدة:"),+ ("All", "الكل"),+ ("Inside Gutter:", "الفاصل الداخلي:"),+ ("Outside Gutter:", "الفاصل الخارجي:"),+ ("List Type:", "نوع القائمة:"),+ ("Bullets", "نقاط تعداد"),+ ("Numbers", "أرقام"),+ ("Bullet Character:", "حرف التعداد النقطي:"),+ ("Text After:", "النص بعده:"),+ ("Gap Tint:", "تدرج الفجوة:"),+ ("Corner Size and Shape", "حجم الزوايا وشكلها"),+ ("Top Left:", "أعلى اليسار:"),+ ("Top Right:", "أعلى اليمين:"),+ ("Bottom Right:", "أسفل اليمين:"),+ ("Bottom Left:", "أسفل اليسار:"),+ ("Rounded", "مستدير"),+ ("Inverse Rounded", "مستدير معكوس"),+ ("Inset", "داخلي"),+ ("Fancy", "مزخرف"),+ ("Top Edge:", "الحافة العلوية:"),+ ("Bottom Edge:", "الحافة السفلية:"),+ ("Em Box Top", "أعلى مربع em"),+ ("Descent", "الانحدار السفلي"),+ ("Em Box Bottom", "أسفل مربع em"),+ ("Display Border if Paragraph Splits Across Frames/Columns", "إظهار الحد إذا انقسمت الفقرة عبر الإطارات/الأعمدة"),+ ("Merge Consecutive Borders and Shading", "دمج الحدود والتظليل المتتالية"),+ ("Clip to Frame", "قص حسب الإطار"),+ ("Do not Print or Export", "عدم الطباعة أو التصدير"),+ ("Space Before Span:", "المسافة قبل الامتداد:"),+ ("Space After Span:", "المسافة بعد الامتداد:"),+ ("Space Before Split:", "المسافة قبل التقسيم:"),+ ("Space After Split:", "المسافة بعد التقسيم:"),+ ("Level:", "المستوى:"),+ ("Glyphs…", "الحروف الرسومية…"),+ ("(Paragraph Font)", "(خط الفقرة)"),+ ("Restart Numbers at This Level After:", "إعادة الترقيم في هذا المستوى بعد:"),+ ("Any Previous Level", "أي مستوى سابق"),+ ("Tab Position:", "موضع الجدولة:"),+ ("Paragraph Borders and Shading…", "حدود الفقرة وتظليلها…"),+ ("Paragraph Borders and Shading", "حدود الفقرة وتظليلها"),+ ("Span Columns…", "امتداد الأعمدة…"),+ ("Bullets and Numbering…", "التعداد النقطي والرقمي…"),+ ("List:", "القائمة:"),+ ("[Default]", "[افتراضي]"),+ ("Number:", "الرقم:"),+ ("Mode:", "الوضع:"),+ ("Continue from Previous Number", "المتابعة من الرقم السابق"),+ ("Start At", "البدء عند"),+ ("Strokes and Fills…", "الحدود والتعبئة…"),+ ("Cell Stroke", "حد الخلية"),+ ("Cell Fill", "تعبئة الخلية"),+ ("Cell edges", "حواف الخلية"),+ (+ "Click a line to include or exclude it. Double-click selects all outer or all inner lines; triple-click selects or clears all.",+ "انقر على خط لتضمينه أو استبعاده. النقر المزدوج يحدد كل الخطوط الخارجية أو كل الخطوط الداخلية؛ والنقر الثلاثي يحدد الكل أو يلغي تحديده.",+ ),+ ("Swatch Options…", "خيارات حامل اللون…"),+ ("Swatch Options", "خيارات حامل اللون"),+ ("Color Group Options…", "خيارات مجموعة الألوان…"),+ ("Layer Options", "خيارات الطبقة"),+ ("Layer Options for \"{name}\"…", "خيارات الطبقة \"{name}\"…"),+ ("Swatch Name:", "اسم حامل اللون:"),+ ("Name with Color Value", "التسمية بقيمة اللون"),+ ("Color Type:", "نوع اللون:"),+ ("Process", "لون معالجة"),+ ("Spot", "لون خاص"),+ ("Color Mode:", "وضع اللون:"),+ ("Base Color:", "اللون الأساسي:"),+ ("Edit the gradient's stops in the Gradient panel.", "حرّر نقاط التدرج في لوحة التدرج."),+ ("This swatch can't be edited.", "لا يمكن تحرير حامل اللون هذا."),+ ("Light Blue", "أزرق فاتح"),+ ("Red", "أحمر"),+ ("Green", "أخضر"),+ ("Blue", "أزرق"),+ ("Yellow", "أصفر"),+ ("Magenta", "أرجواني"),+ ("Cyan", "سماوي"),+ ("Black", "أسود"),+ ("Orange", "برتقالي"),+ ("Dark Green", "أخضر داكن"),+ ("Teal", "أزرق مخضر"),+ ("Tan", "أسمر"),+ ("Brown", "بني"),+ ("Violet", "بنفسجي"),+ ("Gold", "ذهبي"),+ ("Show Layer", "إظهار الطبقة"),+ ("Lock Layer", "قفل الطبقة"),+ ("Print Layer", "طباعة الطبقة"),+ ("Suppress Text Wrap When Layer is Hidden", "إيقاف التفاف النص عند إخفاء الطبقة"),];diff --cc crates/ui-egui/src/i18n/ja.rsindex b2e903910,b4f6d1e2d..aa59ccd42--- a/crates/ui-egui/src/i18n/ja.rs+++ b/crates/ui-egui/src/i18n/ja.rs@@@ -1803,149 -1670,9 +1803,150 @@@ pub(super) const TABLE: &[(&str, &str)("Vertical:", "垂直方向:"),("Working CMYK", "作業用 CMYK"),("Yellow", "イエロー"),+ ("Recent", "最近使用"),+ ("Saved", "保存済み"),+ ("[Default]", "[初期設定]"),+ ("Your Recent Items", "最近使用した項目"),+ ("Saved Presets", "保存済みプリセット"),+ ("Blank Document Presets", "空のドキュメントプリセット"),+ (+ "No saved presets yet. Set the details, then click Save Document Preset.",+ "保存済みのプリセットはありません。詳細を設定してから「ドキュメントプリセットを保存」をクリックしてください。",+ ),+ ("Delete Preset", "プリセットを削除"),+ ("Preset Details", "プリセットの詳細"),+ ("Document Name", "ドキュメント名"),+ ("Save Document Preset", "ドキュメントプリセットを保存"),+ ("Save Document Preset As:", "ドキュメントプリセットの保存名:"),+ ("Save Preset", "プリセットを保存"),+ ("Start #", "開始ページ番号"),+ ("Column Gutter", "列間隔"),+ ("Start Section", "セクション開始"),+ ("Automatic Page Numbering", "自動ページ番号"),+ ("Start Page Numbering at:", "開始ページ番号:"),+ ("Section Prefix:", "セクションプレフィックス:"),+ ("Section Marker:", "セクションマーカー:"),+ ("Include Prefix when Numbering Pages", "ページ番号にプレフィックスを含める"),+ ("Document Chapter Numbering", "ドキュメントの章番号"),+ ("Automatic Chapter Numbering", "自動章番号"),+ ("Start Chapter Numbering at:", "開始章番号:"),+ ("Same as Previous Document in the Book", "ブック内の前のドキュメントと同じ"),+ ("Book Name:", "ブック名:"),+ ("N/A", "なし"),+ ("Paragraph Border", "段落囲み罫"),+ ("Paragraph Shading", "段落の背景色"),+ ("Keep Options", "段落分離禁止オプション"),+ ("Span Columns", "段抜きと段分割"),+ ("Keep with Next:", "次の段落と分離禁止:"),+ ("Keep Lines Together", "行を分離しない"),+ ("All Lines in Paragraph", "段落のすべての行"),+ ("At Start/End of Paragraph", "段落の始めと終わり"),+ ("End:", "終了位置:"),+ ("Start Paragraph:", "段落の開始位置:"),+ ("Anywhere", "任意の位置"),+ ("In Next Column", "次の段"),+ ("In Next Frame", "次のフレーム"),+ ("On Next Page", "次のページ"),+ ("On Next Odd Page", "次の奇数ページ"),+ ("On Next Even Page", "次の偶数ページ"),+ ("Paragraph Layout:", "段落レイアウト:"),+ ("Single Column", "単一段"),+ ("Split Column", "段分割"),+ ("All", "すべて"),+ ("Inside Gutter:", "内側の間隔:"),+ ("Outside Gutter:", "外側の間隔:"),+ ("List Type:", "リストタイプ:"),+ ("Bullets", "箇条書き記号"),+ ("Numbers", "自動番号"),+ ("Bullet Character:", "箇条書き記号:"),+ ("Text After:", "後続テキスト:"),+ ("Gap Tint:", "すき間の濃淡:"),+ ("Corner Size and Shape", "角のサイズとシェイプ"),+ ("Top Left:", "左上:"),+ ("Top Right:", "右上:"),+ ("Bottom Right:", "右下:"),+ ("Bottom Left:", "左下:"),+ ("Rounded", "角丸"),+ ("Inverse Rounded", "逆角丸"),+ ("Inset", "内側に切り欠き"),+ ("Fancy", "装飾"),+ ("Top Edge:", "上端:"),+ ("Bottom Edge:", "下端:"),+ ("Em Box Top", "仮想ボディの上"),+ ("Descent", "ディセント"),+ ("Em Box Bottom", "仮想ボディの下"),+ ("Display Border if Paragraph Splits Across Frames/Columns", "段落がフレームや段をまたぐときに囲み罫を表示"),+ ("Merge Consecutive Borders and Shading", "連続する囲み罫と背景色を結合"),+ ("Clip to Frame", "フレームでクリップ"),+ ("Do not Print or Export", "印刷・書き出ししない"),+ ("Space Before Span:", "段抜き前のアキ:"),+ ("Space After Span:", "段抜き後のアキ:"),+ ("Space Before Split:", "段分割前のアキ:"),+ ("Space After Split:", "段分割後のアキ:"),+ ("Level:", "レベル:"),+ ("Glyphs…", "字形…"),+ ("(Paragraph Font)", "(段落のフォント)"),+ ("Restart Numbers at This Level After:", "このレベルの番号を振り直すきっかけ:"),+ ("Any Previous Level", "任意の上位レベル"),+ ("Tab Position:", "タブ位置:"),+ ("Paragraph Borders and Shading…", "段落囲み罫と段落背景色…"),+ ("Paragraph Borders and Shading", "段落囲み罫と段落背景色"),+ ("Span Columns…", "段抜きと段分割…"),+ ("Bullets and Numbering…", "箇条書き記号と番号付け…"),+ ("Tint:", "濃淡:"),+ ("List:", "リスト:"),+ ("Number:", "番号:"),+ ("Mode:", "モード:"),+ ("Continue from Previous Number", "前の番号から継続"),+ ("Start At", "開始番号"),+ ("Advanced Character Formats", "詳細文字形式"),+ ("OpenType Features", "OpenType 機能"),+ ("Preset Name", "プリセット名"),+ ("Bounding Box (Visible Layers Only)", "バウンディングボックス(表示レイヤーのみ)"),+ ("Bounding Box (All Layers)", "バウンディングボックス(すべてのレイヤー)"),+ ("Strokes and Fills…", "線と塗り…"),+ ("Cell Stroke", "セルの線"),+ ("Cell Fill", "セルの塗り"),+ ("Cell edges", "セルの境界線"),+ (+ "Click a line to include or exclude it. Double-click selects all outer or all inner lines; triple-click selects or clears all.",+ "線をクリックすると、含めるか除外するかを切り替えます。ダブルクリックで外側または内側の線をすべて選択し、トリプルクリックですべてを選択または解除します。",+ ),+ ("Swatch Options…", "スウォッチオプション…"),+ ("Swatch Options", "スウォッチオプション"),+ ("Color Group Options…", "カラーグループオプション…"),+ ("Layer Options", "レイヤーオプション"),+ ("Layer Options for \"{name}\"…", "「{name}」のレイヤーオプション…"),+ ("Swatch Name:", "スウォッチ名:"),+ ("Name with Color Value", "カラー値を名前にする"),+ ("Color Type:", "カラータイプ:"),+ ("Process", "プロセス"),+ ("Spot", "特色"),+ ("Color Mode:", "カラーモード:"),+ ("Base Color:", "ベースカラー:"),+ ("Edit the gradient's stops in the Gradient panel.", "グラデーションの分岐点はグラデーションパネルで編集します。"),+ ("This swatch can't be edited.", "このスウォッチは編集できません。"),+ ("Light Blue", "ライトブルー"),+ ("Red", "レッド"),+ ("Green", "グリーン"),+ ("Blue", "ブルー"),+ ("Orange", "オレンジ"),+ ("Dark Green", "ダークグリーン"),+ ("Teal", "ティール"),+ ("Tan", "タン"),+ ("Brown", "ブラウン"),+ ("Violet", "バイオレット"),+ ("Gold", "ゴールド"),+ ("Show Layer", "レイヤーを表示"),+ ("Lock Layer", "レイヤーをロック"),+ ("Print Layer", "レイヤーをプリント"),+ ("Suppress Text Wrap When Layer is Hidden", "非表示レイヤーのテキストの回り込みを無視"),+ ("Justification…", "両端揃え…"),];+/// Captions whose Japanese depends on where they appear: (English, context, Japanese).+pub(super) const CONTEXT: &[(&str, &str, &str)] = &[("Span Columns", "paragraphLayout", "段抜き")];+#[cfg(test)]mod tests {use std::collections::HashSet;diff --cc crates/ui-egui/src/i18n/pt_br.rsindex 04ced8e95,6bf8f1575..cd60c449d--- a/crates/ui-egui/src/i18n/pt_br.rs+++ b/crates/ui-egui/src/i18n/pt_br.rs@@@ -1083,554 -1071,7 +1083,555 @@@ pub(super) const TABLE: &[(&str, &str)("Page (1–{count}):", "Página (1–{count}):"),("Fonts in Document: {count} Missing: {missing}", "Fontes no documento: {count} Ausentes: {missing}"),("Paragraph Rules…", "Linhas de parágrafo…"),+ ("Justification…", "Justificação…"),("Paragraph Rules", "Linhas de parágrafo"),("Rule Below", "Linha abaixo"),+ ("Left-aligned tab", "Tabulação alinhada à esquerda"),+ ("Centered tab", "Tabulação centralizada"),+ ("Right-aligned tab", "Tabulação alinhada à direita"),+ ("Tab aligned on a character", "Tabulação alinhada a um caractere"),+ ("X:", "X:"),+ ("Leader:", "Caractere de preenchimento:"),+ ("Align On:", "Alinhar em:"),+ ("Position panel above text frame", "Posicionar o painel acima do quadro de texto"),+ ("Clear All", "Limpar tudo"),+ ("Delete Tab", "Excluir tabulação"),+ ("Repeat Tab", "Repetir tabulação"),+ ("Reset Indents", "Redefinir recuos"),+ ("Tabs", "Tabulações"),+ ("Paragraph Border", "Borda do parágrafo"),+ ("Paragraph Shading", "Sombreamento do parágrafo"),+ ("Keep Options", "Opções de manter"),+ ("Span Columns", "Abranger colunas"),+ ("Top:", "Superior:"),+ ("Left:", "Esquerda:"),+ ("Bottom:", "Inferior:"),+ ("Right:", "Direita:"),+ ("Keep with Next:", "Manter com o próximo:"),+ ("Keep Lines Together", "Manter linhas juntas"),+ ("All Lines in Paragraph", "Todas as linhas do parágrafo"),+ ("At Start/End of Paragraph", "No início/fim do parágrafo"),+ ("End:", "Fim:"),+ ("Start Paragraph:", "Iniciar parágrafo:"),+ ("Anywhere", "Em qualquer lugar"),+ ("In Next Column", "Na próxima coluna"),+ ("In Next Frame", "No próximo quadro"),+ ("On Next Page", "Na próxima página"),+ ("On Next Odd Page", "Na próxima página ímpar"),+ ("On Next Even Page", "Na próxima página par"),+ ("Paragraph Layout:", "Layout do parágrafo:"),+ ("Single Column", "Coluna única"),+ ("Split Column", "Dividir coluna"),+ ("Columns:", "Colunas:"),+ ("All", "Todas"),+ ("Inside Gutter:", "Medianiz interna:"),+ ("Outside Gutter:", "Medianiz externa:"),+ ("List Type:", "Tipo de lista:"),+ ("Bullets", "Marcadores"),+ ("Numbers", "Números"),+ ("Bullet Character:", "Caractere de marcador:"),+ ("Text After:", "Texto após:"),+ ("Gap Tint:", "Tonalidade do espaço:"),+ ("Corner Size and Shape", "Tamanho e forma dos cantos"),+ ("Top Left:", "Superior esquerdo:"),+ ("Top Right:", "Superior direito:"),+ ("Bottom Right:", "Inferior direito:"),+ ("Bottom Left:", "Inferior esquerdo:"),+ ("Rounded", "Arredondado"),+ ("Inverse Rounded", "Arredondado inverso"),+ ("Inset", "Recuado"),+ ("Fancy", "Decorativo"),+ ("Top Edge:", "Borda superior:"),+ ("Bottom Edge:", "Borda inferior:"),+ ("Em Box Top", "Topo do quadratim"),+ ("Descent", "Descendente"),+ ("Em Box Bottom", "Base do quadratim"),+ ("Display Border if Paragraph Splits Across Frames/Columns", "Exibir borda se o parágrafo se dividir entre quadros/colunas"),+ ("Merge Consecutive Borders and Shading", "Mesclar bordas e sombreamentos consecutivos"),+ ("Clip to Frame", "Recortar no quadro"),+ ("Do not Print or Export", "Não imprimir nem exportar"),+ ("Space Before Span:", "Espaço antes da extensão:"),+ ("Space After Span:", "Espaço após a extensão:"),+ ("Space Before Split:", "Espaço antes da divisão:"),+ ("Space After Split:", "Espaço após a divisão:"),+ ("Level:", "Nível:"),+ ("Glyphs…", "Glifos…"),+ ("(Paragraph Font)", "(Fonte do parágrafo)"),+ ("Restart Numbers at This Level After:", "Reiniciar números neste nível após:"),+ ("Any Previous Level", "Qualquer nível anterior"),+ ("Tab Position:", "Posição da tabulação:"),+ ("Paragraph Borders and Shading…", "Bordas e sombreamento do parágrafo…"),+ ("Paragraph Borders and Shading", "Bordas e sombreamento do parágrafo"),+ ("Span Columns…", "Abranger colunas…"),+ ("Bullets and Numbering…", "Marcadores e numeração…"),+ ("List:", "Lista:"),+ ("[Default]", "[Padrão]"),+ ("Number:", "Número:"),+ ("Mode:", "Modo:"),+ ("Continue from Previous Number", "Continuar do número anterior"),+ ("Start At", "Iniciar em"),+ ("Strokes and Fills…", "Traçados e preenchimentos…"),+ ("Cell Stroke", "Traçado da célula"),+ ("Cell Fill", "Preenchimento da célula"),+ ("Cell edges", "Bordas da célula"),+ (+ "Click a line to include or exclude it. Double-click selects all outer or all inner lines; triple-click selects or clears all.",+ "Clique em uma linha para incluí-la ou excluí-la. Clique duas vezes para selecionar todas as linhas externas ou internas; clique três vezes para selecionar ou limpar todas.",+ ),+ ("Swatch Options…", "Opções de amostra…"),+ ("Swatch Options", "Opções de amostra"),+ ("Color Group Options…", "Opções do grupo de cores…"),+ ("Layer Options", "Opções de camada"),+ ("Layer Options for \"{name}\"…", "Opções da camada \"{name}\"…"),+ ("Swatch Name:", "Nome da amostra:"),+ ("Name with Color Value", "Nome com valor da cor"),+ ("Color Type:", "Tipo de cor:"),+ ("Process", "Escala"),+ ("Spot", "Especial"),+ ("Color Mode:", "Modo de cor:"),+ ("Base Color:", "Cor base:"),+ ("Edit the gradient's stops in the Gradient panel.", "Edite as paradas do degradê no painel Degradê."),+ ("This swatch can't be edited.", "Esta amostra não pode ser editada."),+ ("Light Blue", "Azul-claro"),+ ("Red", "Vermelho"),+ ("Green", "Verde"),+ ("Blue", "Azul"),+ ("Yellow", "Amarelo"),+ ("Magenta", "Magenta"),+ ("Cyan", "Ciano"),+ ("Black", "Preto"),+ ("Orange", "Laranja"),+ ("Dark Green", "Verde-escuro"),+ ("Teal", "Azul-petróleo"),+ ("Tan", "Castanho-claro"),+ ("Brown", "Marrom"),+ ("Violet", "Violeta"),+ ("Gold", "Dourado"),+ ("Show Layer", "Mostrar camada"),+ ("Lock Layer", "Bloquear camada"),+ ("Print Layer", "Imprimir camada"),+ ("Suppress Text Wrap When Layer is Hidden", "Suprimir disposição do texto quando a camada estiver oculta"),+ ("Can't Open the File", "Não foi possível abrir o arquivo"),+ ("Can't Place the File", "Não foi possível inserir o arquivo"),+ ("Story Direction", "Direção do texto"),+ ("Tate-Chu-Yoko", "Tate-chu-yoko"),+ ("Ruby…", "Ruby…"),+ ("Kenten", "Kenten"),+ ("Story", "Matéria"),+ ("Create Outlines", "Criar contornos"),+ ("Show Hidden Characters", "Mostrar caracteres ocultos"),+ ("Unmerge Cells", "Desfazer mesclagem de células"),+ ("Snap to Guides", "Alinhar às guias"),+ ("Snap to Document Grid", "Alinhar à grade do documento"),+ ("Align to Object Edges", "Alinhar às bordas dos objetos"),+ ("Align to Object Centers", "Alinhar aos centros dos objetos"),+ ("Smart Dimensions", "Dimensões inteligentes"),+ ("Smart Spacing", "Espaçamento inteligente"),+ ("Snap to Zone", "Alinhar à zona"),+ ("Info", "Informações"),+ ("Index", "Índice remissivo"),+ ("Articles", "Artigos"),+ ("Tags", "Tags"),+ ("Object States", "Estados do objeto"),+ ("Liquid Layout", "Layout líquido"),+ ("Split Window", "Dividir janela"),+ ("New Window", "Nova janela"),+ ("CMYK", "CMYK"),+ ("Lab", "Lab"),+ ("OpenType", "OpenType"),+ ("RGB", "RGB"),+ ("Accept All Changes", "Aceitar todas as alterações"),+ ("Activate Document", "Ativar documento"),+ ("Add Anchor Point", "Adicionar ponto de ancoragem"),+ ("Add Document", "Adicionar documento"),+ ("Add Hyphenation Exception", "Adicionar exceção de hifenização"),+ ("Add Item", "Adicionar item"),+ ("Add Page to Spread", "Adicionar página ao spread"),+ ("Allow Selected Spread to Shuffle", "Permitir que o spread selecionado seja reorganizado"),+ ("Anchored Object Options…", "Opções de objeto ancorado…"),+ ("Anchored Objects", "Objetos ancorados"),+ ("Apply Attributes (Eyedropper)", "Aplicar atributos (conta-gotas)"),+ ("Apply Cell Style", "Aplicar estilo de célula"),+ ("Apply Condition", "Aplicar condição"),+ ("Apply Parent to Pages…", "Aplicar página-mestre às páginas…"),+ ("ArtCraft App Page…", "Página do aplicativo ArtCraft…"),+ ("ArtCraft Website…", "Site do ArtCraft…"),+ ("Attributes", "Atributos"),+ ("Bevel and Emboss", "Chanfro e relevo"),+ ("Buttons", "Botões"),+ ("Cell Style Options…", "Opções de estilo de célula…"),+ ("Change All (Object)", "Alterar tudo (objeto)"),+ ("Changes", "Alterações"),+ ("Character Formatting", "Formatação de caracteres"),+ ("Clear Conveyor", "Limpar transportador"),+ ("Clear Transformations", "Limpar transformações"),+ ("Clipping Path…", "Traçado de recorte…"),+ ("Close Book", "Fechar livro"),+ ("Close Library", "Fechar biblioteca"),+ ("Collect", "Coletar"),+ ("Color Settings…", "Configurações de cor…"),+ ("Community & Project Links", "Links da comunidade e do projeto"),+ ("Container", "Contêiner"),+ ("Content", "Conteúdo"),+ ("Contextual Task Bar", "Barra de tarefas contextual"),+ ("Control", "Controle"),+ ("Convert Cell to Graphic Cell", "Converter célula em célula gráfica"),+ ("Convert Cell to Graphic Cell…", "Converter célula em célula gráfica…"),+ ("Convert Cell to Text Cell", "Converter célula em célula de texto"),+ ("Convert Color", "Converter cor"),+ ("Convert Direction Point", "Converter ponto de direção"),+ ("Convert Note to Text", "Converter nota em texto"),+ ("Convert Table to Text", "Converter tabela em texto"),+ ("Convert Text to Table", "Converter texto em tabela"),+ ("Convert to Button", "Converter em botão"),+ ("Convert to Form Field", "Converter em campo de formulário"),+ ("Copy Link(s) To…", "Copiar link(s) para…"),+ ("Corner Options…", "Opções de canto…"),+ ("Create Alternate Layout…", "Criar layout alternativo…"),+ ("Create Frame", "Criar quadro"),+ ("Create Merged Document…", "Criar documento mesclado…"),+ ("Cross-Reference Formats", "Formatos de referência cruzada"),+ ("Cross-References", "Referências cruzadas"),+ ("Data Merge Fields", "Campos de mesclagem de dados"),+ ("Define Cross-Reference Format…", "Definir formato de referência cruzada…"),+ ("Define Lists…", "Definir listas…"),+ ("Define Text Variable…", "Definir variável de texto…"),+ ("Delete All Guides on Spread", "Excluir todas as guias do spread"),+ ("Delete Anchor Point", "Excluir ponto de ancoragem"),+ ("Delete Item", "Excluir item"),+ ("Delete Text Variable", "Excluir variável de texto"),+ ("Delete Workspace…", "Excluir espaço de trabalho…"),+ ("DesignCraft Website…", "Site do DesignCraft…"),+ ("DesignCraft on GitHub…", "DesignCraft no GitHub…"),+ ("Detach All Objects from Parent", "Desvincular todos os objetos da página-mestre"),+ ("Directional Feather", "Esmaecimento direcional"),+ ("Distribute", "Distribuir"),+ ("Dock Panel", "Encaixar painel"),+ ("Document Endnote Options…", "Opções de notas de fim do documento…"),+ ("Document Preferences", "Preferências do documento"),+ ("Document Presets", "Predefinições de documento"),+ ("Document…", "Documento…"),+ ("Edit Parents", "Editar páginas-mestre"),+ ("Edit Story", "Editar matéria"),+ ("Endnotes", "Notas de fim"),+ ("Entire Pasteboard", "Toda a mesa de trabalho"),+ ("Erase", "Apagar"),+ ("Export Book to PDF…", "Exportar livro para PDF…"),+ ("Export EPUB (Reflowable)…", "Exportar EPUB (reflowable)…"),+ ("Export Selection as Snippet", "Exportar seleção como snippet"),+ ("Extend Text Selection", "Estender seleção de texto"),+ ("Fast Display", "Exibição rápida"),+ ("Find Object", "Localizar objeto"),+ ("Find by Script Label", "Localizar por rótulo de script"),+ ("First Object Above", "Primeiro objeto acima"),+ ("Fit Selection in Window", "Ajustar seleção à janela"),+ ("Flattener Preview", "Visualização do achatamento"),+ ("Float Panel", "Flutuar painel"),+ ("Fonts in Document", "Fontes no documento"),+ ("Form Fields", "Campos de formulário"),+ ("Frame Fitting Options…", "Opções de ajuste de quadro…"),+ ("Generate Index…", "Gerar índice remissivo…"),+ ("Generate QR Code…", "Gerar código QR…"),+ ("Generate Static Caption", "Gerar legenda estática"),+ ("Get Story", "Obter matéria"),+ ("Get Table", "Obter tabela"),+ ("Global Light…", "Luz global…"),+ ("Go To Link", "Ir para o link"),+ ("Go To Source", "Ir para a origem"),+ ("Gradient Feather", "Esmaecimento em gradiente"),+ ("Gridify", "Converter em grade"),+ ("Group Transparency", "Transparência do grupo"),+ ("Hide Menu Item", "Ocultar item de menu"),+ ("Hide/Lock Others", "Ocultar/bloquear outros"),+ ("High Quality Display", "Exibição em alta qualidade"),+ ("History", "Histórico"),+ ("Import Options: Styles", "Opções de importação: estilos"),+ ("Index Page References", "Referências de página do índice remissivo"),+ ("Inner Glow", "Brilho interno"),+ ("Inner Shadow", "Sombra interna"),+ ("Insert Anchored Object…", "Inserir objeto ancorado…"),+ ("Insert Cross-Reference…", "Inserir referência cruzada…"),+ ("Insert Endnote", "Inserir nota de fim"),+ ("Insert Math Expression…", "Inserir expressão matemática…"),+ ("Insert Pages…", "Inserir páginas…"),+ ("Insert Variable", "Inserir variável"),+ ("Inspect Document", "Inspecionar documento"),+ ("Interface Color Theme", "Tema de cores da interface"),+ ("Join the ArtCraft Discord…", "Entrar no Discord do ArtCraft…"),+ ("Last Object Below", "Último objeto abaixo"),+ ("Library Contents", "Conteúdo da biblioteca"),+ ("Library Items", "Itens da biblioteca"),+ ("Liquid Page Rule", "Regra de página líquida"),+ ("List Documents", "Listar documentos"),+ ("List Styles", "Listar estilos"),+ ("List Tools", "Listar ferramentas"),+ ("Load Place Cursor", "Carregar cursor de inserção"),+ ("Make Compound Path", "Criar traçado composto"),+ ("Map Styles to Tags", "Mapear estilos para tags"),+ ("Math Expression SVG", "SVG de expressão matemática"),+ ("Media Options", "Opções de mídia"),+ ("Menus…", "Menus…"),+ ("Merge Layers", "Mesclar camadas"),+ ("Move Caret", "Mover cursor de texto"),+ ("Move Gap", "Mover espaço"),+ ("Move Row", "Mover linha"),+ ("New Book", "Novo livro"),+ ("New Cell Style…", "Novo estilo de célula…"),+ ("New Color Swatch…", "Nova amostra de cor…"),+ ("New Condition…", "Nova condição…"),+ ("New Guide", "Nova guia"),+ ("New Hyperlink Destination…", "Novo destino de hiperlink…"),+ ("New Hyperlink…", "Novo hiperlink…"),+ ("New Library", "Nova biblioteca"),+ ("New Page Reference…", "Nova referência de página…"),+ ("New Stroke Style…", "Novo estilo de traço…"),+ ("New Table Style…", "Novo estilo de tabela…"),+ ("Next Cell", "Próxima célula"),+ ("Next Document", "Próximo documento"),+ ("Next Object Above", "Próximo objeto acima"),+ ("Next Object Below", "Próximo objeto abaixo"),+ ("Next Object in Group", "Próximo objeto no grupo"),+ ("Object Export Options", "Opções de exportação de objeto"),+ ("Object Export Options…", "Opções de exportação de objeto…"),+ ("Object Layer Options…", "Opções de camada de objeto…"),+ ("Object Layers", "Camadas de objeto"),+ ("Object Liquid Settings", "Configurações líquidas do objeto"),+ ("Open Book", "Abrir livro"),+ ("Open Bytes", "Abrir bytes"),+ ("Open IDML", "Abrir IDML"),+ ("Open Library", "Abrir biblioteca"),+ ("Outer Glow", "Brilho externo"),+ ("Overprint Preview", "Visualização de sobreimpressão"),+ ("Override All Parent Page Items", "Substituir todos os itens da página-mestre"),+ ("Page Transition", "Transição de página"),+ ("Page Transitions", "Transições de página"),+ ("Paragraph Formatting", "Formatação de parágrafo"),+ ("Paste Into", "Colar dentro"),+ ("Paste without Formatting", "Colar sem formatação"),+ ("Place Caret", "Posicionar cursor de texto"),+ ("Place Item", "Inserir item"),+ ("Place Snippet", "Inserir snippet"),+ ("Place and Link", "Inserir e vincular"),+ ("Polygon Settings…", "Configurações de polígono…"),+ ("Preflight Document", "Verificar documento (preflight)"),+ ("Previous Cell", "Célula anterior"),+ ("Previous Document", "Documento anterior"),+ ("Previous Object in Group", "Objeto anterior no grupo"),+ ("Printers", "Impressoras"),+ ("Proof Colors", "Cores de prova"),+ ("Proof Setup", "Configuração de prova"),+ ("Quick Apply…", "Aplicação rápida…"),+ ("Recover Documents", "Recuperar documentos"),+ ("Recovery Data", "Dados de recuperação"),+ ("Reject All Changes", "Rejeitar todas as alterações"),+ ("Release Compound Path", "Liberar traçado composto"),+ ("Remove All Local Overrides", "Remover todas as substituições locais"),+ ("Remove Document", "Remover documento"),+ ("Report an Issue…", "Relatar um problema…"),+ ("Reset Shortcuts", "Redefinir atalhos"),+ ("Reset Workspace", "Redefinir espaço de trabalho"),+ ("Resize", "Redimensionar"),+ ("Rotate Spread", "Girar spread"),+ ("Run Script", "Executar script"),+ ("Sample Document", "Documento de exemplo"),+ ("Satin", "Cetim"),+ ("Save Recovery Data", "Salvar dados de recuperação"),+ ("Script Label", "Rótulo de script"),+ ("Select All on Layer", "Selecionar tudo na camada"),+ ("Select Cells", "Selecionar células"),+ ("Select Column", "Selecionar coluna"),+ ("Select Frame", "Selecionar quadro"),+ ("Select Row", "Selecionar linha"),+ ("Select Table", "Selecionar tabela"),+ ("Select Text", "Selecionar texto"),+ ("Select Tool", "Selecionar ferramenta"),+ ("Select Word", "Selecionar palavra"),+ ("Selection Attributes", "Atributos da seleção"),+ ("Separations Preview", "Visualização de separações"),+ ("Serialize", "Serializar"),+ ("Set Active Layer", "Definir camada ativa"),+ ("Set Shortcut", "Definir atalho"),+ ("Set Visibility / Lock", "Definir visibilidade / bloqueio"),+ ("Show Panel", "Mostrar painel"),+ ("Show/Hide Baseline Grid", "Mostrar/ocultar grade de linha de base"),+ ("Show/Hide Frame Edges", "Mostrar/ocultar bordas dos quadros"),+ ("Show/Hide Guides", "Mostrar/ocultar guias"),+ ("Show/Hide Hidden Characters", "Mostrar/ocultar caracteres ocultos"),+ ("Show/Hide Panels", "Mostrar/ocultar painéis"),+ ("Show/Hide Panels Except Tools", "Mostrar/ocultar painéis, exceto ferramentas"),+ ("Show/Hide Rulers", "Mostrar/ocultar réguas"),+ ("Show/Hide Tagged Frames", "Mostrar/ocultar quadros marcados"),+ ("Show/Hide Text Threads", "Mostrar/ocultar encadeamentos de texto"),+ ("Smooth", "Suavizar"),+ ("Sort", "Ordenar"),+ ("Split Path", "Dividir traçado"),+ ("Step and Repeat…", "Passo e repetição…"),+ ("Stroke Styles", "Estilos de traço"),+ ("Style Source", "Origem do estilo"),+ ("Synchronize Book", "Sincronizar livro"),+ ("Table Panel", "Painel Tabela"),+ ("Table Style Options…", "Opções de estilo de tabela…"),+ ("Table of Contents Entries", "Entradas do sumário"),+ ("Table of Contents…", "Sumário…"),+ ("Text Anchors", "Âncoras de texto"),+ ("Text Variables", "Variáveis de texto"),+ ("Toggle Normal/Preview", "Alternar entre normal e visualização"),+ ("Toggle Selection", "Alternar seleção"),+ ("Tools: Double Column", "Ferramentas: coluna dupla"),+ ("Transform Panel", "Painel Transformar"),+ ("Transform Values", "Valores de transformação"),+ ("Transparency Blend Space", "Espaço de mesclagem de transparência"),+ ("Transparency Flattener Presets", "Predefinições de achatamento de transparência"),+ ("Type on a Path", "Texto em um traçado"),+ ("Type on a Path Options…", "Opções de texto em um traçado…"),+ ("Typical Display", "Exibição típica"),+ ("Update Link", "Atualizar link"),+ ("User Dictionary Words", "Palavras do dicionário do usuário"),+ ("User Dictionary…", "Dicionário do usuário…"),+ ("Zoom To", "Zoom para"),+ ("⇧", "⇧"),+ ("⌃", "⌃"),+ ("⌘", "⌘"),+ ("⌥", "⌥"),+ ("Accept Change", "Aceitar alteração"),+ ("Add Anchor", "Adicionar âncora"),+ ("Add Selection to Article", "Adicionar seleção ao artigo"),+ ("Add Unnamed Colors", "Adicionar cores sem nome"),+ ("Add to Dictionary", "Adicionar ao dicionário"),+ ("Align Center", "Alinhar ao centro"),+ ("Align Left", "Alinhar à esquerda"),+ ("Align Right", "Alinhar à direita"),+ ("Apply Character Style", "Aplicar estilo de caractere"),+ ("Apply Object Style", "Aplicar estilo de objeto"),+ ("Apply Paragraph Style", "Aplicar estilo de parágrafo"),+ ("Apply Table Style", "Aplicar estilo de tabela"),+ ("Article Options", "Opções de artigo"),+ ("Basic Feather", "Esmaecimento básico"),+ ("Bold", "Negrito"),+ ("Character Style Options…", "Opções de estilo de caractere…"),+ ("Close Path", "Fechar traçado"),+ ("Color Group Options", "Opções de grupo de cores"),+ ("Condition Options…", "Opções de condição…"),+ ("Convert to Liquid Guide", "Converter em guia líquida"),+ ("Convert to Object", "Converter em objeto"),+ ("Create Line", "Criar linha"),+ ("Create Path", "Criar traçado"),+ ("Decrease Point Size", "Diminuir tamanho em pontos"),+ ("Delete Article", "Excluir artigo"),+ ("Delete Bookmark", "Excluir marcador"),+ ("Delete Endnote", "Excluir nota de fim"),+ ("Delete Footnote", "Excluir nota de rodapé"),+ ("Delete Guide", "Excluir guia"),+ ("Delete Hyperlink", "Excluir hiperlink"),+ ("Delete List", "Excluir lista"),+ ("Delete Note", "Excluir nota"),+ ("Delete Pages", "Excluir páginas"),+ ("Delete Paragraph Style", "Excluir estilo de parágrafo"),+ ("Delete Stroke Style", "Excluir estilo de traço"),+ ("Delete Table", "Excluir tabela"),+ ("Delete Tag", "Excluir tag"),+ ("Delete Text", "Excluir texto"),+ ("Distribute Columns Evenly", "Distribuir colunas uniformemente"),+ ("Edit Endnote", "Editar nota de fim"),+ ("Edit Note", "Editar nota"),+ ("Embed Link", "Incorporar link"),+ ("Flip", "Inverter"),+ ("Hyperlink Options…", "Opções de hiperlink…"),+ ("Increase Point Size", "Aumentar tamanho em pontos"),+ ("Insert Column Left", "Inserir coluna à esquerda"),+ ("Insert Column Right", "Inserir coluna à direita"),+ ("Insert Row Above", "Inserir linha acima"),+ ("Insert Row Below", "Inserir linha abaixo"),+ ("Italic", "Itálico"),+ ("Justify Left", "Justificar à esquerda"),+ ("Layer Options…", "Opções de camada…"),+ ("Move Anchors", "Mover âncoras"),+ ("Move Column", "Mover coluna"),+ ("Move Guide", "Mover guia"),+ ("Move Layer", "Mover camada"),+ ("Move Pages…", "Mover páginas…"),+ ("Move to Layer", "Mover para a camada"),+ ("New Article", "Novo artigo"),+ ("New Bookmark", "Novo marcador"),+ ("New Layer…", "Nova camada…"),+ ("New Note", "Nova nota"),+ ("New Object Style…", "Novo estilo de objeto…"),+ ("New Parent…", "Nova página-mestre…"),+ ("New Tag", "Nova tag"),+ ("Paste in Place", "Colar no mesmo lugar"),+ ("Place Loaded Graphic", "Inserir gráfico carregado"),+ ("Reject Change", "Rejeitar alteração"),+ ("Release State to Objects", "Liberar estado para objetos"),+ ("Remove Hyphenation Exception", "Remover exceção de hifenização"),+ ("Remove from Article", "Remover do artigo"),+ ("Rename", "Renomear"),+ ("Rename Bookmark", "Renomear marcador"),+ ("Rotate", "Girar"),+ ("Scale", "Escalar"),+ ("Set Cross-Reference Format", "Definir formato de referência cruzada"),+ ("Set Footnote Text", "Definir texto da nota de rodapé"),+ ("Set Story Text", "Definir texto da matéria"),+ ("Shear", "Distorcer"),+ ("Show All on Spread", "Mostrar tudo no spread"),+ ("Show State", "Mostrar estado"),+ ("State Options", "Opções de estado"),+ ("Tag Frame", "Marcar quadro"),+ ("Tag Text", "Marcar texto"),+ ("Unlink", "Desvincular"),+ ("Update Index", "Atualizar índice remissivo"),+ ("Update Table of Contents", "Atualizar sumário"),+ ("Bulleted and Numbered Lists", "Listas com marcadores e numeradas"),+ ("Hyperlinks Cross-References", "Hiperlinks e referências cruzadas"),+ ("Document Footnote Options...", "Opções de notas de rodapé do documento..."),+ ("Anchored Object", "Objeto ancorado"),+ ("Apply Attributes (Eyedropper", "Aplicar atributos (conta-gotas"),+ ("Captions", "Legendas"),+ ("Change All (Object", "Alterar tudo (objeto"),+ ("Clipping Path", "Traçado de recorte"),+ ("Convert Cell Type", "Converter tipo de célula"),+ ("Copy Link(s", "Copiar link(s"),+ ("DesignCraft", "DesignCraft"),+ ("Export EPUB (Fixed Layout", "Exportar EPUB (layout fixo"),+ ("Export EPUB (Reflowable", "Exportar EPUB (reflowable"),+ ("Hyperlinks & Cross-References", "Hiperlinks e referências cruzadas"),+ ("Hyphens and Dashes", "Hifens e travessões"),+ ("Markers", "Marcadores"),+ ("Other", "Outros"),+ ("Output", "Saída"),+ ("Quotation Marks", "Aspas"),+ ("Symbols", "Símbolos"),+ ("Type & Tables", "Texto e tabelas"),+ ("Utilities", "Utilitários"),+ ("Korean Line Breaks:", "Quebras de linha em coreano:"),+ ("Between syllables (not only at spaces)", "Entre sílabas (não apenas nos espaços)"),+ ("Show Font Names in English", "Mostrar nomes de fontes em inglês"),+ ("Missing Glyphs", "Glifos ausentes"),+ ("Draw Missing Glyphs from Fallback Fonts", "Desenhar glifos ausentes com fontes substitutas"),+ ("No data source", "Nenhuma fonte de dados"),+ ("Select Data Source…", "Selecionar fonte de dados…"),+ ("Data Merge", "Mesclagem de dados"),+ ("Previous", "Anterior"),+ ("Next", "Próximo"),+ ("Record", "Registro"),+ ("Merge options", "Opções de mesclagem"),+ ("All records", "Todos os registros"),+ ("One record", "Um registro"),+ ("Range", "Intervalo"),+ ("Records per page", "Registros por página"),+ ("Single record", "Registro único"),+ ("Multiple records", "Vários registros"),+ ("Rows first", "Linhas primeiro"),+ ("Columns first", "Colunas primeiro"),+ ("Column spacing", "Espaçamento entre colunas"),+ ("Row spacing", "Espaçamento entre linhas"),+ ("Fit proportionally", "Ajustar proporcionalmente"),+ ("Fill proportionally", "Preencher proporcionalmente"),+ ("Fit content to frame", "Ajustar conteúdo ao quadro"),+ ("Center in frame", "Centralizar no quadro"),+ ("Link images", "Vincular imagens"),+ ("Limit", "Limite"),+ ("Bind to frame", "Vincular ao quadro"),+ ("Insert field", "Inserir campo"),+ ("Pass csv, rows, or bytes from the control channel.", "Passe csv, linhas ou bytes pelo canal de controle."),+ ("Panels", "Painéis"),];diff --cc crates/ui-egui/src/i18n/uk.rsindex 9e4db9660,0f368430f..8d688dcce--- a/crates/ui-egui/src/i18n/uk.rs+++ b/crates/ui-egui/src/i18n/uk.rs@@@ -1466,174 -1455,7 +1466,175 @@@ pub(super) const TABLE: &[(&str, &str)("Selection", "Виділення"),("All Documents", "Усі документи"),("On", "Увімкнено"),+ // Machine-translated; not yet reviewed by a native speaker.+ ("Advanced Character Formats", "Розширене форматування символів"),+ ("Align Left Edge", "Вирівняти лівий край"),+ ("Baseline Shift:", "Зсув базової лінії:"),+ ("Bottom Inset", "Нижній відступ"),+ ("Can't Open the File", "Не вдалося відкрити файл"),+ ("Can't Place the File", "Не вдалося розмістити файл"),+ ("Case:", "Регістр:"),+ ("Character Style Options", "Параметри стилю символів"),+ ("Characters:", "Символи:"),+ ("Column Rules", "Лінії між колонками"),+ ("Drop Caps", "Буквиці"),+ ("Drop Chars", "Символи буквиці"),+ ("Drop Lines", "Рядки буквиці"),+ ("Edit \"{name}\"…", "Редагувати «{name}»…"),+ ("Figure Style:", "Стиль цифр:"),+ ("Horizontal Offset", "Горизонтальний зсув"),+ ("Horizontal Scale:", "Горизонтальний масштаб:"),+ ("Insert Column Rule", "Вставити лінію між колонками"),+ ("Kerning:", "Кернінг:"),+ ("Language:", "Мова:"),+ ("Ligatures", "Лігатури"),+ ("Lines:", "Рядки:"),+ ("No Break", "Без розриву"),+ ("OpenType All Small Caps", "Уся капітель OpenType"),+ ("OpenType Denominator", "Знаменник OpenType"),+ ("OpenType Features", "Функції OpenType"),+ ("OpenType Numerator", "Чисельник OpenType"),+ ("OpenType Subscript", "Нижній індекс OpenType"),+ ("Paragraph Rules", "Лінії абзацу"),+ ("Paragraph Rules…", "Лінії абзацу…"),+ ("Rule Below", "Лінія знизу"),+ ("Scale for Descenders", "Масштабувати з урахуванням виносних елементів"),+ ("Select an object or text to color its fill or stroke.", "Виділіть об’єкт або текст, щоб задати колір його заливки чи обведення."),+ ("Skew:", "Нахил:"),+ ("Strikethrough On", "Закреслення увімкнено"),+ ("Style Settings:", "Параметри стилю:"),+ ("Subscript", "Нижній індекс"),+ ("Tint %", "Відтінок %"),+ ("Tint:", "Відтінок:"),+ ("Top Inset", "Верхній відступ"),+ ("Underline On", "Підкреслення увімкнено"),+ ("Vertical Scale:", "Вертикальний масштаб:"),+ ("dropcap", "буквиця"),+ ("Left-aligned tab", "Табуляція з вирівнюванням ліворуч"),+ ("Centered tab", "Табуляція з вирівнюванням по центру"),+ ("Right-aligned tab", "Табуляція з вирівнюванням праворуч"),+ ("Tab aligned on a character", "Табуляція з вирівнюванням за символом"),+ ("X:", "X:"),+ ("Leader:", "Заповнювач:"),+ ("Align On:", "Вирівнювати за:"),+ ("Position panel above text frame", "Розмістити панель над текстовим фреймом"),+ ("Clear All", "Очистити все"),+ ("Delete Tab", "Видалити табуляцію"),+ ("Repeat Tab", "Повторити табуляцію"),+ ("Reset Indents", "Скинути відступи"),+ ("Paragraph Border", "Рамка абзацу"),+ ("Paragraph Shading", "Заливка абзацу"),+ ("Keep Options", "Параметри утримання"),+ ("Span Columns", "Охоплення колонок"),+ ("Top:", "Зверху:"),+ ("Left:", "Ліворуч:"),+ ("Bottom:", "Знизу:"),+ ("Right:", "Праворуч:"),+ ("Keep with Next:", "Утримувати з наступним:"),+ ("Keep Lines Together", "Утримувати рядки разом"),+ ("All Lines in Paragraph", "Усі рядки абзацу"),+ ("At Start/End of Paragraph", "На початку і в кінці абзацу"),+ ("End:", "Кінець:"),+ ("Start Paragraph:", "Початок абзацу:"),+ ("Anywhere", "Будь-де"),+ ("In Next Column", "У наступній колонці"),+ ("In Next Frame", "У наступній рамці"),+ ("On Next Page", "На наступній сторінці"),+ ("On Next Odd Page", "На наступній непарній сторінці"),+ ("On Next Even Page", "На наступній парній сторінці"),+ ("Paragraph Layout:", "Макет абзацу:"),+ ("Single Column", "Одна колонка"),+ ("Split Column", "Поділ колонки"),+ ("Columns:", "Колонки:"),+ ("All", "Усі"),+ ("Inside Gutter:", "Внутрішній проміжок:"),+ ("Outside Gutter:", "Зовнішній проміжок:"),+ ("List Type:", "Тип списку:"),+ ("Bullets", "Маркери"),+ ("Numbers", "Нумерація"),+ ("Bullet Character:", "Символ маркера:"),+ ("Text After:", "Текст після:"),+ ("Gap Tint:", "Відтінок проміжку:"),+ ("Corner Size and Shape", "Розмір і форма кутів"),+ ("Top Left:", "Угорі ліворуч:"),+ ("Top Right:", "Угорі праворуч:"),+ ("Bottom Right:", "Унизу праворуч:"),+ ("Bottom Left:", "Унизу ліворуч:"),+ ("Rounded", "Заокруглений"),+ ("Inverse Rounded", "Обернено заокруглений"),+ ("Inset", "Вдавлений"),+ ("Fancy", "Декоративний"),+ ("Top Edge:", "Верхній край:"),+ ("Bottom Edge:", "Нижній край:"),+ ("Em Box Top", "Верх кегельної площадки"),+ ("Descent", "Нижній виносний елемент"),+ ("Em Box Bottom", "Низ кегельної площадки"),+ ("Display Border if Paragraph Splits Across Frames/Columns", "Показувати рамку, якщо абзац розбито між фреймами/колонками"),+ ("Merge Consecutive Borders and Shading", "Об’єднувати послідовні рамки й заливки"),+ ("Clip to Frame", "Обтинати за фреймом"),+ ("Do not Print or Export", "Не друкувати й не експортувати"),+ ("Space Before Span:", "Відступ перед охопленням:"),+ ("Space After Span:", "Відступ після охоплення:"),+ ("Space Before Split:", "Відступ перед розділенням:"),+ ("Space After Split:", "Відступ після розділення:"),+ ("Level:", "Рівень:"),+ ("Glyphs…", "Гліфи…"),+ ("(Paragraph Font)", "(Шрифт абзацу)"),+ ("Restart Numbers at This Level After:", "Починати нумерацію на цьому рівні заново після:"),+ ("Any Previous Level", "Будь-якого попереднього рівня"),+ ("Tab Position:", "Позиція табуляції:"),+ ("Paragraph Borders and Shading…", "Рамки й заливка абзацу…"),+ ("Paragraph Borders and Shading", "Рамки й заливка абзацу"),+ ("Span Columns…", "Охоплення колонок…"),+ ("Bullets and Numbering…", "Маркери та нумерація…"),+ ("List:", "Список:"),+ ("[Default]", "[Типово]"),+ ("Number:", "Номер:"),+ ("Mode:", "Режим:"),+ ("Continue from Previous Number", "Продовжити з попереднього номера"),+ ("Start At", "Почати з"),+ ("Strokes and Fills…", "Обведення та заливки…"),+ ("Cell Stroke", "Обведення клітинки"),+ ("Cell Fill", "Заливка клітинки"),+ ("Cell edges", "Краї клітинки"),+ (+ "Click a line to include or exclude it. Double-click selects all outer or all inner lines; triple-click selects or clears all.",+ "Клацніть лінію, щоб увімкнути або вимкнути її. Подвійне клацання вибирає всі зовнішні або всі внутрішні лінії; потрійне — вибирає всі або знімає вибір.",+ ),+ ("Swatch Options…", "Параметри зразка…"),+ ("Swatch Options", "Параметри зразка"),+ ("Color Group Options…", "Параметри групи кольорів…"),+ ("Layer Options", "Параметри шару"),+ ("Layer Options for \"{name}\"…", "Параметри шару «{name}»…"),+ ("Swatch Name:", "Назва зразка:"),+ ("Name with Color Value", "Назва за значенням кольору"),+ ("Color Type:", "Тип кольору:"),+ ("Process", "Тріадний"),+ ("Spot", "Плашковий"),+ ("Color Mode:", "Колірна модель:"),+ ("Base Color:", "Базовий колір:"),+ ("Edit the gradient's stops in the Gradient panel.", "Точки градієнта редагуються на панелі «Градієнт»."),+ ("This swatch can't be edited.", "Цей зразок не можна змінити."),+ ("Light Blue", "Світло-синій"),+ ("Red", "Червоний"),+ ("Green", "Зелений"),+ ("Blue", "Синій"),+ ("Yellow", "Жовтий"),+ ("Magenta", "Пурпуровий"),+ ("Cyan", "Ціан"),+ ("Black", "Чорний"),+ ("Orange", "Помаранчевий"),+ ("Dark Green", "Темно-зелений"),+ ("Teal", "Бірюзовий"),+ ("Tan", "Пісочний"),+ ("Brown", "Коричневий"),+ ("Violet", "Фіолетовий"),+ ("Gold", "Золотий"),+ ("Show Layer", "Показати шар"),+ ("Lock Layer", "Заблокувати шар"),+ ("Print Layer", "Друкувати шар"),+ ("Suppress Text Wrap When Layer is Hidden", "Вимикати обтікання текстом, коли шар приховано"),+ ("Justification…", "Вирівнювання за шириною…"),];/// Contexts whose Ukrainian noun differs from the shared action/text-layout label.diff --cc crates/ui-egui/src/menus.rsindex 3d7073326,ec6b1b65e..cf5d84810--- a/crates/ui-egui/src/menus.rs+++ b/crates/ui-egui/src/menus.rs@@@ -84,14 -68,12 +84,20 @@@ pub const UI_COMMANDS: &[(&str, &str, ONone,"{rule?: ruleAbove|ruleBelow} — Rule Above / Rule Below of the selected paragraphs (type.para)",),+ (+ "app.paragraphBordersDialog",+ "Paragraph Borders and Shading…",+ None,+ "{tab?: border|shading} — border and shading of the selected paragraphs (type.para)",+ ),+ ("app.spanColumnsDialog", "Span Columns…", None, "{} — span or split columns of the selected paragraphs (type.para)"),+ ("app.bulletsNumberingDialog", "Bullets and Numbering…", None, "{} — bullets or numbers of the selected paragraphs (type.para)"),+ (+ "app.justificationDialog",+ "Justification…",+ Some("Cmd+Alt+Shift+J"),+ "{} — word and letter spacing, glyph scaling and composer of the selected paragraphs (type.para)",+ ),("app.findFontDialog", "Find/Replace Font…", None, "{} — fonts used (missing ones flagged) and replacing them"),("app.insertXrefDialog", "Insert Cross-Reference…", None, "{} — New Cross-Reference dialog (paragraph or text anchor, format)"),("app.deleteAllGuides", "Delete All Guides on Spread", None, "{} — the spread in view"),@@@ -427,9 -398,7 +433,10 @@@ pub const MENUS: &[(&str, &[&str])] = &"cmd:type.alignRight","cmd:type.justify","ui:app.paragraphRulesDialog",+ "ui:app.justificationDialog",+ "ui:app.paragraphBordersDialog",+ "ui:app.spanColumnsDialog",+ "ui:app.bulletsNumberingDialog","-","cmd:type.bold","cmd:type.italic",@@@ -1010,23 -958,18 +1017,35 @@@ pub fn run_ui(app: &mut DesignApp, id:app.ui.dialog = Some(crate::dialogs::Dialog::new("paragraphRules", json!({"rule": rule, "current": current})));Ok(Value::Null)}+ "app.paragraphBordersDialog" | "app.spanColumnsDialog" | "app.bulletsNumberingDialog" => {+ let Some(a) = crate::panels::text_attrs(app) else { return Some(Err("select text or a text frame".into())) };+ let section = match id {+ "app.spanColumnsDialog" => "span",+ "app.bulletsNumberingDialog" => "bullets",+ _ if p.get("tab").and_then(Value::as_str) == Some("shading") => "shading",+ _ => "border",+ };+ let fields = json!({+ "section": section,+ "current": a["para"],+ "family": a["chars"]["fontFamily"],+ "style": a["chars"]["fontStyle"],+ });+ app.ui.dialog = Some(crate::dialogs::Dialog::new("paragraphLocal", fields));+ Ok(Value::Null)+ }+ "app.justificationDialog" => {+ let Some(a) = app.session.execute("type.selectionAttrs", &json!({"mixed": true})).ok().filter(|a| !a.is_null()) else {+ return Some(Err("select text or a text frame".into()));+ };+ let mixed: Vec<&str> = a["paraMixed"].as_array().map(|m| m.iter().filter_map(Value::as_str).collect()).unwrap_or_default();+ let current: serde_json::Map<String, Value> = crate::dialogs::JUSTIFY_ATTRS+ .iter()+ .map(|k| (k.to_string(), if mixed.contains(k) { Value::Null } else { a["para"][*k].clone() }))+ .collect();+ app.ui.dialog = Some(crate::dialogs::Dialog::new("justification", json!({"current": current})));+ Ok(Value::Null)+ }"app.footnoteOptionsDialog" => {let Some(st) = app.session.active() else { return Some(Err("no document open".into())) };let o = serde_json::to_value(&st.doc.footnote_options).unwrap_or_default();@@@ -2020,11 -1827,11 +2039,14 @@@ pub fn checked(app: &DesignApp, id: &st/// Enablement for menu display (UI commands need a document unless they're app/window-level).pub fn menu_enabled(app: &DesignApp, id: &str) -> bool {+ if waits_for_ime(app, id) {+ return false;+ }+ if id == "app.justificationDialog" {+ return enabled(app, "type.para");+ }if ui_label(id).is_some() {- return app.session.active().is_some() || id.starts_with("app.") || id.starts_with("window.");+ return app.session.active().is_some() || id.starts_with("app.") || id.starts_with("window.") || id.starts_with("help.");}enabled(app, id)}diff --cc crates/ui-egui/src/panels/properties.rsindex ad0cac4d6,b71c3130a..c1a6e3eae--- a/crates/ui-egui/src/panels/properties.rs+++ b/crates/ui-egui/src/panels/properties.rs@@@ -1469,16 -1412,13 +1469,17 @@@ pub fn paragraph_panel(app: &mut Designcrate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Paragraph")).strong());ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {crate::menus::menu_button(ui, "☰", |ui| {- if ui.button(crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "Paragraph Rules…"))).clicked() {- let _ = app.run("app.paragraphRulesDialog", json!({}));- ui.close();- }- if ui.button(crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "Justification…"))).clicked() {- let _ = app.run("app.justificationDialog", json!({}));- ui.close();+ for (label, id) in [+ ("Paragraph Rules…", "app.paragraphRulesDialog"),++ ("Justification…", "app.justificationDialog"),+ ("Paragraph Borders and Shading…", "app.paragraphBordersDialog"),+ ("Span Columns…", "app.spanColumnsDialog"),+ ("Bullets and Numbering…", "app.bulletsNumberingDialog"),+ ] {+ if ui.button(crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, label))).clicked() {+ let _ = app.run(id, json!({}));+ ui.close();+ }}});});diff --cc docs/typography-parity.mdindex d90b315f0,86c41c598..8b97da9db--- a/docs/typography-parity.md+++ b/docs/typography-parity.md@@@ -1,6 -1,6 +1,6 @@@# Typography and composition parity- > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (Optical kerning from outlines (#181); macOS lists fonts that font services and managers activate) · **Target:** Adobe InDesign 2026 (21.6)-> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (Justification dialog for the selected paragraphs) · **Target:** Adobe InDesign 2026 (21.6)++> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (Optical kerning from outlines (#181); macOS lists fonts that font services and managers activate; Justification dialog for the selected paragraphs) · **Target:** Adobe InDesign 2026 (21.6)Typesetting is what InDesign is bought for. A feature can exist and still set text differentlyfrom InDesign: different line breaks, different page count, overset where InDesign fits. This@@@ -35,10 -35,10 +35,10 @@@ Fidelity: **unmeasured** unless stated| Paragraph Composer | Adobe's multi-line composer | Knuth–Plass total fit, fitness classes, hyphen penalties | ~ | same family of algorithm, Adobe's weights unknown; breaks will differ on some paragraphs || Single-line Composer | greedy | greedy with the same ranges | ✓ | || World-Ready composers | Paragraph / Single-line World-Ready | RTL, Arabic and bidi in the main composer | ~ | Indic scripts (Devanagari etc.) shape through harfrust but are untested |- | Justification | word/letter spacing, glyph scaling min/desired/max, single-word, last line | all of these | ✓ | a justified line with a tab now justifies after the tab (#284) |+ | Justification | word/letter spacing, glyph scaling min/desired/max, single-word, last line | all of these | ✓ | a justified line with a tab justifies after the tab (#284); set per paragraph in Type › Justification… and the Paragraph panel menu (#531) || Hyphenation | per-language dictionaries (~40), zone, limits, capitalized, last word, across columns | Liang patterns: English (trained from the public-domain Moby list) and Spanish (Bezos); zone, limits, exceptions in the user dictionary | ~ | other languages don't hyphenate (#87 reported "doesn't work") || Spelling | per-language dictionaries | English (Moby) + document/user dictionary | ~ | |-| Kerning | Metrics, Optical, manual, none | Metrics, manual, none | ~ | **Optical treated as Metrics** (#181): imported display text sets wider and can overset |+| Kerning | Metrics, Optical, manual, none | Metrics, Optical (outline-based: pairs pulled towards the font's stem gap, `crates/compose/src/optical.rs`), manual, none | ~ | Optical is an approximation of Adobe's algorithm (#181), not a match: imported display text can still break differently || Tracking, scale, skew, baseline shift | ✓ | ✓ | ✓ | || OpenType features | ligatures, discretionary, swash, fractions, ordinals, figures, small caps, stylistic sets, positional forms | through harfrust | ✓ | || Variable fonts | axes in Character panel | named instances and free axis values; PDF embeds the instance | ✓ | |