Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Merge remote-tracking branch 'origin/main' into character-style-from-selection

moppeeerd4a00a207f25
diff --cc crates/engine/src/cmd/style/paragraph.rs
index 000000000,81711ff10..b7842daef
mode 000000,100644..100644
--- a/crates/engine/src/cmd/style/paragraph.rs
+++ b/crates/engine/src/cmd/style/paragraph.rs
@@@ -1,0 -1,1236 +1,1284 @@@
+ use super::{CharAttrs, CharacterStyle, ParaAttrs, ParagraphStyle, Result, Session, Styles, Value, bad, json, ok, str_param};
+
+ #[cfg(test)]
+ mod redefine_tests {
+ use super::*;
+
+ fn sample() -> (Session, Value, Value) {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let a = s.execute("frame.create", &json!({"rect":[36,36,300,200],"content":"text","text":"First header"})).unwrap();
+ let b = s.execute("frame.create", &json!({"rect":[36,240,300,400],"content":"text","text":"Second header"})).unwrap();
+ s.execute("style.paragraph.create", &json!({"name":"Header","chars":{"size":18,"fill":"[Paper]"}})).unwrap();
+ for story in [&a["story"], &b["story"]] {
+ s.execute("text.select", &json!({"story":story,"anchor":0,"focus":5})).unwrap();
+ s.execute("style.paragraph.apply", &json!({"name":"Header"})).unwrap();
+ }
+ s.execute("text.select", &json!({"story":a["story"],"anchor":0,"focus":5})).unwrap();
+ (s, a["story"].clone(), b["story"].clone())
+ }
+
+ #[test]
+ fn redefine_paragraph_updates_other_stories_and_clears_the_source_overrides() {
+ let (mut s, a, b) = sample();
+ s.execute("style.character.create", &json!({"name":"Emphasis","chars":{"underline":true}})).unwrap();
+ s.execute("style.character.apply", &json!({"name":"Emphasis"})).unwrap();
+ s.execute("type.char", &json!({"size":20,"fill":"[Black]"})).unwrap();
+ s.execute("type.para", &json!({"spaceAfter":9})).unwrap();
+ let before = s.doc().unwrap().doc.clone();
+ let undo = s.doc().unwrap().history.undo.len();
+ s.execute("style.paragraph.redefine", &json!({})).unwrap();
+ assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1);
+ assert!(s.doc().unwrap().doc.styles.para("Header").unwrap().chars.underline.is_none());
+ for story in [&a, &b] {
+ s.execute("text.select", &json!({"story":story,"anchor":0,"focus":5})).unwrap();
+ let attrs = s.execute("type.selectionAttrs", &json!({})).unwrap();
+ assert_eq!(attrs["chars"]["size"], 20.0);
+ assert_eq!(attrs["chars"]["fill"], "[Black]");
+ assert_eq!(attrs["para"]["spaceAfter"], 9.0);
+ assert_eq!(attrs["chars"]["underline"], story == &a);
+ }
+ s.execute("style.paragraph.edit", &json!({"name":"Header","chars":{"size":22}})).unwrap();
+ s.execute("text.select", &json!({"story":a,"anchor":0,"focus":5})).unwrap();
+ assert_eq!(s.execute("type.selectionAttrs", &json!({})).unwrap()["chars"]["size"], 22.0);
+ s.execute("edit.undo", &json!({})).unwrap();
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert_eq!(s.doc().unwrap().doc, before);
+ }
+
+ #[test]
+ fn redefine_character_does_not_capture_paragraph_font_size() {
+ let (mut s, a, b) = sample();
+ s.execute("style.character.create", &json!({"name":"Underline","chars":{"underline":true}})).unwrap();
+ for story in [&a, &b] {
+ s.execute("text.select", &json!({"story":story,"anchor":0,"focus":5})).unwrap();
+ s.execute("style.character.apply", &json!({"name":"Underline"})).unwrap();
+ }
+ s.execute("type.char", &json!({"fill":"[Black]"})).unwrap();
+ s.execute("style.character.redefine", &json!({"name":"Underline"})).unwrap();
+ let style = s.doc().unwrap().doc.styles.char_style("Underline").unwrap();
+ assert!(style.chars.size.is_none());
+ assert_eq!(style.chars.underline, Some(true));
+ for story in [&a, &b] {
+ s.execute("text.select", &json!({"story":story,"anchor":0,"focus":5})).unwrap();
+ assert_eq!(s.execute("type.selectionAttrs", &json!({})).unwrap()["chars"]["fill"], "[Black]");
+ }
+ }
+
+ #[test]
+ fn redefine_rejects_the_wrong_style_and_the_none_entry_atomically() {
+ let (mut s, _, _) = sample();
+ let before = s.doc().unwrap().doc.clone();
+ let undo = s.doc().unwrap().history.undo.len();
+ assert!(s.execute("style.paragraph.redefine", &json!({"name":"Other"})).is_err());
+ assert!(s.execute("style.character.redefine", &json!({})).is_err());
+ assert_eq!(s.doc().unwrap().doc, before);
+ assert_eq!(s.doc().unwrap().history.undo.len(), undo);
+ }
+
+ #[test]
+ fn redefine_character_at_a_caret_cleans_the_source_run_but_keeps_other_overrides() {
+ let (mut s, story, _) = sample();
+ s.execute("style.character.create", &json!({"name":"Emphasis","chars":{"underline":true}})).unwrap();
+ for (start, end, size) in [(0, 5, 24), (6, 12, 32)] {
+ s.execute("text.select", &json!({"story":story,"anchor":start,"focus":end})).unwrap();
+ s.execute("style.character.apply", &json!({"name":"Emphasis"})).unwrap();
+ s.execute("type.char", &json!({"size":size})).unwrap();
+ }
+ let before = s.doc().unwrap().doc.clone();
+ s.execute("text.select", &json!({"story":story,"anchor":2,"focus":2})).unwrap();
+ s.execute("style.character.redefine", &json!({"name":"Emphasis"})).unwrap();
+ s.execute("style.character.edit", &json!({"name":"Emphasis","chars":{"size":30}})).unwrap();
+ for (start, end, size) in [(0, 5, 30.0), (6, 12, 32.0)] {
+ s.execute("text.select", &json!({"story":story,"anchor":start,"focus":end})).unwrap();
+ assert_eq!(s.execute("type.selectionAttrs", &json!({})).unwrap()["chars"]["size"], size);
+ }
+ s.execute("edit.undo", &json!({})).unwrap();
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert_eq!(s.doc().unwrap().doc, before);
+ }
+ }
+
+ #[cfg(test)]
+ mod application_inheritance_tests {
+ use super::*;
+
+ fn setup(text: &str) -> (Session, Value) {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let f = s.execute("frame.create", &json!({"rect": [36,36,300,300], "content": "text", "text": text})).unwrap();
+ (s, f["story"].clone())
+ }
+ fn select(s: &mut Session, story: &Value, start: usize, end: usize) {
+ s.execute("text.select", &json!({"story": story, "anchor": start, "focus": end})).unwrap();
+ }
+ fn attrs(s: &mut Session) -> Value {
+ s.execute("type.selectionAttrs", &json!({})).unwrap()
+ }
+
+ #[test]
+ fn paragraph_capture_source_follows_later_style_edits_and_undo() {
+ let (mut s, story) = setup("First\nSecond");
+ select(&mut s, &story, 0, 5);
+ s.execute("type.char", &json!({"size": 18, "fill": "[Paper]"})).unwrap();
+ s.execute("type.para", &json!({"spaceAfter": 6})).unwrap();
+ s.execute("style.paragraph.create", &json!({"name": "Header", "fromSelection": true})).unwrap();
+ let before = s.doc().unwrap().doc.clone();
+ let undo = s.doc().unwrap().history.undo.len();
+ s.execute("style.paragraph.apply", &json!({"name": "Header"})).unwrap();
+ assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1);
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert_eq!(s.doc().unwrap().doc, before);
+ s.execute("edit.redo", &json!({})).unwrap();
+ select(&mut s, &story, 6, 6);
+ s.execute("style.paragraph.apply", &json!({"name": "Header"})).unwrap();
+ s.execute("style.paragraph.edit", &json!({"name": "Header", "chars": {"size": 20, "fill": "[Black]"}, "para": {"spaceAfter": 12}})).unwrap();
+ for pos in [0, 6] {
+ select(&mut s, &story, pos, pos + 1);
+ let a = attrs(&mut s);
+ assert_eq!(a["chars"]["size"], 20.0);
+ assert_eq!(a["chars"]["fill"], "[Black]");
+ assert_eq!(a["para"]["spaceAfter"], 12.0);
+ }
+ }
+
+ #[test]
+ fn applying_styles_keeps_different_overrides_and_named_character_styles() {
+ let (mut s, story) = setup("First\nSecond");
+ select(&mut s, &story, 0, 5);
+ s.execute("type.char", &json!({"size": 14})).unwrap();
+ s.execute("type.para", &json!({"spaceAfter": 9})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Emphasis", "chars": {"underline": true}})).unwrap();
+ s.execute("style.character.apply", &json!({"name": "Emphasis"})).unwrap();
+ s.execute("style.paragraph.create", &json!({"name": "Body", "chars": {"size": 10}, "para": {"spaceAfter": 6}})).unwrap();
+ s.execute("style.paragraph.apply", &json!({"name": "Body"})).unwrap();
+ let a = attrs(&mut s);
+ assert_eq!(a["chars"]["size"], 14.0);
+ assert_eq!(a["para"]["spaceAfter"], 9.0);
+ assert_eq!(a["characterStyle"], "Emphasis");
+ assert_eq!(a["chars"]["underline"], true);
+ }
+
+ #[test]
+ fn character_capture_source_remains_sparse_and_follows_style_edits() {
+ let (mut s, story) = setup("First\nSecond");
+ select(&mut s, &story, 0, 5);
+ s.execute("type.char", &json!({"underline": true})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Emphasis", "fromSelection": true})).unwrap();
+ s.execute("style.character.apply", &json!({"name": "Emphasis"})).unwrap();
+ s.execute("style.character.edit", &json!({"name": "Emphasis", "chars": {"underline": false}})).unwrap();
+ assert_eq!(attrs(&mut s)["chars"]["underline"], false);
+ assert!(s.doc().unwrap().doc.styles.char_style("Emphasis").unwrap().chars.size.is_none());
+ s.execute("style.paragraph.edit", &json!({"name": designcraft_doc::BASIC_PARAGRAPH, "chars": {"size": 20}})).unwrap();
+ assert_eq!(attrs(&mut s)["chars"]["size"], 20.0);
+ }
+
+ #[test]
+ fn paragraph_selection_excludes_the_next_paragraph_at_its_start() {
+ let (mut s, story) = setup("é\nNext");
+ select(&mut s, &story, 0, 3);
+ s.execute("style.paragraph.create", &json!({"name": "Header"})).unwrap();
+ s.execute("style.paragraph.apply", &json!({"name": "Header", "clearOverrides": true})).unwrap();
+ select(&mut s, &story, 3, 4);
+ assert_eq!(attrs(&mut s)["paragraphStyle"], designcraft_doc::BASIC_PARAGRAPH);
+ select(&mut s, &story, 0, 2);
+ assert_eq!(attrs(&mut s)["paragraphStyle"], "Header");
+ }
+
+ #[test]
+ fn clearing_a_partial_selection_preserves_character_overrides_outside_it() {
+ let (mut s, story) = setup("First Second");
+ select(&mut s, &story, 0, 12);
+ s.execute("type.char", &json!({"size": 18})).unwrap();
+ select(&mut s, &story, 0, 5);
+ s.execute("style.paragraph.apply", &json!({"name": designcraft_doc::BASIC_PARAGRAPH, "clearOverrides": true})).unwrap();
+ assert_ne!(attrs(&mut s)["chars"]["size"], 18.0);
+ select(&mut s, &story, 6, 12);
+ assert_eq!(attrs(&mut s)["chars"]["size"], 18.0);
+ }
+ }
+
+ /// The `group` (`chars`, `para`) object of command `cmd`'s params as attributes; a bad attribute
+ /// is that command's parameter error, naming the group.
+ fn attrs<T: Default>(cmd: &str, group: &str, p: &Value, set: impl Fn(&mut T, &str, &Value) -> std::result::Result<(), String>) -> Result<T> {
+ let mut a = T::default();
+ match p.get(group) {
+ None | Some(Value::Null) => {}
+ Some(Value::Object(o)) => {
+ for (k, v) in o {
+ set(&mut a, k, v).map_err(|e| bad(cmd, format!("{group}: {e}")))?;
+ }
+ }
+ Some(_) => return Err(bad(cmd, format!("{group} must be an object of attributes"))),
+ }
+ Ok(a)
+ }
+
+ pub(super) fn redefine(s: &mut Session, p: &Value, paragraph: bool) -> Result<Value> {
+ let command = if paragraph { "style.paragraph.redefine" } else { "style.character.redefine" };
+ let targets = crate::cmd::text::format_targets_pub(s);
+ let target = targets.first().ok_or_else(|| bad(command, "select text using the style to redefine"))?;
+ let state = s.doc()?;
+ let story = state.doc.text_story(target.story, target.cell).ok_or(designcraft_doc::DocError::NoStory(target.story))?;
+ let pf = story.paras.get(story.para_at(target.range.start)).ok_or_else(|| bad(command, "no paragraph at the selection"))?;
+ let cf = crate::cmd::text::effective_char_format(s, target)?;
+ let selected = if paragraph { &pf.style } else { &cf.style };
+ let name = str_param(p, "name").unwrap_or(selected).to_string();
+ if name != *selected || name == if paragraph { designcraft_doc::NO_PARA_STYLE } else { designcraft_doc::NO_CHAR_STYLE } {
+ return Err(bad(command, "select text using the named style; the no-style entry cannot be redefined"));
+ }
+ let (base_para, base_chars) = state.doc.styles.resolve_para_style(&pf.style);
+ let (resolved_para, paragraph_chars) = state.doc.styles.resolve_para(pf);
+ let para_changes = base_para.delta(&resolved_para);
+ let mut current = if paragraph {
+ paragraph_chars.clone()
+ } else {
+ state.doc.styles.resolve_char(&paragraph_chars, &designcraft_doc::CharFormat { style: name.clone(), over: CharAttrs::default() })
+ };
+ let inherited = if paragraph { base_chars } else { current.clone() };
+ // A named character style is an intentional layer, not a paragraph override to absorb.
+ current.apply(&cf.over);
+ let char_changes = inherited.delta(&current);
+ let result = s.edit(|d, _| {
+ if paragraph {
+ let style = d.styles_mut().para_mut(&name).ok_or_else(|| bad(command, "paragraph style no longer exists"))?;
+ style.para.merge(&para_changes);
+ style.chars.merge(&char_changes);
+ } else {
+ let style =
+ d.styles_mut().character.iter_mut().find(|st| st.name == name).ok_or_else(|| bad(command, "character style no longer exists"))?;
+ style.chars.merge(&char_changes);
+ }
+ let styles = d.styles.clone();
+ for target in &targets {
+ let Some(story) = d.text_story_mut(target.story, target.cell) else { continue };
+ // At a character-style caret, the sampled format belongs to the containing run
+ // (the preceding run at a boundary). Normalize that source run too, otherwise its
+ // old local values would mask the next edit of the redefined style.
+ let mut selected_range = target.range.clone();
+ if !paragraph && selected_range.is_empty() {
+ let caret = selected_range.start;
+ let mut start = 0usize;
+ for run in &story.chars {
+ let end = start.saturating_add(run.len).min(story.len());
+ if caret < end || (caret == end && caret > start) {
+ selected_range = start..end;
+ break;
+ }
+ start = end;
+ }
+ }
+ let end = if selected_range.is_empty() { selected_range.start } else { selected_range.end.saturating_sub(1) };
+ let (first, last) = (story.para_at(selected_range.start), story.para_at(end));
+ for (index, range) in story.para_ranges().into_iter().enumerate().take(last.saturating_add(1)).skip(first) {
+ let Some(pf) = story.paras.get_mut(index) else { continue };
+ if paragraph && pf.style != name {
+ continue;
+ }
+ if paragraph {
+ let (pp, cp) = styles.resolve_para(pf);
+ let (base_p, base_c) = styles.resolve_para_style(&name);
+ pf.para = base_p.delta(&pp);
+ pf.chars = base_c.delta(&cp);
+ }
+ let (_, base) = styles.resolve_para(pf);
+ let end = range.end.saturating_add(1).min(story.len());
+ let range = if paragraph { range.start..end } else { range.start.max(selected_range.start)..end.min(selected_range.end) };
+ story.format_chars(range, |format| {
+ if !paragraph && format.style != name {
+ return;
+ }
+ let mut inherited = base.clone();
+ inherited.apply(&styles.char_style_attrs(&format.style));
+ let resolved = styles.resolve_char(&base, format);
+ format.over = inherited.delta(&resolved);
+ });
+ }
+ }
+ Ok(json!({"name":name}))
+ });
+ if result.is_ok() {
+ s.typing_format = None;
+ }
+ result
+ }
+
+ /// Apply paragraph style `name` over `r` in one story; `clear` drops overrides instead of keeping
+ /// only those that differ from the style (`resolved` is the style's paragraph and character attributes).
+ fn apply_para_in_story(
+ st: &mut designcraft_doc::Story,
+ r: &std::ops::Range<usize>,
+ name: &str,
+ clear: bool,
+ resolved: (&designcraft_doc::ParaProps, &designcraft_doc::CharProps),
+ styles: &designcraft_doc::Styles,
+ ) {
+ let (style_para, style_chars) = resolved;
+ // Text selections are half-open: a selection ending at the next paragraph's
+ // start must not apply a style to that paragraph too.
+ let end = if r.is_empty() { r.start } else { r.end.saturating_sub(1) };
+ let (first, last) = (st.para_at(r.start), st.para_at(end));
+ st.format_paras(r.start..end, |f| {
+ f.style = name.to_string();
+ if clear {
+ f.para = ParaAttrs::default();
+ f.chars = CharAttrs::default();
+ } else {
+ f.para.retain_differences(style_para);
+ f.chars.retain_differences(style_chars);
+ }
+ });
+ for (pi, range) in st.para_ranges().into_iter().enumerate().take(last.saturating_add(1)).skip(first) {
+ let Some(pf) = st.paras.get(pi) else { continue };
+ let (_, base) = styles.resolve_para(pf);
+ let end = range.end.saturating_add(1).min(st.len());
+ let range = if clear && !r.is_empty() { range.start.max(r.start)..end.min(r.end) } else { range.start..end };
+ st.format_chars(range, |f| {
+ if clear {
+ f.over = CharAttrs::default();
+ } else {
+ let mut inherited = base.clone();
+ inherited.apply(&styles.char_style_attrs(&f.style));
+ f.over.retain_differences(&inherited);
+ }
+ });
+ }
+ }
+
+ pub(super) fn apply_para(s: &mut Session, p: &Value) -> Result<Value> {
+ let name = str_param(p, "name").ok_or_else(|| bad("style.paragraph.apply", "missing name"))?.to_string();
+ let clear = p.get("clearOverrides").and_then(Value::as_bool).unwrap_or(false);
+ if s.doc()?.doc.styles.para(&name).is_none() {
+ return Err(bad("style.paragraph.apply", format!("no paragraph style `{name}`")));
+ }
+ let targets = crate::cmd::text::format_targets_pub(s);
+ s.edit(|d, _| {
+ let styles = d.styles.clone();
+ let (style_para, style_chars) = styles.resolve_para_style(&name);
+ for t in &targets {
+ if let Some(st) = d.text_story_mut(t.story, t.cell) {
+ apply_para_in_story(st, &t.range, &name, clear, (&style_para, &style_chars), &styles);
+ }
+ }
+ ok()
+ })
+ }
+
+ pub(super) fn apply_char(s: &mut Session, p: &Value) -> Result<Value> {
+ let name = str_param(p, "name").ok_or_else(|| bad("style.character.apply", "missing name"))?.to_string();
+ if s.doc()?.doc.styles.char_style(&name).is_none() {
+ return Err(bad("style.character.apply", format!("no character style `{name}`")));
+ }
+ let targets = crate::cmd::text::format_targets_pub(s);
+ s.edit(|d, _| {
+ let styles = d.styles.clone();
+ for t in &targets {
+ if let Some(st) = d.text_story_mut(t.story, t.cell) {
+ for (pi, range) in st.para_ranges().into_iter().enumerate() {
+ let range = range.start.max(t.range.start)..range.end.saturating_add(1).min(st.len()).min(t.range.end);
+ if range.is_empty() {
+ continue;
+ }
+ let Some(pf) = st.paras.get(pi) else { continue };
+ let (_, mut inherited) = styles.resolve_para(pf);
+ inherited.apply(&styles.char_style_attrs(&name));
+ st.format_chars(range, |f| {
+ f.style = name.clone();
+ f.over.retain_differences(&inherited);
+ });
+ }
+ }
+ }
+ ok()
+ })
+ }
+
+ /// In a style, `startAt: null` is Continue from Previous Number: it is stored as an explicit
+ /// "continue" so it also overrides a Start At the style would inherit.
+ fn continue_numbering(p: Option<&Value>, para: &mut ParaAttrs) {
+ let explicit =
+ p.and_then(Value::as_object).is_some_and(|o| o.iter().any(|(k, v)| v.is_null() && k.replace('_', "").eq_ignore_ascii_case("startAt")));
+ if explicit {
+ para.start_at = Some(None);
+ }
+ }
+
+ pub(super) fn create_para(s: &mut Session, p: &Value) -> Result<Value> {
+ let base = str_param(p, "name").unwrap_or("Paragraph Style 1").to_string();
++/// The style `p[key]` names: none when absent or null; anything but a name is refused.
++fn style_name_param(cmd: &str, p: &Value, key: &str) -> Result<Option<String>> {
++ match p.get(key) {
++ None | Some(Value::Null) => Ok(None),
++ Some(Value::String(n)) => Ok(Some(n.clone())),
++ Some(_) => Err(bad(cmd, format!("`{key}` is a style name or null"))),
++ }
++}
++
++fn create_para(s: &mut Session, p: &Value) -> Result<Value> {
++ let base = str_param(p, "name").unwrap_or("Paragraph Style 1").to_string();
++ let based_on = style_name_param("style.paragraph.create", p, "basedOn")?;
++ let next = style_name_param("style.paragraph.create", p, "nextStyle")?;
+ let mut para: ParaAttrs =
+ attrs("style.paragraph.create", "para", p, |a: &mut ParaAttrs, k, v| a.set_json_over(k, v, &designcraft_doc::ParaProps::default()))?;
+ continue_numbering(p.get("para"), &mut para);
+ explicit_default_kinsoku(&mut para, p.get("para"));
+ check_grep_styles("style.paragraph.create", &para)?;
+ let mut chars: CharAttrs = attrs("style.paragraph.create", "chars", p, |a: &mut CharAttrs, k, v| a.set_json(k, v))?;
+ // Validate caller-supplied fills, not selection fills retained after a swatch is deleted.
+ crate::cmd::text::validate_char_fill(&s.doc()?.doc, &chars, "style.paragraph.create")?;
+ if p.get("fromSelection").and_then(Value::as_bool).unwrap_or(false)
+ && let Ok(cur) = s.execute("type.selectionAttrs", &json!({}))
+ && !cur.is_null()
+ {
+ if let Ok(pp) = serde_json::from_value::<designcraft_doc::ParaProps>(cur["para"].clone()) {
+ let mut full = ParaProps_to_attrs(&pp);
+ full.merge(&para);
+ para = full;
+ }
+ if let Ok(cp) = serde_json::from_value::<designcraft_doc::CharProps>(cur["chars"].clone()) {
+ let mut full = CharProps_to_attrs(&cp);
+ full.merge(&chars);
+ chars = full;
+ }
+ }
- let based_on = str_param(p, "basedOn").map(str::to_string);
- let next = str_param(p, "nextStyle").map(str::to_string);
+ s.edit(|d, _| {
+ let name = Styles::unique_name(|n| d.styles.para(n).is_some(), &base);
+ if let Some(b) = &based_on
+ && d.styles.para(b).is_none()
+ {
+ return Err(bad("style.paragraph.create", format!("no style `{b}`")));
+ }
++ // Next Style: a style of the document, or this one.
++ if let Some(n) = &next
++ && *n != name
++ && d.styles.para(n).is_none()
++ {
++ return Err(bad("style.paragraph.create", format!("no style `{n}`")));
++ }
+ d.styles_mut().paragraph.push(ParagraphStyle { name: name.clone(), based_on, next_style: next, para, chars, shortcut: String::new() });
+ Ok(json!({"name": name}))
+ })
+ }
+
+ /// `kinsoku: null` sets the composer's default kinsoku rules, also over a Based On style's set.
+ /// For the other attributes `null` leaves the style's value as it is.
+ fn explicit_default_kinsoku(para: &mut ParaAttrs, given: Option<&Value>) {
+ if given.and_then(|o| o.get("kinsoku")).is_some_and(Value::is_null) {
+ para.kinsoku = Some(None);
+ }
+ }
+
+ /// The compile error of the first GREP style in `a` whose pattern can't compile.
+ pub(crate) fn grep_style_error(a: &ParaAttrs) -> Option<String> {
+ a.grep_styles
+ .iter()
+ .flatten()
+ .filter(|g| !g.pattern.is_empty())
+ .find_map(|g| designcraft_compose::grep::Grep::new(&g.pattern, Default::default()).err().map(|e| format!("{e} (pattern {:?})", g.pattern)))
+ }
+
+ /// Rejects GREP styles a command would set with a pattern that can't compile.
+ pub(crate) fn check_grep_styles(cmd: &str, a: &ParaAttrs) -> Result<()> {
+ grep_style_error(a).map_or(Ok(()), |e| Err(bad(cmd, e)))
+ }
+
+ /// One warning for each paragraph style or paragraph whose GREP style pattern can't compile.
+ /// Such a GREP style stays in the document and composition skips it.
+ pub(crate) fn grep_style_warnings(d: &designcraft_doc::Document) -> Vec<String> {
+ let mut out: Vec<String> = d
+ .styles
+ .paragraph
+ .iter()
+ .filter_map(|st| grep_style_error(&st.para).map(|e| format!("paragraph style {:?}: GREP style not applied: {e}", st.name)))
+ .collect();
+ for st in d.stories.values() {
+ for (i, pf) in st.paras.iter().enumerate() {
+ if let Some(e) = grep_style_error(&pf.para) {
+ out.push(format!("story {} paragraph {}: GREP style not applied: {e}", st.id.0, i + 1));
+ }
+ }
+ }
+ out
+ }
+
+ #[allow(non_snake_case)]
+ fn ParaProps_to_attrs(p: &designcraft_doc::ParaProps) -> ParaAttrs {
+ designcraft_doc::ParaProps::common([p])
+ }
+
+ #[allow(non_snake_case)]
+ fn CharProps_to_attrs(p: &designcraft_doc::CharProps) -> CharAttrs {
+ designcraft_doc::CharProps::common([p])
+ }
+
+ pub(super) fn edit_para(s: &mut Session, p: &Value) -> Result<Value> {
+ let name = str_param(p, "name").ok_or_else(|| bad("style.paragraph.edit", "missing name"))?.to_string();
+ let chars: CharAttrs = attrs("style.paragraph.edit", "chars", p, |a: &mut CharAttrs, k, v| a.set_json(k, v))?;
+ crate::cmd::text::validate_char_fill(&s.doc()?.doc, &chars, "style.paragraph.edit")?;
+ let rename = str_param(p, "rename").map(str::trim).filter(|n| *n != name).map(str::to_string);
+ let based = p.get("basedOn").cloned();
++ let next = p.get("nextStyle").cloned();
++ let reset = p.get("resetToBase").and_then(Value::as_bool).unwrap_or(false);
++ for (key, v) in [("basedOn", &based), ("nextStyle", &next)] {
++ if v.as_ref().is_some_and(|v| !v.is_string() && !v.is_null()) {
++ return Err(bad("style.paragraph.edit", format!("`{key}` must be a style name or null")));
++ }
++ }
+ s.edit(|d, _| {
- if let Some(Value::String(b)) = &based
- && d.styles.para_based_on_cycles(&name, b)
++ if let Some(Value::String(b)) = &based {
++ if d.styles.para(b).is_none() {
++ return Err(bad("style.paragraph.edit", format!("no style `{b}`")));
++ }
++ if d.styles.para_based_on_cycles(&name, b) {
++ return Err(bad("style.paragraph.edit", "based-on would create a cycle"));
++ }
++ }
++ if let Some(Value::String(n)) = &next
++ && d.styles.para(n).is_none()
+ {
- return Err(bad("style.paragraph.edit", "based-on would create a cycle"));
++ return Err(bad("style.paragraph.edit", format!("no style `{n}`")));
++ }
++ // Reset To Base: what the style set of its own goes before the edits apply.
++ if reset {
++ let st = d.styles_mut().para_mut(&name).ok_or_else(|| bad("style.paragraph.edit", format!("no style `{name}`")))?;
++ st.para = ParaAttrs::default();
++ st.chars = CharAttrs::default();
++ }
++ // A new Based On first, so the fields below resolve over the new parent.
++ if based.is_some() {
++ let st = d.styles_mut().para_mut(&name).ok_or_else(|| bad("style.paragraph.edit", format!("no style `{name}`")))?;
++ match &based {
++ Some(Value::String(b)) => st.based_on = Some(b.clone()),
++ Some(Value::Null) => st.based_on = None,
++ _ => {}
++ }
+ }
+ if let Some(n) = &rename {
+ if n.is_empty() || n.starts_with('[') {
+ return Err(bad("style.paragraph.edit", format!("can't rename to `{n}`")));
+ }
+ if d.styles.para(n).is_some() {
+ return Err(bad("style.paragraph.edit", format!("a paragraph style named `{n}` already exists")));
+ }
+ }
+ // A rule object changes only the rule fields it names, over the style's resolved rule.
+ let (current, _) = d.styles.resolve_para_style(&name);
+ let mut para: ParaAttrs = attrs("style.paragraph.edit", "para", p, |a: &mut ParaAttrs, k, v| a.set_json_over(k, v, &current))?;
+ continue_numbering(p.get("para"), &mut para);
+ explicit_default_kinsoku(&mut para, p.get("para"));
+ check_grep_styles("style.paragraph.edit", &para)?;
+ let st = d.styles_mut().para_mut(&name).ok_or_else(|| bad("style.paragraph.edit", format!("no style `{name}`")))?;
+ st.para.merge(&para);
+ st.chars.merge(&chars);
- match based {
- Some(Value::String(b)) => st.based_on = Some(b),
- Some(Value::Null) => st.based_on = None,
++ match next {
++ Some(Value::String(n)) => st.next_style = Some(n),
++ Some(Value::Null) => st.next_style = None,
+ _ => {}
+ }
+ if let Some(n) = rename.clone() {
+ // Every use: other styles, stories, table cells, footnotes, object styles.
+ rename_style(d, true, &name, &n);
+ }
+ ok()
+ })
+ }
+
+ /// Rename a paragraph or character style everywhere it's used; its Export Tagging follows.
+ fn rename_style(d: &mut designcraft_doc::Document, para: bool, from: &str, to: &str) {
+ let st = d.styles_mut();
+ if para {
+ for s in &mut st.paragraph {
+ if s.name == from {
+ s.name = to.to_string();
+ }
+ }
+ } else {
+ for s in &mut st.character {
+ if s.name == from {
+ s.name = to.to_string();
+ }
+ }
+ }
+ // An entry already under `to` belongs to no style (names are unique), so it never survives.
+ st.export_tags.remove(&export_tag_key(para, to));
+ if let Some(tag) = st.export_tags.remove(&export_tag_key(para, from)) {
+ st.export_tags.insert(export_tag_key(para, to), tag);
+ }
+ redirect_style_refs(d, para, from, to);
+ }
+
+ /// The `Styles::export_tags` key of a paragraph (`para`) or character style.
+ pub(super) fn export_tag_key(para: bool, name: &str) -> String {
+ format!("{}:{name}", if para { "p" } else { "c" })
+ }
+
+ /// Point every reference to style `from` at `to`, except the style's own registry entry (its
+ /// `name` field) — shared by renaming (which also updates the entry's name) and deletion (which
+ /// instead removes the entry, after its former uses point at the replacement).
+ fn redirect_style_refs(d: &mut designcraft_doc::Document, para: bool, from: &str, to: &str) {
+ let rename = |r: &mut String| {
+ if r == from {
+ *r = to.to_string();
+ }
+ };
+ let st = d.styles_mut();
+ // A style is never based on itself: when `to` was based on `from`, it takes `from`'s parent.
+ let parent_of = |based_on: Option<&String>| based_on.filter(|b| b.as_str() != to).cloned();
+ if para {
+ let from_parent = parent_of(st.paragraph.iter().find(|x| x.name == from).and_then(|x| x.based_on.as_ref()));
+ for s in &mut st.paragraph {
+ if s.based_on.as_deref() == Some(from) {
+ s.based_on = if s.name == to { from_parent.clone() } else { Some(to.to_string()) };
+ }
+ if s.next_style.as_deref() == Some(from) {
+ s.next_style = Some(to.to_string());
+ }
+ }
+ let objects = st.object.iter_mut().map(|o| &mut o.paragraph_style);
+ for r in objects.chain(st.cell.iter_mut().map(|c| &mut c.paragraph_style)) {
+ if r.as_deref() == Some(from) {
+ *r = Some(to.to_string());
+ }
+ }
+ rename(&mut st.default_paragraph);
+ let (fo, eo) = (&mut d.footnote_options, &mut d.endnote_options);
+ [&mut fo.para_style, &mut eo.para_style, &mut eo.heading_style].into_iter().for_each(rename);
+ d.toc.iter_mut().flat_map(|t| t.entries.iter_mut().map(|e| &mut e.style)).for_each(rename);
+ for t in d.toc.iter_mut() {
+ let formats = t.entries.iter_mut().map(|e| &mut e.entry_style).chain([&mut t.title_style]);
+ for r in formats.filter(|r| r.as_deref() == Some(from)) {
+ *r = Some(to.to_string());
+ }
+ }
+ if let designcraft_doc::EpubSplit::Style(n) = &mut d.settings.epub_split {
+ rename(n);
+ }
+ } else {
+ let from_parent = parent_of(st.character.iter().find(|x| x.name == from).and_then(|x| x.based_on.as_ref()));
+ for s in &mut st.character {
+ if s.based_on.as_deref() == Some(from) {
+ s.based_on = if s.name == to { from_parent.clone() } else { Some(to.to_string()) };
+ }
+ }
+ for s in &mut st.paragraph {
+ rename_char_refs(&mut s.para, from, to);
+ }
+ rename(&mut st.default_character);
+ rename(&mut d.footnote_options.ref_char_style);
+ }
+ // The table of contents' character styles ([None] is stored as no style).
+ if !para && let Some(toc) = d.toc.as_mut() {
+ for e in &mut toc.entries {
+ for n in [&mut e.page_number_style, &mut e.separator_style] {
+ if n.as_deref() == Some(from) {
+ *n = Some(to.to_string()).filter(|t| t != designcraft_doc::NO_CHAR_STYLE);
+ }
+ }
+ }
+ }
+ for sid in d.stories.keys().copied().collect::<Vec<_>>() {
+ let Some(story) = d.story_mut(sid) else { continue };
+ story.for_each_text_mut(&mut |st| {
+ if para {
+ for f in st.paras.iter_mut().filter(|f| f.style == from) {
+ f.style = to.to_string();
+ }
+ } else {
+ for r in st.chars.iter_mut().filter(|r| r.format.style == from) {
+ r.format.style = to.to_string();
+ }
+ for f in &mut st.paras {
+ rename_char_refs(&mut f.para, from, to);
+ }
+ }
+ st.rev = st.rev.wrapping_add(1);
+ });
+ }
+ }
+
+ /// Point the nested, nested line and GREP styles, and the drop cap style, of paragraph
+ /// attributes at a renamed (or deleted, pointed at its replacement) character style.
+ fn rename_char_refs(p: &mut ParaAttrs, from: &str, to: &str) {
+ let names = p.nested_styles.iter_mut().flatten().map(|n| &mut n.style);
+ let names = names.chain(p.nested_line_styles.iter_mut().flatten().map(|n| &mut n.style));
+ let names = names.chain(p.drop_cap_style.iter_mut());
+ for n in names.chain(p.grep_styles.iter_mut().flatten().map(|g| &mut g.style)) {
+ if n == from {
+ *n = to.to_string();
+ }
+ }
+ }
+
+ pub(super) fn group_styles(s: &mut Session, p: &Value) -> Result<Value> {
+ let para = match str_param(p, "kind").unwrap_or("paragraph") {
+ "paragraph" => true,
+ "character" => false,
+ k => return Err(bad("style.group", format!("unknown kind `{k}`"))),
+ };
+ let names: Vec<String> =
+ p.get("names").and_then(Value::as_array).map(|a| a.iter().filter_map(|v| v.as_str().map(str::to_string)).collect()).unwrap_or_default();
+ let group = str_param(p, "group").unwrap_or("").trim_matches('/').to_string();
+ s.edit(|d, _| {
+ let mut renamed = serde_json::Map::new();
+ for n in &names {
+ if n.starts_with('[') {
+ return Err(bad("style.group", format!("`{n}` is built in")));
+ }
+ let exists = if para { d.styles.para(n).is_some() } else { d.styles.character.iter().any(|c| c.name == *n) };
+ if !exists {
+ return Err(bad("style.group", format!("no style `{n}`")));
+ }
+ let base = n.rsplit('/').next().unwrap_or(n);
+ let mut to = if group.is_empty() { base.to_string() } else { format!("{group}/{base}") };
+ let taken = |d: &designcraft_doc::Document, x: &str| {
+ if para { d.styles.para(x).is_some() } else { d.styles.character.iter().any(|c| c.name == x) }
+ };
+ if to != *n {
+ to = Styles::unique_name(|x| taken(d, x), &to);
+ rename_style(d, para, n, &to);
+ renamed.insert(n.clone(), json!(to));
+ }
+ }
+ Ok(json!({"renamed": renamed}))
+ })
+ }
+
+ pub(super) fn delete_para(s: &mut Session, p: &Value) -> Result<Value> {
+ delete_style(s, p, true)
+ }
+
+ pub(super) fn delete_char(s: &mut Session, p: &Value) -> Result<Value> {
+ delete_style(s, p, false)
+ }
+
+ /// Delete a paragraph (`para`) or character style; everything that used it uses `replaceWith`
+ /// (default [Basic Paragraph] or [None]) instead, in one undo step.
+ fn delete_style(s: &mut Session, p: &Value, para: bool) -> Result<Value> {
+ let (id, default) =
+ if para { ("style.paragraph.delete", designcraft_doc::BASIC_PARAGRAPH) } else { ("style.character.delete", designcraft_doc::NO_CHAR_STYLE) };
+ let name = str_param(p, "name").filter(|n| !n.is_empty()).ok_or_else(|| bad(id, "missing name"))?.to_string();
+ let repl = str_param(p, "replaceWith").unwrap_or(default).to_string();
+ if name.starts_with('[') {
+ return Err(bad(id, "built-in styles can't be deleted"));
+ }
+ if repl == name {
+ return Err(bad(id, "`replaceWith` can't be the deleted style"));
+ }
+ s.edit(|d, _| {
+ let st = &d.styles;
+ let exists = |n: &str| if para { st.para(n).is_some() } else { n == designcraft_doc::NO_CHAR_STYLE || st.char_style(n).is_some() };
+ if !exists(&name) {
+ return Err(bad(id, format!("no style `{name}`")));
+ }
+ if !exists(&repl) {
+ return Err(bad(id, format!("no style `{repl}` to replace it with")));
+ }
+ // The deleted style's children are based on the replacement, or on the deleted style's
+ // own parent when the replacement descends from it (so no based-on chain loops).
+ let (own_parent, descends) = if para {
+ (st.para(&name).and_then(|x| x.based_on.clone()), st.para_based_on_cycles(&name, &repl))
+ } else {
+ (st.char_style(&name).and_then(|x| x.based_on.clone()), st.char_based_on_cycles(&name, &repl))
+ };
+ let parent = if descends {
+ own_parent.filter(|b| *b != name)
+ } else if repl == designcraft_doc::NO_CHAR_STYLE || repl == designcraft_doc::NO_PARA_STYLE {
+ None
+ } else {
+ Some(repl.clone())
+ };
+ let st = d.styles_mut();
+ let based = if para {
+ st.paragraph.retain(|x| x.name != name);
+ st.paragraph.iter_mut().map(|x| &mut x.based_on).collect::<Vec<_>>()
+ } else {
+ st.character.retain(|x| x.name != name);
+ st.character.iter_mut().map(|x| &mut x.based_on).collect()
+ };
+ for b in based.into_iter().filter(|b| b.as_deref() == Some(name.as_str())) {
+ *b = parent.clone();
+ }
+ // The replacement keeps its own Export Tagging.
+ st.export_tags.remove(&export_tag_key(para, &name));
+ // Every other use: styles, stories, table cells, nested and GREP styles, notes, defaults.
+ redirect_style_refs(d, para, &name, &repl);
+ ok()
+ })
+ }
+
+ pub(super) fn create_char(s: &mut Session, p: &Value) -> Result<Value> {
+ let base = str_param(p, "name").unwrap_or("Character Style 1").to_string();
+ let mut chars: CharAttrs = attrs("style.character.create", "chars", p, |a: &mut CharAttrs, k, v| a.set_json(k, v))?;
+ // Validate caller-supplied fills; captured formatting may retain a deleted swatch name.
+ crate::cmd::text::validate_char_fill(&s.doc()?.doc, &chars, "style.character.create")?;
+ if p.get("fromSelection").and_then(Value::as_bool).unwrap_or(false)
+ && let Some(target) = crate::cmd::text::format_targets_pub(s).first()
+ {
+ let st = s.doc()?;
+ // Match paragraph fromSelection's first-character/caret policy, but keep paragraph
+ // attributes inherited instead of freezing the fully resolved character properties.
+ let format = crate::cmd::text::effective_char_format(s, target)?;
+ let mut captured = st.doc.styles.char_style_attrs(&format.style);
+ captured.merge(&format.over);
+ // Replay the explicit fields so null clears a captured value rather than looking absent.
+ if let Some(overrides) = p.get("chars").and_then(Value::as_object) {
+ for (key, value) in overrides {
+ captured.set_json(key, value).map_err(|e| bad("style.character.create", format!("chars: {e}")))?;
+ }
+ }
+ chars = captured;
+ }
+ // Based on [None] is based on nothing.
- let based_on = str_param(p, "basedOn").filter(|b| *b != designcraft_doc::NO_CHAR_STYLE).map(str::to_string);
++ let based_on = style_name_param("style.character.create", p, "basedOn")?.filter(|b| b != designcraft_doc::NO_CHAR_STYLE);
+ s.edit(|d, _| {
+ if let Some(b) = &based_on
+ && d.styles.char_style(b).is_none()
+ {
+ return Err(bad("style.character.create", format!("no character style `{b}`")));
+ }
+ let name = Styles::unique_name(|n| d.styles.char_style(n).is_some(), &base);
+ d.styles_mut().character.push(CharacterStyle { name: name.clone(), based_on, chars, shortcut: String::new() });
+ Ok(json!({"name": name}))
+ })
+ }
+
+ pub(super) fn edit_char(s: &mut Session, p: &Value) -> Result<Value> {
+ let name = str_param(p, "name").ok_or_else(|| bad("style.character.edit", "missing name"))?.to_string();
+ if name == designcraft_doc::NO_CHAR_STYLE {
+ return Err(bad("style.character.edit", "[None] can't be edited"));
+ }
+ let chars: CharAttrs = attrs("style.character.edit", "chars", p, |a: &mut CharAttrs, k, v| a.set_json(k, v))?;
+ crate::cmd::text::validate_char_fill(&s.doc()?.doc, &chars, "style.character.edit")?;
+ // `null` unsets an attribute (the style no longer sets it).
+ let unset: Vec<String> = p
+ .get("chars")
+ .and_then(Value::as_object)
+ .map(|o| o.iter().filter(|(_, v)| v.is_null()).map(|(k, _)| k.clone()).collect())
+ .unwrap_or_default();
+ let rename = str_param(p, "rename").map(str::trim).filter(|n| *n != name).map(str::to_string);
+ let based: Option<Option<String>> = match p.get("basedOn") {
+ None => None,
+ Some(Value::Null) => Some(None),
+ Some(Value::String(b)) if b == designcraft_doc::NO_CHAR_STYLE => Some(None),
+ Some(Value::String(b)) => Some(Some(b.clone())),
+ Some(_) => return Err(bad("style.character.edit", "`basedOn` is a style name or null")),
+ };
+ s.edit(|d, _| {
+ if let Some(Some(b)) = &based {
+ if d.styles.char_style(b).is_none() {
+ return Err(bad("style.character.edit", format!("no character style `{b}`")));
+ }
+ if d.styles.char_based_on_cycles(&name, b) {
+ return Err(bad("style.character.edit", "based-on would create a cycle"));
+ }
+ }
+ if let Some(n) = &rename {
+ if n.is_empty() || n.starts_with('[') {
+ return Err(bad("style.character.edit", format!("can't rename to `{n}`")));
+ }
+ if d.styles.char_style(n).is_some() {
+ return Err(bad("style.character.edit", format!("a character style named `{n}` already exists")));
+ }
+ }
+ let st = d.styles_mut().char_style_mut(&name).ok_or_else(|| bad("style.character.edit", format!("no character style `{name}`")))?;
+ st.chars.merge(&chars);
+ for k in &unset {
+ st.chars.set_json(k, &Value::Null).map_err(|e| bad("style.character.edit", e))?;
+ }
+ if let Some(b) = based.clone() {
+ st.based_on = b;
+ }
+ if let Some(n) = &rename {
+ // Every use: other styles, stories, table cells, nested and GREP styles, footnotes.
+ rename_style(d, false, &name, n);
+ }
+ ok()
+ })
+ }
+
+ /// #777: the params descriptions name the attributes, and a wrong one is the command's error.
+ #[cfg(test)]
+ mod attribute_error_tests {
+ use super::*;
+ use crate::cmd::find_command;
+
+ #[test]
+ fn a_wrong_attribute_names_the_command_and_the_right_attribute() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let err = |s: &mut Session, id: &str, p: Value| s.execute(id, &p).unwrap_err().to_string();
+ assert_eq!(
+ err(&mut s, "style.paragraph.create", json!({"name": "H", "chars": {"font": "Source Sans 3"}})),
+ "invalid parameters for `style.paragraph.create`: chars: unknown attribute `font`; did you mean `fontFamily`?"
+ );
+ assert_eq!(
+ err(&mut s, "style.paragraph.create", json!({"name": "H", "para": {"spaceBefor": 6}})),
+ "invalid parameters for `style.paragraph.create`: para: unknown attribute `spaceBefor`; did you mean `spaceBefore`?"
+ );
+ assert!(
+ err(&mut s, "style.character.create", json!({"name": "C", "chars": {"font": "X"}}))
+ .starts_with("invalid parameters for `style.character.create`: chars:")
+ );
+ assert!(err(&mut s, "style.paragraph.create", json!({"name": "H", "chars": "bold"})).contains("chars must be an object of attributes"));
+ s.execute("style.paragraph.create", &json!({"name": "H", "chars": {"fontFamily": "Source Sans 3", "size": 14}})).unwrap();
+ assert!(
+ err(&mut s, "style.paragraph.edit", json!({"name": "H", "chars": {"font": "X"}}))
+ .starts_with("invalid parameters for `style.paragraph.edit`: chars:")
+ );
+ s.execute("style.character.create", &json!({"name": "C", "chars": {"fontStyle": "Bold"}})).unwrap();
+ assert!(
+ err(&mut s, "style.character.edit", json!({"name": "C", "chars": {"font": "X"}}))
+ .starts_with("invalid parameters for `style.character.edit`: chars:")
+ );
+ for id in ["style.paragraph.create", "style.paragraph.edit", "style.character.create", "style.character.edit"] {
+ let doc = find_command(id).unwrap().params;
+ assert!(doc.contains("as type.char names them: fontFamily"), "{id}: {doc}");
+ }
+ assert!(find_command("style.paragraph.create").unwrap().params.contains("as type.para names them: align"));
+ }
+ }
+
+ #[cfg(test)]
+ mod export_tag_tests {
+ use serde_json::json;
+
+ use crate::Session;
+
+ #[test]
+ fn export_tagging_shapes_epub_markup() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ s.execute("style.paragraph.create", &json!({"name": "Chapter Title", "chars": {"size": 24}})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Key Term", "chars": {"fontStyle": "Bold"}})).unwrap();
+ s.execute("style.exportTag", &json!({"style": "Chapter Title", "tag": "h1", "class": "chapter"})).unwrap();
+ s.execute("style.exportTag", &json!({"style": "Key Term", "character": true, "tag": "strong"})).unwrap();
+ assert!(s.execute("style.exportTag", &json!({"style": "Nope"})).is_err());
+ // Split Document is for paragraph styles; it alone keeps the tagging.
+ assert!(s.execute("style.exportTag", &json!({"style": "Key Term", "character": true, "split": true})).is_err());
+ s.execute("style.paragraph.create", &json!({"name": "Part"})).unwrap();
+ assert_eq!(s.execute("style.exportTag", &json!({"style": "Part", "split": true})).unwrap()["split"], true);
+ assert!(s.doc().unwrap().doc.styles.export_tag("Part", false).is_some_and(|t| t.split));
+ s.execute("style.exportTag", &json!({"style": "Part", "split": false})).unwrap();
+ assert!(s.doc().unwrap().doc.styles.export_tag("Part", false).is_none(), "an untouched tagging goes");
+ let r = s.execute("frame.create", &json!({"rect": [72, 72, 400, 300], "content": "text", "text": "Origins\nA word"})).unwrap();
+ let sid = r["story"].as_u64().unwrap();
+ s.execute("text.select", &json!({"story": sid, "anchor": 0, "focus": 0})).unwrap();
+ s.execute("style.paragraph.apply", &json!({"name": "Chapter Title"})).unwrap();
+ s.execute("text.select", &json!({"story": sid, "anchor": 10, "focus": 14})).unwrap();
+ s.execute("style.character.apply", &json!({"name": "Key Term"})).unwrap();
+ let html = s.execute("file.exportHtml", &json!({})).unwrap()["text"].as_str().unwrap().to_string();
+ assert!(html.contains("<h1 class=\"chapter\">Origins</h1>"), "{html}");
+ assert!(html.contains("<strong class=\"key-term\">word</strong>"), "{html}");
+ // Tagged PDF: a heading element and a paragraph element.
+ let r = s.execute("file.exportPdf", &json!({"tagged": true, "compressImages": false})).unwrap();
+ let pdf = crate::cmd::file::base64_decode(r["base64"].as_str().unwrap());
+ let text = String::from_utf8_lossy(&pdf);
+ assert!(text.contains("/S/H1") && text.contains("/S/P"), "structure elements");
+ assert!(designcraft_render::pdf_page_count(&pdf) == Some(1));
+ }
+
+ #[test]
+ fn export_tagging_follows_a_renamed_style_and_goes_with_a_deleted_one() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ s.execute("style.paragraph.create", &json!({"name": "Head"})).unwrap();
+ s.execute("style.paragraph.create", &json!({"name": "Body"})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Term"})).unwrap();
+ s.execute("style.exportTag", &json!({"style": "Head", "tag": "h2", "class": "head"})).unwrap();
+ s.execute("style.exportTag", &json!({"style": "Body", "tag": "p", "class": "body"})).unwrap();
+ s.execute("style.exportTag", &json!({"style": "Term", "character": true, "tag": "em", "class": "term"})).unwrap();
+ let tag = |s: &Session, name: &str, character: bool| {
+ s.doc().unwrap().doc.styles.export_tag(name, character).map(|t| (t.tag.clone(), t.class.clone()))
+ };
+ let pair = |t: &str, c: &str| Some((t.to_string(), c.to_string()));
+ // A rename onto another style's name is refused, so neither tagging is lost.
+ assert!(s.execute("style.paragraph.edit", &json!({"name": "Head", "rename": "Body"})).is_err());
+ assert_eq!((tag(&s, "Head", false), tag(&s, "Body", false)), (pair("h2", "head"), pair("p", "body")));
+
+ s.execute("style.paragraph.edit", &json!({"name": "Head", "rename": "Title"})).unwrap();
+ s.execute("style.character.edit", &json!({"name": "Term", "rename": "Word"})).unwrap();
+ assert_eq!(tag(&s, "Title", false), pair("h2", "head"));
+ assert_eq!(tag(&s, "Head", false), None);
+ assert_eq!(tag(&s, "Word", true), pair("em", "term"));
+ assert_eq!(tag(&s, "Term", true), None);
+ // Moving a style into a group renames it to Group/Name.
+ s.execute("style.group", &json!({"kind": "paragraph", "names": ["Title"], "group": "Heads"})).unwrap();
+ assert_eq!(tag(&s, "Heads/Title", false), pair("h2", "head"));
+ assert_eq!(tag(&s, "Title", false), None);
+
+ for _ in 0..3 {
+ s.execute("edit.undo", &json!({})).unwrap();
+ }
+ assert_eq!(tag(&s, "Head", false), pair("h2", "head"));
+ assert_eq!(tag(&s, "Title", false), None);
+ assert_eq!(tag(&s, "Term", true), pair("em", "term"));
+ assert_eq!(tag(&s, "Word", true), None);
+
+ // Deleting drops the deleted style's tagging; the replacement keeps its own.
+ s.execute("style.paragraph.delete", &json!({"name": "Head", "replaceWith": "Body"})).unwrap();
+ assert_eq!(tag(&s, "Head", false), None);
+ assert_eq!(tag(&s, "Body", false), pair("p", "body"));
+ s.execute("style.character.delete", &json!({"name": "Term"})).unwrap();
+ assert_eq!(tag(&s, "Term", true), None);
+ assert!(s.doc().unwrap().doc.styles.export_tags.keys().all(|k| k == "p:Body"));
+ }
+
+ #[test]
+ fn a_rename_onto_a_taken_name_says_so_and_a_trimmed_rename_drops_a_stale_tag() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ for (kind, a, b) in [("paragraph", "Head", "Body"), ("character", "Term", "Word")] {
+ s.execute(&format!("style.{kind}.create"), &json!({"name": a})).unwrap();
+ s.execute(&format!("style.{kind}.create"), &json!({"name": b})).unwrap();
+ let e = s.execute(&format!("style.{kind}.edit"), &json!({"name": a, "rename": b})).unwrap_err().to_string();
+ assert!(e.contains(&format!("a {kind} style named `{b}` already exists")), "{e}");
+ let e = s.execute(&format!("style.{kind}.edit"), &json!({"name": a, "rename": "[None]"})).unwrap_err().to_string();
+ assert!(e.contains("can't rename to `[None]`"), "{e}");
+ }
+ // An entry left under a name no style has doesn't attach to a style renamed onto it.
+ s.edit(|d, _| {
+ d.styles_mut()
+ .export_tags
+ .insert("p:Title".into(), designcraft_doc::ExportTag { tag: "h6".into(), class: "stale".into(), ..Default::default() });
+ Ok(())
+ })
+ .unwrap();
+ s.execute("style.paragraph.edit", &json!({"name": "Head", "rename": " Title "})).unwrap();
+ let st = &s.doc().unwrap().doc.styles;
+ assert!(st.para("Title").is_some(), "the new name is trimmed");
+ assert_eq!(st.export_tag("Title", false), None);
+ }
+ }
+
+ #[cfg(test)]
+ mod cjk_tests {
+ use super::*;
+ #[test]
+ fn cjk_composite_font_command_invalidates_layout_and_undo_restores_it() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let r = s.execute("frame.create", &json!({"rect": [0, 0, 300, 150], "content": "text", "text": "AB"})).unwrap();
+ let sid = designcraft_doc::StoryId(r["story"].as_u64().unwrap());
+ let definition = |scale| json!({"name": "Mixed", "entries": [{"family": "Source Serif 4", "relativeSize": scale}]});
+ s.execute("style.compositeFont.set", &definition(1.0)).unwrap();
+ s.execute("text.select", &json!({"story": sid.0, "anchor": 0, "focus": 2})).unwrap();
+ s.execute("type.char", &json!({"fontFamily": "Mixed", "leadingAki": 0.25, "jidori": 4})).unwrap();
+ let old = s.cache.get(&s.doc().unwrap().doc, sid, None);
+ s.execute("style.compositeFont.set", &definition(2.0)).unwrap();
+ let new = s.cache.get(&s.doc().unwrap().doc, sid, None);
+ assert!(!std::sync::Arc::ptr_eq(&old, &new));
+ assert!(new.frames[0].lines[0].end_x > old.frames[0].lines[0].end_x);
+ s.execute("edit.undo", &json!({})).unwrap();
+ let restored = s.cache.get(&s.doc().unwrap().doc, sid, None);
+ assert_eq!(old.frames[0].lines[0].end_x, restored.frames[0].lines[0].end_x);
+ assert!(s.execute("style.compositeFont.set", &definition(-1.0)).is_err());
+ }
+ }
+
+ #[cfg(test)]
+ mod delete_tests {
+ use designcraft_doc::{CellStyle, ObjectStyle, StoryId, Toc, TocEntry};
+ use serde_json::json;
+
+ use crate::Session;
+
+ /// Is `name` still named anywhere in the document?
+ fn named(s: &Session, name: &str) -> bool {
+ serde_json::to_string(&*s.doc().unwrap().doc).unwrap().contains(&format!("\"{name}\""))
+ }
+
+ fn char_doc() -> (Session, u64) {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Base", "chars": {"fontStyle": "Bold"}})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Emphasis", "basedOn": "Base", "chars": {"tracking": 20}})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Child", "basedOn": "Emphasis"})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Strong", "chars": {"size": 14}})).unwrap();
+ let refs = json!({
+ "nestedStyles": [{"style": "Emphasis", "through": true, "count": 1, "until": {"kind": "words"}}],
+ "grepStyles": [{"style": "Emphasis", "pattern": "\\d+"}],
+ "nestedLineStyles": [{"style": "Emphasis", "lines": 1}],
+ "dropCapLines": 2, "dropCapChars": 1, "dropCapStyle": "Emphasis"});
+ s.execute("style.paragraph.create", &json!({"name": "Lead", "para": refs})).unwrap();
+ s.execute("footnote.options", &json!({"refCharStyle": "Emphasis"})).unwrap();
+ let sid = s.execute("frame.create", &json!({"rect": [72, 72, 300, 200], "content": "text", "text": "Hi there"})).unwrap()["story"]
+ .as_u64()
+ .unwrap();
+ s.execute("text.select", &json!({"story": sid, "anchor": 0, "focus": 2})).unwrap();
+ s.execute("style.character.apply", &json!({"name": "Emphasis"})).unwrap();
+ // Local paragraph overrides name it too.
+ s.execute("type.para", &json!({"attrs": refs})).unwrap();
+ s.edit(|d, _| {
+ d.styles_mut().default_character = "Emphasis".into();
+ Ok(())
+ })
+ .unwrap();
+ assert!(named(&s, "Emphasis"));
+ (s, sid)
+ }
+
+ #[test]
+ fn deleting_a_character_style_points_every_use_at_the_replacement() {
+ let (mut s, sid) = char_doc();
+ let undo = s.doc().unwrap().history.undo.len();
+ s.execute("style.character.delete", &json!({"name": "Emphasis", "replaceWith": "Strong"})).unwrap();
+ assert!(!named(&s, "Emphasis"), "no dangling reference");
+ let d = s.doc().unwrap().doc.clone();
+ assert_eq!(d.styles.char_style("Child").unwrap().based_on.as_deref(), Some("Strong"));
+ assert_eq!(d.story(StoryId(sid)).unwrap().chars[0].format.style, "Strong");
+ let lead = &d.styles.para("Lead").unwrap().para;
+ assert_eq!(lead.nested_styles.as_ref().unwrap()[0].style, "Strong");
+ assert_eq!(lead.grep_styles.as_ref().unwrap()[0].style, "Strong");
+ assert_eq!(lead.nested_line_styles.as_ref().unwrap()[0].style, "Strong");
+ assert_eq!(lead.drop_cap_style.as_deref(), Some("Strong"));
+ assert_eq!(d.footnote_options.ref_char_style, "Strong");
+ assert_eq!(d.styles.default_character, "Strong");
+ // One undo step brings the style and every use back.
+ assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1);
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert!(s.doc().unwrap().doc.styles.char_style("Emphasis").is_some());
+ assert_eq!(s.doc().unwrap().doc.story(StoryId(sid)).unwrap().chars[0].format.style, "Emphasis");
+ }
+
+ #[test]
+ fn deleting_a_character_style_for_none_unsets_based_on() {
+ let (mut s, _) = char_doc();
+ s.execute("style.character.delete", &json!({"name": "Emphasis"})).unwrap();
+ assert!(!named(&s, "Emphasis"), "no dangling reference");
+ let d = s.doc().unwrap().doc.clone();
+ assert_eq!(d.styles.char_style("Child").unwrap().based_on, None);
+ assert_eq!(d.footnote_options.ref_char_style, designcraft_doc::NO_CHAR_STYLE);
+ }
+
+ /// Replacing a style with its own descendant rebases the deleted style's children on its
+ /// parent, so no based-on chain becomes a cycle.
+ #[test]
+ fn replacing_a_style_with_its_child_makes_no_cycle() {
+ let (mut s, _) = char_doc();
+ s.execute("style.character.create", &json!({"name": "Grandchild", "basedOn": "Child"})).unwrap();
+ s.execute("style.character.delete", &json!({"name": "Emphasis", "replaceWith": "Grandchild"})).unwrap();
+ let d = s.doc().unwrap().doc.clone();
+ assert_eq!(d.styles.char_style("Child").unwrap().based_on.as_deref(), Some("Base"));
+ assert_eq!(d.styles.char_style("Grandchild").unwrap().based_on.as_deref(), Some("Child"));
+ assert!(!named(&s, "Emphasis"));
+ }
+
+ #[test]
+ fn bad_style_deletes_are_errors_and_change_nothing() {
+ let (mut s, _) = char_doc();
+ s.execute("style.paragraph.create", &json!({"name": "Head"})).unwrap();
+ let before = s.doc().unwrap().doc.clone();
+ let undo = s.doc().unwrap().history.undo.len();
+ for (id, p) in [
+ ("style.character.delete", json!({})),
+ ("style.character.delete", json!({"name": ""})),
+ ("style.character.delete", json!({"name": "Nope"})),
+ ("style.character.delete", json!({"name": "[None]"})),
+ ("style.character.delete", json!({"name": "Emphasis", "replaceWith": "Nope"})),
+ ("style.character.delete", json!({"name": "Emphasis", "replaceWith": "Emphasis"})),
+ ("style.paragraph.delete", json!({})),
+ ("style.paragraph.delete", json!({"name": ""})),
+ ("style.paragraph.delete", json!({"name": "Nope"})),
+ ("style.paragraph.delete", json!({"name": "[Basic Paragraph]"})),
+ ("style.paragraph.delete", json!({"name": "Head", "replaceWith": "Nope"})),
+ ("style.paragraph.delete", json!({"name": "Head", "replaceWith": "Head"})),
+ ] {
+ assert!(s.execute(id, &p).is_err(), "{id} {p}");
+ }
+ assert_eq!(*s.doc().unwrap().doc, *before);
+ assert_eq!(s.doc().unwrap().history.undo.len(), undo);
+ }
+
+ #[test]
+ fn deleting_a_paragraph_style_points_every_use_at_the_replacement() {
+ let mut s = Session::new();
+ s.execute("file.newSample", &json!({})).unwrap();
+ s.execute("style.paragraph.create", &json!({"name": "Sub", "basedOn": "Table Body", "nextStyle": "Table Body"})).unwrap();
+ s.edit(|d, _| {
+ let story = *d.stories.keys().next().ok_or(crate::EngineError::NoDocument)?;
+ let st = d.styles_mut();
+ st.default_paragraph = "Table Body".into();
+ st.object.push(ObjectStyle { name: "Boxed".into(), paragraph_style: Some("Table Body".into()), ..Default::default() });
+ st.cell.push(CellStyle { name: "Body Cell".into(), paragraph_style: Some("Table Body".into()), ..Default::default() });
+ d.footnote_options.para_style = "Table Body".into();
+ d.endnote_options.para_style = "Table Body".into();
+ d.endnote_options.heading_style = "Table Body".into();
+ d.settings.epub_split = designcraft_doc::EpubSplit::Style("Table Body".into());
+ d.toc = Some(Toc {
+ story,
+ title: "Contents".into(),
+ entries: vec![TocEntry { entry_style: Some("Table Body".into()), ..TocEntry::new("Table Body", 1) }],
+ page_numbers: false,
+ title_style: Some("Table Body".into()),
+ });
+ Ok(())
+ })
+ .unwrap();
+ assert!(named(&s, "Table Body"));
+ s.execute("style.paragraph.delete", &json!({"name": "Table Body", "replaceWith": "Body"})).unwrap();
+ assert!(!named(&s, "Table Body"), "no dangling reference");
+ let d = s.doc().unwrap().doc.clone();
+ let sub = d.styles.para("Sub").unwrap();
+ assert_eq!((sub.based_on.as_deref(), sub.next_style.as_deref()), (Some("Body"), Some("Body")));
+ assert_eq!(d.styles.default_paragraph, "Body");
+ assert_eq!(d.endnote_options.heading_style, "Body");
+ assert_eq!(d.settings.epub_split, designcraft_doc::EpubSplit::Style("Body".into()), "EPUB Split Document follows the replacement");
+ let after = s.execute("preflight.run", &json!({})).unwrap();
+ assert!(!after.to_string().contains("Table Body"), "{after}");
+ }
+ }
+
+ #[cfg(test)]
+ mod grep_style_tests {
+ use serde_json::json;
+
+ use crate::Session;
+
+ #[test]
+ fn grep_style_pattern_that_cannot_compile_is_rejected() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Keep"})).unwrap();
+ let bad = json!([{"style": "Keep", "pattern": "(\\d+"}]);
+ let e = s.execute("style.paragraph.create", &json!({"name": "Broken", "para": {"grepStyles": bad}})).unwrap_err().to_string();
+ assert!(e.contains("bad GREP") && e.contains("(\\\\d+"), "{e}");
+ assert!(s.doc().unwrap().doc.styles.para("Broken").is_none());
+
+ // The lookbehind dialect compiles.
+ let good = json!([{"style": "Keep", "pattern": "(?<=\\s)[aiouwzAIOUWZ]\\s"}]);
+ s.execute("style.paragraph.create", &json!({"name": "Polish", "para": {"grepStyles": good}})).unwrap();
+ let e = s.execute("style.paragraph.edit", &json!({"name": "Polish", "para": {"grepStyles": bad, "spaceAfter": 6}})).unwrap_err().to_string();
+ assert!(e.contains("bad GREP"), "{e}");
+ let st = s.doc().unwrap().doc.styles.para("Polish").unwrap().clone();
+ assert_eq!(st.para.grep_styles.unwrap()[0].pattern, "(?<=\\s)[aiouwzAIOUWZ]\\s");
+ assert_eq!(st.para.space_after, None, "nothing changes");
+
+ // A paragraph override too.
+ let r = s.execute("frame.create", &json!({"rect": [72, 72, 300, 200], "content": "text", "text": "Ala i kot"})).unwrap();
+ s.execute("text.select", &json!({"story": r["story"], "anchor": 0, "focus": 0})).unwrap();
+ let e = s.execute("type.para", &json!({"grepStyles": bad})).unwrap_err().to_string();
+ assert!(e.contains("bad GREP"), "{e}");
+ }
+
+ #[test]
+ fn idml_import_keeps_a_broken_grep_style_and_warns() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ s.execute("style.character.create", &json!({"name": "Keep"})).unwrap();
+ s.execute("style.paragraph.create", &json!({"name": "Broken"})).unwrap();
+ // Written past the command, as another application could.
+ s.edit(|d, _| {
+ if let Some(st) = d.styles_mut().para_mut("Broken") {
+ st.para.grep_styles = Some(vec![designcraft_doc::GrepStyle { style: "Keep".into(), pattern: "[a-".into() }]);
+ }
+ Ok(())
+ })
+ .unwrap();
+ let b64 = s.execute("file.exportIdml", &json!({})).unwrap()["base64"].as_str().unwrap().to_string();
+ let r = s.execute("file.openIdml", &json!({"base64": b64})).unwrap();
+ let warnings = r["warnings"].to_string();
+ assert!(warnings.contains("Broken") && warnings.contains("[a-") && warnings.contains("bad GREP"), "{warnings}");
+ let st = s.doc().unwrap().doc.styles.para("Broken").unwrap().clone();
+ assert_eq!(st.para.grep_styles.unwrap()[0].pattern, "[a-", "the style opens with its pattern");
+ }
+ }
diff --cc crates/engine/src/cmd/text/story.rs
index 000000000,e3547f88d..67f4cf1ad
mode 000000,100644..100644
--- a/crates/engine/src/cmd/text/story.rs
+++ b/crates/engine/src/cmd/text/story.rs
@@@ -1,0 -1,455 +1,458 @@@
+ use super::caret::story_of;
+ use super::format::{Target, effective_char_format, format_targets};
+ use super::{ItemId, Result, Session, StoryId, Value, bad, bool_or, json};
+
+ /// The stories of the text selection, the selected cells and the selected text frames.
+ fn selected_stories(s: &Session) -> Result<Vec<StoryId>> {
+ let st = s.doc()?;
+ let mut stories: Vec<StoryId> = st.selection.text.map(|t| t.story).into_iter().chain(st.selection.cells.map(|c| c.story)).collect();
+ stories.dedup();
+ for id in &st.selection.items {
+ if let Some(tf) = st.doc.item(*id).and_then(|i| i.text_frame())
+ && !stories.contains(&tf.story)
+ {
+ stories.push(tf.story);
+ }
+ }
+ Ok(stories)
+ }
+
+ /// Type ▸ Story: the story-wide options (Optical Margin Alignment and its size).
+ pub(super) fn story_options(s: &mut Session, p: &Value) -> Result<Value> {
+ const CMD: &str = "story.options";
+ let on = match p.get("opticalMargin") {
+ None => None,
+ Some(v) => Some(v.as_bool().ok_or_else(|| bad(CMD, "`opticalMargin` must be a bool"))?),
+ };
+ let size = match p.get("opticalMarginSize") {
+ None => None,
+ Some(v) => Some(
+ v.as_f64()
+ .and_then(designcraft_doc::OpticalMargin::clamp_size)
+ .ok_or_else(|| bad(CMD, "`opticalMarginSize` must be a finite number of points"))?,
+ ),
+ };
+ if on.is_none() && size.is_none() {
+ return Err(bad(CMD, "nothing to set: give opticalMargin or opticalMarginSize"));
+ }
+ let explicit = |key| p.get(key).filter(|v| !v.is_null());
+ let stories = if explicit("story").is_some() || explicit("frame").is_some() {
+ // Explicit targets must not silently fall back to the current selection.
+ let doc = &s.doc()?.doc;
+ for key in ["story", "frame"] {
+ if let Some(value) = explicit(key) {
+ let id = value.as_u64().ok_or_else(|| bad(CMD, format!("`{key}` must be an unsigned integer")))?;
+ let sid = if key == "story" {
+ StoryId(id)
+ } else {
+ let item = doc.item(ItemId(id)).ok_or_else(|| bad(CMD, format!("no such frame {id}")))?;
+ item.text_frame().ok_or_else(|| bad(CMD, format!("frame {id} holds no text")))?.story
+ };
+ if doc.story(sid).is_none() {
+ return Err(bad(CMD, format!("no such story {}", sid.0)));
+ }
+ }
+ }
+ vec![story_of(s, p).ok_or_else(|| bad(CMD, "no such story"))?]
+ } else {
+ selected_stories(s)?
+ };
+ if stories.is_empty() {
+ return Err(bad(CMD, "no story: select text or a text frame, or give story or frame"));
+ }
+ s.edit(|d, _| {
+ for sid in &stories {
+ let st = d.story_mut(*sid).ok_or(designcraft_doc::DocError::NoStory(*sid))?;
+ let mut om = st.optical_margin;
+ om.on = on.unwrap_or(om.on);
+ om.size = size.unwrap_or(om.size);
+ if om != st.optical_margin {
+ st.optical_margin = om;
+ st.rev = st.rev.wrapping_add(1);
+ }
+ }
+ Ok(json!({"stories": stories.len()}))
+ })
+ }
+
+ /// Type ▸ Story Direction.
+ pub(super) fn story_direction(s: &mut Session, p: &Value) -> Result<Value> {
+ let vertical = p.get("vertical").and_then(Value::as_bool).ok_or_else(|| bad("type.storyDirection", "missing vertical"))?;
+ let stories = selected_stories(s)?;
+ s.edit(|d, _| {
+ set_story_direction(d, &stories, vertical);
+ Ok(json!({"stories": stories.len()}))
+ })
+ }
+
+ /// Set the direction of `stories` (all their frames turn together).
+ pub(crate) fn set_story_direction(d: &mut designcraft_doc::Document, stories: &[StoryId], vertical: bool) {
+ for sid in stories {
+ if let Some(st) = d.story_mut(*sid)
+ && st.vertical != vertical
+ {
+ st.vertical = vertical;
+ st.rev = st.rev.wrapping_add(1);
+ }
+ }
+ }
+
+ /// How much of the selected text `type.selectionAttrs` reports.
+ pub(super) const SELECTED_TEXT_CHARS: usize = 60;
+
+ pub(super) fn selected_text_preview(chars: impl Iterator<Item = char>) -> String {
+ chars
+ .map(|c| if c.is_control() || c == designcraft_doc::OBJECT_MARK { ' ' } else { c })
+ .skip_while(|c| c.is_whitespace())
+ .take(SELECTED_TEXT_CHARS)
+ .collect()
+ }
+
+ pub(super) fn selection_attrs(s: &mut Session, p: &Value) -> Result<Value> {
+ let st = s.doc()?;
+ let targets = format_targets(s);
+ let Some(Target { story: sid, cell, range: r }) = targets.first().cloned() else { return Ok(Value::Null) };
+ let story = st.doc.text_story(sid, cell).ok_or(designcraft_doc::DocError::NoStory(sid))?;
+ let pi = story.para_at(r.start);
+ let pf = &story.paras[pi];
+ let (pp, base) = st.doc.styles.resolve_para(pf);
+ let cf = effective_char_format(s, &Target { story: sid, cell, range: r.clone() })?;
+ let cp = st.doc.styles.resolve_char(&base, &cf);
+ let (style_para, style_chars) = st.doc.styles.resolve_para_style(&pf.style);
+ let mut character_base = base.clone();
+ let character_style = st.doc.styles.char_style_attrs(&cf.style);
+ character_base.apply(&character_style);
+ let char_delta = character_base.delta(&cp);
+ let style_keys = character_style.keys();
+ let character_style_overrides = char_delta.keys().iter().filter(|key| style_keys.contains(key)).count();
++ // The text's own formatting over its paragraph, as Create New Style from Selection captures it.
++ let mut own = character_style.clone();
++ own.merge(&cf.over);
+ // The selected text (its start, on one line), for previews such as the font menu's.
+ let selected = selected_text_preview(story.text.get(r.start..r.end).unwrap_or_default().chars());
- let mut out = json!({"story": sid.0, "paragraphStyle": pf.style, "characterStyle": cf.style, "para": pp, "chars": cp,
++ let mut out = json!({"story": sid.0, "paragraphStyle": pf.style, "characterStyle": cf.style, "para": pp, "chars": cp, "ownChars": own,
+ "paraOverrides": style_para.delta(&pp).count() + style_chars.delta(&base).count(),
+ "charOverrides": char_delta.count(), "characterStyleOverrides": character_style_overrides,
+ "selectedText": selected.trim()});
+ let mut stories = selected_stories(s)?;
+ if stories.is_empty() {
+ stories.push(sid);
+ }
+ out["storyOptions"] = story_options_of(&st.doc, &stories);
+ if bool_or(p, "mixed", false) {
+ out["paraMixed"] = json!(mixed_para_attrs(&st.doc, &targets));
+ }
+ Ok(out)
+ }
+
+ /// The story options of `stories`, as story.options names them; a value that differs between
+ /// the stories is null.
+ fn story_options_of(doc: &designcraft_doc::Document, stories: &[StoryId]) -> Value {
+ let mut values = stories.iter().filter_map(|sid| doc.story(*sid)).map(|st| st.optical_margin);
+ let Some(first) = values.next() else { return json!({"opticalMargin": null, "opticalMarginSize": null}) };
+ let (mut on, mut size) = (Some(first.on), Some(first.size));
+ for om in values {
+ on = on.filter(|v| *v == om.on);
+ size = size.filter(|v| *v == om.size);
+ }
+ json!({"opticalMargin": on, "opticalMarginSize": size})
+ }
+
+ /// 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()
+ }
+
+ #[cfg(test)]
+ mod story_options_tests {
+ use super::*;
+
+ #[test]
+ fn malformed_explicit_story_targets_do_not_change_the_selection() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let r = s.execute("frame.create", &json!({"rect": [0, 0, 300, 200], "content": "text", "text": "Selected"})).unwrap();
+ let sid = StoryId(r["story"].as_u64().unwrap());
+ for target in ["story", "frame"] {
+ for invalid in [json!("invalid"), json!(-1), json!(1.5), json!(true), json!({}), json!([]), json!(999_999)] {
+ let mut params = json!({"opticalMargin": true});
+ params[target] = invalid;
+ assert!(s.execute("story.options", &params).is_err(), "{params}");
+ assert!(!story(&s, sid).on, "{params} changed the selected story");
+ }
+ }
+ // Selection fallback still works when neither explicit target is supplied.
+ s.execute("story.options", &json!({"opticalMargin": true})).unwrap();
+ assert!(story(&s, sid).on);
+ s.execute("story.options", &json!({"frame": r["id"], "opticalMargin": false})).unwrap();
+ assert!(!story(&s, sid).on);
+ }
+
+ #[test]
+ fn story_options_treat_null_targets_as_absent_and_validate_both_explicit_ids() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let a = s.execute("frame.create", &json!({"rect": [0, 0, 300, 200], "content": "text", "text": "Explicit"})).unwrap();
+ let b = s.execute("frame.create", &json!({"rect": [0, 300, 300, 500], "content": "text", "text": "Selected"})).unwrap();
+ let aid = StoryId(a["story"].as_u64().unwrap());
+ let bid = StoryId(b["story"].as_u64().unwrap());
+ for targets in [json!({"story": null}), json!({"frame": null}), json!({"story": null, "frame": null})] {
+ let mut p = targets;
+ p["opticalMargin"] = json!(true);
+ s.execute("story.options", &p).unwrap();
+ assert!(story(&s, bid).on);
+ assert!(!story(&s, aid).on);
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert!(!story(&s, bid).on);
+ }
+ for targets in [json!({"story": null, "frame": a["id"]}), json!({"story": a["story"], "frame": null})] {
+ let mut p = targets;
+ p["opticalMargin"] = json!(true);
+ s.execute("story.options", &p).unwrap();
+ assert!(story(&s, aid).on);
+ assert!(!story(&s, bid).on);
+ s.execute("edit.undo", &json!({})).unwrap();
+ }
+ // Even a frame ignored by story precedence must be valid when explicitly supplied.
+ let non_text = s.execute("frame.create", &json!({"rect": [400, 0, 500, 100]})).unwrap();
+ for (targets, message) in [
+ (json!({"frame": 999_999}), "no such frame 999999".to_string()),
+ (json!({"frame": non_text["id"]}), format!("frame {} holds no text", non_text["id"])),
+ (json!({"story": 999_999}), "no such story 999999".to_string()),
+ (json!({"story": a["story"], "frame": 999_999}), "no such frame 999999".to_string()),
+ ] {
+ let mut p = targets;
+ p["opticalMargin"] = json!(true);
+ assert!(s.execute("story.options", &p).unwrap_err().to_string().contains(&message), "{p}: expected {message}");
+ assert!(!story(&s, aid).on);
+ assert!(!story(&s, bid).on);
+ }
+ }
+
+ fn first_x(s: &Session, sid: StoryId) -> f64 {
+ let cs = s.cache.get(&s.doc().unwrap().doc, sid, None);
+ cs.frames[0].lines[0].glyphs[0].x
+ }
+
+ fn story(s: &Session, sid: StoryId) -> designcraft_doc::OpticalMargin {
+ s.doc().unwrap().doc.story(sid).unwrap().optical_margin
+ }
+
+ #[test]
+ fn story_options_set_optical_margin_with_one_undo_step_each() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let r = s.execute("frame.create", &json!({"rect": [0, 0, 300, 200], "content": "text", "text": "“Hung” words."})).unwrap();
+ let sid = StoryId(r["story"].as_u64().unwrap());
+ let flush = first_x(&s, sid);
+ // The selected frame's story.
+ s.execute("story.options", &json!({"opticalMargin": true})).unwrap();
+ assert_eq!(story(&s, sid), designcraft_doc::OpticalMargin { on: true, size: 12.0 });
+ let hung = first_x(&s, sid);
+ assert!(hung < flush - 1.0, "{hung} {flush}");
+ s.execute("story.options", &json!({"story": sid.0, "opticalMarginSize": 24})).unwrap();
+ assert_eq!(story(&s, sid).size, 24.0);
+ assert!(first_x(&s, sid) < hung - 1.0);
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert_eq!(story(&s, sid), designcraft_doc::OpticalMargin { on: true, size: 12.0 });
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert!(!story(&s, sid).on);
+ assert_eq!(first_x(&s, sid), flush);
+ // Hostile sizes.
+ s.execute("story.options", &json!({"story": sid.0, "opticalMarginSize": 1e9})).unwrap();
+ assert_eq!(story(&s, sid).size, designcraft_doc::OpticalMargin::MAX_SIZE);
+ for bad in [json!({"opticalMarginSize": "big"}), json!({"opticalMargin": 1}), json!({}), json!({"story": 999_999, "opticalMargin": true})] {
+ assert!(s.execute("story.options", &bad).is_err(), "{bad}");
+ }
+ }
+
+ #[test]
+ fn ignore_optical_margin_through_type_para_and_paragraph_styles() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let r = s.execute("frame.create", &json!({"rect": [0, 0, 300, 200], "content": "text", "text": "“Hung” words."})).unwrap();
+ let sid = StoryId(r["story"].as_u64().unwrap());
+ let flush = first_x(&s, sid);
+ s.execute("story.options", &json!({"opticalMargin": true})).unwrap();
+ assert!(first_x(&s, sid) < flush - 1.0);
+ let ignored = |s: &Session| s.doc().unwrap().doc.story(sid).unwrap().paras[0].para.ignore_optical_margin;
+ s.execute("type.para", &json!({"attrs": {"ignoreOpticalMargin": true}})).unwrap();
+ assert_eq!(ignored(&s), Some(true));
+ assert_eq!(first_x(&s, sid), flush);
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert_eq!(ignored(&s), None);
+ s.execute("style.paragraph.create", &json!({"name": "Flush", "para": {"ignoreOpticalMargin": true}})).unwrap();
+ let resolved = |s: &Session| s.doc().unwrap().doc.styles.resolve_para_style("Flush").0.ignore_optical_margin;
+ assert!(resolved(&s));
+ s.execute("style.paragraph.edit", &json!({"name": "Flush", "para": {"ignoreOpticalMargin": false}})).unwrap();
+ assert!(!resolved(&s));
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert!(resolved(&s));
+ s.execute("style.paragraph.apply", &json!({"name": "Flush"})).unwrap();
+ assert_eq!(first_x(&s, sid), flush);
+ }
+
+ #[test]
+ fn selection_attrs_report_the_story_options_with_differences_as_null() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let a = s.execute("frame.create", &json!({"rect": [0, 0, 300, 200], "content": "text", "text": "One"})).unwrap();
+ let b = s.execute("frame.create", &json!({"rect": [0, 300, 300, 500], "content": "text", "text": "Two"})).unwrap();
+ let options = |s: &mut Session| s.execute("type.selectionAttrs", &json!({})).unwrap()["storyOptions"].clone();
+ assert_eq!(options(&mut s), json!({"opticalMargin": false, "opticalMarginSize": 12.0}));
+ s.execute("story.options", &json!({"story": b["story"], "opticalMargin": true, "opticalMarginSize": 18})).unwrap();
+ assert_eq!(options(&mut s), json!({"opticalMargin": true, "opticalMarginSize": 18.0}), "the selected frame's story");
+ s.execute("selection.set", &json!({"ids": [a["id"], b["id"]]})).unwrap();
+ assert_eq!(options(&mut s), json!({"opticalMargin": null, "opticalMarginSize": null}));
+ s.execute("story.options", &json!({"opticalMarginSize": 18})).unwrap();
+ assert_eq!(options(&mut s), json!({"opticalMargin": null, "opticalMarginSize": 18.0}));
+ }
+ }
+
+ #[cfg(test)]
+ mod story_direction_tests {
+ use designcraft_doc::{ItemId, StoryId};
+ use serde_json::json;
+
+ use crate::Session;
+
+ fn frame(s: &mut Session, rect: [f64; 4], text: &str, vertical: bool) -> (ItemId, StoryId) {
+ let r = s.execute("frame.create", &json!({"rect": rect, "content": "text", "text": text, "caret": false, "vertical": vertical})).unwrap();
+ (ItemId(r["id"].as_u64().unwrap()), StoryId(r["story"].as_u64().unwrap()))
+ }
+
+ /// Which frames of the story are composed vertically, in thread order.
+ fn composed(s: &Session, sid: StoryId) -> Vec<bool> {
+ s.cache.get(&s.doc().unwrap().doc, sid, None).frames.iter().map(|f| f.vertical).collect()
+ }
+
+ #[test]
+ fn story_direction_turns_every_frame_of_the_story() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let (a, sid) = frame(&mut s, [72.0, 72.0, 200.0, 400.0], "縦書きの文章です。", false);
+ let (b, _) = frame(&mut s, [300.0, 72.0, 428.0, 400.0], "", false);
+ s.edit(|d, _| Ok(d.thread(a, b)?)).unwrap();
+ assert_eq!(composed(&s, sid), [false, false]);
+ // From the second frame selected, through Type ▸ Story Direction.
+ s.execute("selection.set", &json!({"ids": [b.0]})).unwrap();
+ s.execute("type.storyDirection", &json!({"vertical": true})).unwrap();
+ assert_eq!(composed(&s, sid), [true, true]);
+ // From a caret in the text.
+ s.execute("text.select", &json!({"story": sid.0, "anchor": 0, "focus": 0})).unwrap();
+ s.execute("type.storyDirection", &json!({"vertical": false})).unwrap();
+ assert_eq!(composed(&s, sid), [false, false]);
+ // The frame option sets the frame's story.
+ s.execute("object.textFrameOptions", &json!({"ids": [a.0], "vertical": true})).unwrap();
+ assert_eq!(composed(&s, sid), [true, true]);
+ // Undo puts it back.
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert_eq!(composed(&s, sid), [false, false]);
+ }
+
+ #[test]
+ fn a_frame_threaded_onto_a_vertical_story_turns_vertical() {
+ let mut s = Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let (a, sid) = frame(&mut s, [72.0, 72.0, 200.0, 400.0], "縦書きの文章です。", true);
+ let (b, _) = frame(&mut s, [300.0, 72.0, 428.0, 400.0], "", false);
+ let c = s.execute("frame.create", &json!({"rect": [450, 72, 550, 400]})).unwrap();
+ let c = ItemId(c["id"].as_u64().unwrap());
+ s.edit(|d, _| {
+ d.thread(a, b)?;
+ Ok(d.thread(b, c)?)
+ })
+ .unwrap();
+ assert_eq!(composed(&s, sid), [true, true, true]);
+ }
+ }
+
+ #[cfg(test)]
+ mod story_query_contract_tests {
+ use serde_json::json;
+ #[test]
+ fn missing_story_errors_but_valid_empty_and_selected_stories_succeed() {
+ let mut s = crate::Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ assert!(s.execute("story.get", &json!({"story":999})).unwrap_err().to_string().contains("no such story"));
+ let f = s.execute("frame.create", &json!({"rect":[36,36,300,200],"content":"text"})).unwrap();
+ assert_eq!(s.execute("story.get", &json!({"story":f["story"]})).unwrap()["text"], "");
+ assert_eq!(s.execute("story.get", &json!({"frame":f["id"]})).unwrap()["text"], "");
+ s.execute("text.select", &json!({"story":f["story"],"anchor":0})).unwrap();
+ assert_eq!(s.execute("story.get", &json!({})).unwrap()["text"], "");
+ }
+
+ #[test]
+ fn kenten_shatai_auto_tcy_and_grid_settings_take_checked_values() {
+ use designcraft_doc::cjk::CharacterAlignment;
+ use designcraft_doc::cjk_settings::{KentenKind, KentenPosition};
+ let mut s = crate::Session::new();
+ s.execute("file.new", &json!({})).unwrap();
+ let r = s.execute("frame.create", &json!({"rect": [72, 72, 200, 400], "content": "text", "text": "縦書き12年", "vertical": true})).unwrap();
+ let sid = designcraft_doc::StoryId(r["story"].as_u64().unwrap());
+ s.execute("text.select", &json!({"story": sid.0, "anchor": 0, "focus": "縦書き".len()})).unwrap();
+ let chars = |s: &crate::Session| s.doc().unwrap().doc.stories[&sid].char_format_at(1).over.clone();
+ let para = |s: &crate::Session| s.doc().unwrap().doc.stories[&sid].paras[0].para.clone();
+ // Any setting turns kenten on; values are clamped and text is capped.
+ let long = "★".repeat(10_000);
+ s.execute(
+ "type.kenten",
+ &json!({"kind": "custom", "character": long, "size": 1e300, "distance": -1e300, "xScale": 0, "fillTint": 250, "position": "belowLeft"}),
+ )
+ .unwrap();
+ let a = chars(&s);
+ assert_eq!((a.kenten, a.kenten_kind, a.kenten_position), (Some(true), Some(KentenKind::Custom), Some(KentenPosition::BelowLeft)));
+ assert_eq!(a.kenten_character.as_ref().map(|c| c.chars().count()), Some(designcraft_doc::cjk_settings::KENTEN_MARK_MAX_CHARS));
+ assert_eq!(
+ (a.kenten_size, a.kenten_distance, a.kenten_x_scale, a.kenten_fill_tint),
+ (Some(Some(1296.0)), Some(-1296.0), Some(0.01), Some(Some(1.0)))
+ );
+ // Bad values change nothing.
+ for bad in [json!({"kind": "sparkle"}), json!({"size": "big"}), json!({"character": 5}), json!({"on": "yes"}), json!({"overprintFill": 1})] {
+ assert!(s.execute("type.kenten", &bad).is_err(), "{bad}");
+ }
+ assert_eq!(chars(&s), a);
+ s.execute("type.kenten", &json!({"on": false})).unwrap();
+ assert_eq!((chars(&s).kenten, chars(&s).kenten_kind), (Some(false), Some(KentenKind::Custom)), "off keeps the settings");
+ // Shatai.
+ s.execute("type.shatai", &json!({"magnification": 1e9, "angle": -30, "adjustRotation": true})).unwrap();
+ let a = chars(&s);
+ assert_eq!((a.shatai_magnification, a.shatai_angle, a.shatai_adjust_rotation), (Some(90.0), Some(150.0), Some(true)));
+ assert!(s.execute("type.shatai", &json!({})).is_err());
+ assert!(s.execute("type.shatai", &json!({"angle": [45]})).is_err());
+ // Paragraph settings.
+ s.execute("type.autoTateChuYoko", &json!({"digits": 1e12, "includeRoman": true})).unwrap();
+ assert_eq!((para(&s).auto_tcy, para(&s).auto_tcy_include_roman), (Some(designcraft_compose::shape::AUTO_TCY_MAX), Some(true)));
+ s.execute("type.gridSettings", &json!({"alignment": "emCenter", "firstLineOnly": true, "gyoudori": 1e12, "paragraphGyoudori": true}))
+ .unwrap();
+ let p = para(&s);
+ assert_eq!((p.grid_align, p.grid_reference), (Some(designcraft_doc::GridAlign::FirstLineOnly), Some(CharacterAlignment::EmCenter)));
+ assert_eq!((p.grid_gyoudori, p.paragraph_gyoudori), (Some(100), Some(true)));
+ assert!(s.execute("type.gridSettings", &json!({"alignment": "middle"})).is_err());
+ s.execute("type.gridSettings", &json!({"alignment": "none"})).unwrap();
+ assert_eq!(para(&s).grid_align, Some(designcraft_doc::GridAlign::None));
+ s.execute("type.rotateRoman", &json!({})).unwrap();
+ assert_eq!(para(&s).rotate_roman, Some(true));
+ s.execute("type.rotateRoman", &json!({})).unwrap();
+ assert_eq!(para(&s).rotate_roman, Some(false));
+ s.execute("type.romanWordBreak", &json!({"on": true})).unwrap();
+ assert_eq!(para(&s).roman_word_break, Some(true));
+ // The story still composes with every setting at its limit.
+ let cs = designcraft_compose::compose_story(&s.doc().unwrap().doc, sid, &Default::default());
+ assert!(!cs.frames.is_empty());
+ }
+ }
diff --cc crates/ui-egui/src/dialogs.rs
index 9768d8e21,bb3077103..98324fb58
--- a/crates/ui-egui/src/dialogs.rs
+++ b/crates/ui-egui/src/dialogs.rs
@@@ -175,6 -186,6 +186,134 @@@ fn color_theme(app: &DesignApp, ui: &mu
mod color_theme_tests {
use super::*;
++ /// The course's chapter 20: the "Recipe Categories" title formatted on the page (size, All
++ /// Caps, tracking, space after), then New Paragraph Style from it: the dialog starts from the
++ /// text, and with Apply Style to Selection the paragraph takes the new style. Next Style and
++ /// Reset To Base are set from General.
++ #[test]
++ fn a_new_paragraph_style_starts_from_the_selected_text() {
++ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
++ app.run("file.new", json!({})).unwrap();
++ let f = app.run("frame.create", json!({"rect": [36, 36, 400, 300], "content": "text", "text": "Egg Recipes\rBoil them."})).unwrap();
++ app.run("text.select", json!({"story": f["story"], "anchor": 0, "focus": 11})).unwrap();
++ app.run("type.char", json!({"attrs": {"size": 20, "capitalization": "allCaps", "tracking": 50}})).unwrap();
++ app.run("type.para", json!({"attrs": {"spaceAfter": 6}})).unwrap();
++ open_new_style(&mut app, true);
++ let d = app.ui.dialog.clone().unwrap();
++ assert_eq!(
++ (d.fields["c.size"].clone(), d.fields["c.capitalization"].clone(), d.fields["p.spaceAfter"].clone()),
++ (json!(20.0), json!("allCaps"), json!(6.0))
++ );
++ assert!(d.b("apply") && !d.fields.contains_key("c.fontFamily"), "only what differs from [No Paragraph Style]");
++ if let Some(d) = app.ui.dialog.as_mut() {
++ d.fields.insert("rename".into(), json!("Recipe Categories"));
++ d.fields.insert("nextStyle".into(), json!(designcraft_doc::BASIC_PARAGRAPH));
++ }
++ confirm(&mut app).unwrap();
++ let a = app.run("type.selectionAttrs", json!({})).unwrap();
++ assert_eq!(a["paragraphStyle"], "Recipe Categories", "applied to the selection");
++ assert_eq!(a["paraOverrides"].as_u64().unwrap_or(0) + a["charOverrides"].as_u64().unwrap_or(0), 0);
++ let style = |app: &DesignApp| app.session.doc().unwrap().doc.styles.para("Recipe Categories").cloned().unwrap();
++ assert_eq!(style(&app).next_style.as_deref(), Some(designcraft_doc::BASIC_PARAGRAPH));
++ assert_eq!(style(&app).chars.size, Some(20.0));
++ // Reset To Base: the style keeps nothing of its own, apart from the edits made then.
++ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": "Recipe Categories", "basedOn": designcraft_doc::BASIC_PARAGRAPH})));
++ if let Some(d) = app.ui.dialog.as_mut() {
++ d.fields.insert("resetToBase".into(), json!(true));
++ d.fields.insert("c.tracking".into(), json!(10.0));
++ }
++ confirm(&mut app).unwrap();
++ let s = style(&app);
++ assert_eq!((s.chars.size, s.chars.tracking, s.para.space_after), (None, Some(10.0), None), "{s:?}");
++ assert_eq!(s.based_on.as_deref(), Some(designcraft_doc::BASIC_PARAGRAPH));
++ }
++
++ /// The course's chapter 22: "eggs" made bold and red on the page, then New Character Style
++ /// from it. The dialog is titled as InDesign's, starts from what the text has of its own
++ /// over its paragraph style ("[None] + Bold + color"), and Apply Style to Selection gives the
++ /// text the style, with no override left.
++ #[test]
++ fn a_new_character_style_starts_from_the_selected_text() {
++ use egui_kittest::{Harness, kittest::Queryable};
++ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
++ app.run("file.new", json!({})).unwrap();
++ let f = app.run("frame.create", json!({"rect": [36, 36, 400, 300], "content": "text", "text": "Drop eggs into boiling water."})).unwrap();
++ app.run("text.select", json!({"story": f["story"], "anchor": 0, "focus": 29})).unwrap();
++ app.run("style.paragraph.create", json!({"name": "Recipe", "chars": {"size": 14}})).unwrap();
++ app.run("style.paragraph.apply", json!({"name": "Recipe"})).unwrap();
++ app.run("text.select", json!({"story": f["story"], "anchor": 5, "focus": 9})).unwrap();
++ app.run("type.char", json!({"attrs": {"fontStyle": "Bold", "fill": "C=15 M=100 Y=100 K=0"}})).unwrap();
++ open_new_style(&mut app, false);
++ let d = app.ui.dialog.clone().unwrap();
++ assert_eq!((d.fields["c.fontStyle"].clone(), d.fields["c.fill"].clone()), (json!("Bold"), json!("C=15 M=100 Y=100 K=0")));
++ assert!(d.b("apply"));
++ let mut h = Harness::builder().with_size(egui::vec2(1000.0, 700.0)).build_ui_state(
++ |ui, app: &mut DesignApp| {
++ let key = egui::Id::new("new_character_style_test_fonts");
++ if ui.data(|d| d.get_temp::<bool>(key)).is_none() {
++ crate::theme::install_fonts(ui.ctx(), "");
++ ui.data_mut(|d| d.insert_temp(key, true));
++ return;
++ }
++ show(app, ui.ctx());
++ },
++ app,
++ );
++ h.run_steps(4);
++ for l in ["New Character Style", "Apply Style to Selection"] {
++ assert!(h.query_by_label(l).is_some(), "{l}");
++ }
++ let app = h.state_mut();
++ if let Some(d) = app.ui.dialog.as_mut() {
++ d.fields.insert("rename".into(), json!("eggs"));
++ }
++ confirm(app).unwrap();
++ let style = app.session.doc().unwrap().doc.styles.char_style("eggs").cloned().unwrap();
++ assert_eq!((style.chars.font_style.as_deref(), style.chars.fill.as_deref()), (Some("Bold"), Some("C=15 M=100 Y=100 K=0")));
++ assert_eq!(style.chars.size, None, "the size is the paragraph style's, not the text's own");
++ let a = app.run("type.selectionAttrs", json!({})).unwrap();
++ assert_eq!((a["characterStyle"].clone(), a["charOverrides"].clone()), (json!("eggs"), json!(0)), "applied to the selection");
++ }
++
++ /// A Based On changed in the dialog (without Reset To Base) is what the fields are checked
++ /// against: the style's own settings over the new parent.
++ #[test]
++ fn a_changed_based_on_is_what_the_fields_are_checked_against() {
++ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
++ app.run("file.new", json!({})).unwrap();
++ app.run("style.paragraph.create", json!({"name": "Loose", "para": {"wordSpaceMin": 1.2, "wordSpaceDesired": 1.3}})).unwrap();
++ app.run("style.paragraph.create", json!({"name": "Child", "basedOn": "Loose"})).unwrap();
++ let mut d = Dialog::new("paragraphStyleOptions", json!({"name": "Child"}));
++ d.fields.insert("p.wordSpaceDesired".into(), json!(1.0));
++ assert!(check_paragraph_style_justification(&app, &d).is_err(), "below Loose's minimum");
++ d.fields.insert("basedOn".into(), json!(designcraft_doc::BASIC_PARAGRAPH));
++ assert_eq!(check_paragraph_style_justification(&app, &d), Ok(()), "[Basic Paragraph]'s minimum is lower");
++ }
++
++ /// With Reset To Base, the justification fields are checked against the base style (the
++ /// style's own minimum no longer applies), and Preview shows the reset on the page.
++ #[test]
++ fn reset_to_base_checks_and_previews_against_the_base() {
++ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
++ app.run("file.new", json!({})).unwrap();
++ let f = app.run("frame.create", json!({"rect": [36, 36, 400, 300], "content": "text", "text": "Loose words"})).unwrap();
++ app.run("text.select", json!({"story": f["story"], "anchor": 0, "focus": 5})).unwrap();
++ app.run("style.paragraph.create", json!({"name": "Loose", "basedOn": designcraft_doc::BASIC_PARAGRAPH, "para": {"wordSpaceMin": 1.2, "wordSpaceDesired": 1.3}, "chars": {"size": 30}}))
++ .unwrap();
++ app.run("style.paragraph.apply", json!({"name": "Loose"})).unwrap();
++ let mut d = Dialog::new("paragraphStyleOptions", json!({"name": "Loose"}));
++ d.fields.insert("p.wordSpaceDesired".into(), json!(1.1));
++ assert!(check_paragraph_style_justification(&app, &d).is_err(), "below the style's own minimum");
++ d.fields.insert("resetToBase".into(), json!(true));
++ assert_eq!(check_paragraph_style_justification(&app, &d), Ok(()), "the base's minimum is 100%");
++ d.fields.insert("preview".into(), json!(true));
++ style_options_preview(&mut app, &mut d);
++ assert_eq!(d.fields[PREVIEWED]["resetToBase"], true);
++ let size = app.run("type.selectionAttrs", json!({})).unwrap()["chars"]["size"].clone();
++ assert_eq!(size, json!(12.0), "the page shows the style reset to its base");
++ app.session.cancel_interaction();
++ }
++
#[test]
fn color_theme_cancel_is_read_only_and_confirm_adds_the_preview() {
let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
@@@ -2170,12 -2216,11 +2344,13 @@@ pub fn show(app: &mut DesignApp, ctx: &
"textFrameOptions" => crate::i18n::tr(&app.ui.language, "Text Frame Options"),
"colorTheme" => crate::i18n::tr(&app.ui.language, "Color Theme"),
"documentSetup" => crate::i18n::tr(&app.ui.language, "Document Setup"),
+ "fileInfo" => crate::i18n::tr(&app.ui.language, "File Info"),
"numberingSection" => crate::i18n::tr(&app.ui.language, "Numbering & Section Options…").trim_end_matches('…'),
"findChange" => crate::i18n::tr(&app.ui.language, "Find/Change"),
+ "paragraphStyleOptions" if d.b("new") => crate::i18n::tr(&app.ui.language, "New Paragraph Style"),
"paragraphStyleOptions" => crate::i18n::tr(&app.ui.language, "Paragraph Style Options"),
"deleteParagraphStyle" => crate::i18n::tr(&app.ui.language, "Delete Paragraph Style"),
+ "characterStyleOptions" if d.b("new") => crate::i18n::tr(&app.ui.language, "New Character 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"),
@@@ -4277,42 -4331,9 +4529,43 @@@ fn paragraph_style_options(app: &mut De
}
}
});
+ let _ = crate::widgets::name_combo(combo, crate::i18n::tr(&app.ui.language, "Based On"));
ui.end_row();
+ // Next Style: the style of the paragraph that follows when Enter ends this one.
+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Next Style:"));
+ let next = match d.fields.get("nextStyle") {
+ Some(Value::String(n)) => Some(n.clone()),
+ Some(_) => None,
+ None => style.next_style.clone().filter(|n| *n != name),
+ };
+ let same = crate::i18n::tr(&app.ui.language, "[Same style]").to_string();
+ let shown = next.as_deref().map_or(same.clone(), |n| crate::i18n::style_name(&app.ui.language, n).to_string());
+ egui::ComboBox::from_id_salt("psnext").selected_text(crate::rtl::widget(ui, shown)).width(220.0).show_ui(ui, |ui| {
+ if ui.selectable_label(next.is_none(), crate::rtl::widget(ui, &same)).clicked() {
+ d.fields.insert("nextStyle".into(), Value::Null);
+ }
+ for n in names.iter().filter(|n| *n != designcraft_doc::NO_PARA_STYLE) {
+ if ui
+ .selectable_label(next.as_deref() == Some(n), crate::rtl::widget(ui, crate::i18n::style_name(&app.ui.language, n)))
+ .clicked()
+ {
+ d.fields.insert("nextStyle".into(), json!(n));
+ }
+ }
+ });
+ ui.end_row();
});
+ // Reset To Base: the style keeps nothing of its own (the edits made here stay).
+ if !new
+ && ui
+ .add_enabled(
+ !based_name.is_empty() && based_name != designcraft_doc::NO_PARA_STYLE,
+ egui::Button::new(crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "Reset To Base"))),
+ )
+ .clicked()
+ {
+ d.fields.insert("resetToBase".into(), json!(true));
+ }
ui.add_space(8.0);
crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Style Settings:")).font(semibold(12.0)));
let summary = paragraph_style_summary(&app.ui.language, d, &style, &doc.styles);
diff --cc crates/ui-egui/src/dialogs/tests.rs
index 000000000,84cbf3bea..ee94dd4c2
mode 000000,100644..100644
--- a/crates/ui-egui/src/dialogs/tests.rs
+++ b/crates/ui-egui/src/dialogs/tests.rs
@@@ -1,0 -1,3523 +1,3526 @@@
+ use super::*;
+
+ #[test]
+ fn paragraph_style_settings_show_captured_color_and_pending_spacing_without_changing_the_document() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ let f = app.run("frame.create", json!({"rect":[36,36,300,200],"content":"text","text":"Heading"})).unwrap();
+ app.run("text.select", json!({"story":f["story"],"anchor":0,"focus":7})).unwrap();
+ app.run("type.char", json!({"fontFamily":"Source Sans 3","fontStyle":"Bold","size":16,"fill":"[Paper]"})).unwrap();
+ app.run("style.paragraph.create", json!({"name":"Header","fromSelection":true})).unwrap();
+ let doc = app.session.doc().unwrap().doc.clone();
+ let style = doc.styles.para("Header").unwrap();
+ let mut d = Dialog::new("paragraphStyleOptions", json!({"name":"Header"}));
+ let summary = paragraph_style_summary("", &d, style, &doc.styles);
+ for value in ["Source Sans 3", "Bold", "16 pt", "[Paper]"] {
+ assert!(summary.contains(value), "{summary}");
+ }
+ assert!(summary.len() < 250, "default attributes do not swamp the captured settings: {summary}");
+ d.fields.insert("c.fill".into(), json!("[Registration]"));
+ d.fields.insert("p.spaceAfter".into(), json!(4.5));
+ let summary = paragraph_style_summary("", &d, style, &doc.styles);
+ assert!(summary.contains("[Registration]") && !summary.contains("[Paper]"), "{summary}");
+ assert!(summary.contains("4.5 pt"), "{summary}");
+ assert_eq!(app.session.doc().unwrap().doc, doc);
+ }
+
+ /// A dialog opened without the menu's fields has no `useDefaults` field at all. Confirming it
+ /// with no layer unticked must keep the file's defaults, not choose every layer explicitly:
+ /// an implicit all-on choice is rejected for a PDF without layers, so the command's error
+ /// tells the two apart.
+ #[test]
+ fn layer_options_confirm_without_the_menu_fields_keeps_file_defaults() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"width": 100, "height": 100, "pages": 1})).unwrap();
+ let pdf = app.run("file.exportPdf", json!({})).unwrap()["base64"].clone();
+ let placed = app.run("file.place", json!({"base64": pdf, "name": "plain.pdf", "x": 0, "y": 0, "width": 100})).unwrap();
+ let id = designcraft_doc::ItemId(placed["id"].as_u64().unwrap());
+ app.run("selection.set", json!({"ids": [placed["id"]]})).unwrap();
+ app.ui.dialog = Some(Dialog::new("layerOptions", json!({})));
+ confirm(&mut app).unwrap();
+ assert!(!app.session.doc().unwrap().doc.item(id).unwrap().has_pdf_layer_override(), "an untouched dialog keeps the file defaults");
+ // The menu's own dialog still asks for an explicit all-on choice when that is the state
+ // it was opened in; a layerless PDF refuses it rather than accepting an empty override.
+ app.ui.dialog = Some(Dialog::new("layerOptions", json!({"useDefaults": false, "layers": []})));
+ let err = confirm(&mut app).unwrap_err();
+ assert!(err.contains("could not be changed"), "{err}");
+ assert!(!app.session.doc().unwrap().doc.item(id).unwrap().has_pdf_layer_override(), "a layerless PDF never takes an explicit choice");
+ }
+
+ #[test]
+ fn paragraph_style_settings_compare_with_the_chosen_parent() {
+ let mut styles = designcraft_doc::Styles::default();
+ styles.paragraph.push(designcraft_doc::ParagraphStyle {
+ name: "Parent".into(),
+ chars: designcraft_doc::CharAttrs { size: Some(20.0), ..Default::default() },
+ based_on: None,
+ next_style: None,
+ para: Default::default(),
+ shortcut: String::new(),
+ });
+ let style = designcraft_doc::ParagraphStyle {
+ name: "Child".into(),
+ based_on: Some("Parent".into()),
+ next_style: None,
+ para: Default::default(),
+ chars: Default::default(),
+ shortcut: String::new(),
+ };
+ let d = Dialog::new("paragraphStyleOptions", json!({"name":"Child"}));
+ assert_eq!(paragraph_style_summary("", &d, &style, &styles), "Parent");
+ }
+
+ #[test]
+ fn step_and_repeat_dialog_previews_and_makes_the_copies_as_one_undo_step() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ let id = app.run("frame.create", json!({"rect": [72, 600, 540, 640]})).unwrap()["id"].as_u64().unwrap();
+ app.run("selection.set", json!({"ids": [id]})).unwrap();
+ let open = |app: &mut DesignApp| {
+ crate::menus::activate(app, "edit.stepAndRepeat", &Value::Null);
+ assert_eq!(app.ui.dialog.as_ref().map(|d| d.id.as_str()), Some(STEP_AND_REPEAT));
+ };
+ let set = |app: &mut DesignApp, k: &str, v: Value| {
+ app.ui.dialog.as_mut().unwrap().fields.insert(k.into(), v);
+ };
+ let items = |app: &DesignApp| app.session.doc().unwrap().doc.spreads[0].items.len();
+ let undo = |app: &DesignApp| app.session.doc().unwrap().history.undo.len();
+ let (n0, u0) = (items(&app), undo(&app));
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1200.0, 800.0));
+ open(&mut app);
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ for expected in ["Step and Repeat", "Repeat", "Count:", "Create as a grid", "Offset", "Vertical:", "Horizontal:", "Preview", "OK", "Cancel"] {
+ visible_label(&labels, screen, expected);
+ }
+ // Preview: the copies show, and change with the fields, without an undo step.
+ set(&mut app, "count", json!("5"));
+ set(&mut app, "vertical", json!("-0.75 in"));
+ set(&mut app, "horizontal", json!("0"));
+ set(&mut app, "preview", json!(true));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert_eq!((items(&app), undo(&app)), (n0 + 5, u0));
+ set(&mut app, "count", json!("3"));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert_eq!(items(&app), n0 + 3);
+ set(&mut app, "preview", json!(false));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert_eq!(items(&app), n0, "Preview off takes them away");
+ set(&mut app, "preview", json!(true));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert_eq!(items(&app), n0 + 3);
+ // Cancel puts the document back.
+ cancel(&mut app);
+ assert!(app.ui.dialog.is_none());
+ assert_eq!((items(&app), undo(&app)), (n0, u0));
+ // OK after a preview makes the copies once, as one undo step, 0.75 in apart.
+ app.run("selection.set", json!({"ids": [id]})).unwrap();
+ open(&mut app);
+ set(&mut app, "count", json!("2"));
+ set(&mut app, "vertical", json!("-0.75 in"));
+ set(&mut app, "horizontal", json!("0"));
+ set(&mut app, "preview", json!(true));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ let r = confirm(&mut app).unwrap();
+ assert_eq!((items(&app), undo(&app)), (n0 + 2, u0 + 1));
+ let last = r["ids"][1].as_u64().unwrap();
+ let top = app.session.doc().unwrap().doc.item(designcraft_doc::ItemId(last)).unwrap().bounds().min_y();
+ assert!((top - (600.0 - 108.0)).abs() < 1e-6, "{top}");
+ // Create as a grid: Rows × Columns cells, the original being one.
+ app.run("selection.set", json!({"ids": [id]})).unwrap();
+ open(&mut app);
+ set(&mut app, "grid", json!(true));
+ set(&mut app, "rows", json!("2"));
+ set(&mut app, "columns", json!("3"));
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ visible_label(&labels, screen, "Rows:");
+ visible_label(&labels, screen, "Columns:");
+ assert_eq!(confirm(&mut app).unwrap()["created"], 5);
+ // A value that isn't a measure keeps the dialog open and says so.
+ open(&mut app);
+ set(&mut app, "vertical", json!("up"));
+ assert!(confirm(&mut app).is_err());
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert_eq!(d.s("status"), "Invalid value: up");
+ }
+
+ /// A three-page document in `units` with Document Setup open.
+ fn document_setup_app(units: &str) -> DesignApp {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"pages": 3})).unwrap();
+ app.run("document.preferences", json!({"horizontalUnits": units, "verticalUnits": units})).unwrap();
+ crate::menus::activate(&mut app, "layout.documentSetup", &Value::Null);
+ app
+ }
+
+ fn setup_fields(app: &mut DesignApp, fields: Value) {
+ let d = app.ui.dialog.as_mut().unwrap();
+ for (k, v) in fields.as_object().unwrap() {
+ d.fields.insert(k.clone(), v.clone());
+ }
+ }
+
+ /// File › File Info opens filled from the document and OK stores what was typed; Export PDF
+ /// then names the file after the document and takes the PDF's title from File Info.
+ #[test]
+ fn file_info_dialog_stores_the_fields_and_titles_the_pdf() {
+ use std::sync::{Arc, Mutex};
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"title": "flyer-v3"})).unwrap();
+ app.run("file.info", json!({"author": "Ana Ruiz", "keywords": ["spring", "shoes"]})).unwrap();
+ crate::menus::activate(&mut app, "file.info", &Value::Null);
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert_eq!(d.id, "fileInfo");
+ assert_eq!((d.s("documentTitle"), d.s("author"), d.s("keywords")), (String::new(), "Ana Ruiz".into(), "spring; shoes".into()));
+ setup_fields(&mut app, json!({"documentTitle": "Spring Catalog", "author": "", "keywords": "spring, catalog", "description": "Shoes"}));
+ confirm(&mut app).unwrap();
+ assert!(app.ui.dialog.is_none());
+ let info = app.session.active().unwrap().doc.file_info.clone();
+ assert_eq!((info.document_title.as_str(), info.author.as_str(), info.description.as_str()), ("Spring Catalog", "", "Shoes"));
+ assert_eq!(info.keywords, ["spring", "catalog"]);
+ // Keywords left as shown stay as they are, even one with a comma in it.
+ app.run("file.info", json!({"keywords": ["Washington, DC", "map"]})).unwrap();
+ crate::menus::activate(&mut app, "file.info", &Value::Null);
+ setup_fields(&mut app, json!({"author": "Studio"}));
+ confirm(&mut app).unwrap();
+ let info = app.session.active().unwrap().doc.file_info.clone();
+ assert_eq!((info.author.as_str(), info.keywords.clone()), ("Studio", vec!["Washington, DC".to_string(), "map".to_string()]));
+ // Another keyword edited: the one with a comma in it still stays one keyword.
+ crate::menus::activate(&mut app, "file.info", &Value::Null);
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("keywords"), "Washington, DC; map");
+ setup_fields(&mut app, json!({"keywords": "Washington, DC; atlas"}));
+ confirm(&mut app).unwrap();
+ assert_eq!(app.session.active().unwrap().doc.file_info.keywords, ["Washington, DC", "atlas"]);
+
+ let writes: Arc<Mutex<Vec<Vec<u8>>>> = Arc::new(Mutex::new(Vec::new()));
+ let sink = writes.clone();
+ app.services.write = Some(Box::new(move |_: &str, bytes: &[u8]| {
+ sink.lock().unwrap().push(bytes.to_vec());
+ Ok(())
+ }));
+ let names: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(Vec::new()));
+ let asked = names.clone();
+ app.answer_dialogs(move |request| match request {
+ craft_dialogs::Request::File(dialog) => {
+ asked.lock().unwrap().push(dialog.file_name.clone().unwrap_or_default());
+ craft_dialogs::Answer::Paths(vec!["/tmp/designcraft-file-info.pdf".into()])
+ }
+ craft_dialogs::Request::Message(_) => craft_dialogs::Answer::Message(craft_dialogs::MessageResult::Yes),
+ });
+ open_pdf_export(&mut app);
+ confirm(&mut app).unwrap();
+ app.settle_dialogs();
+ assert_eq!(names.lock().unwrap().as_slice(), ["flyer-v3.pdf"]);
+ let pdf = String::from_utf8_lossy(&writes.lock().unwrap()[0]).into_owned();
+ assert!(pdf.contains("/Title(Spring Catalog)") && !pdf.contains("/Title(flyer-v3)"), "the PDF's title is File Info's");
+ // A title given to the export is the PDF's title, even when it is the document's name.
+ open_pdf_export(&mut app);
+ setup_fields(&mut app, json!({"title": "flyer-v3"}));
+ confirm(&mut app).unwrap();
+ app.settle_dialogs();
+ let asked = names.lock().unwrap().last().cloned().unwrap_or_default();
+ assert_eq!(std::path::Path::new(&asked).file_name().and_then(|n| n.to_str()), Some("flyer-v3.pdf"), "{asked}");
+ let pdf = String::from_utf8_lossy(&writes.lock().unwrap()[1]).into_owned();
+ assert!(pdf.contains("/Title(flyer-v3)") && !pdf.contains("/Title(Spring Catalog)"), "the given title wins");
+ }
+
+ /// File Info's OK stores the fields in the document the dialog was opened for, even when
+ /// another document became active meanwhile; once that document has closed, OK stores nothing.
+ #[test]
+ fn file_info_dialog_stores_into_the_document_it_was_opened_for() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"title": "first"})).unwrap();
+ crate::menus::activate(&mut app, "file.info", &Value::Null);
+ app.run("file.new", json!({"title": "second"})).unwrap();
+ setup_fields(&mut app, json!({"author": "Ana Ruiz"}));
+ confirm(&mut app).unwrap();
+ let docs = app.session.documents();
+ let author = |title: &str| docs.iter().find(|d| d.doc.title == title).map(|d| d.doc.file_info.author.clone());
+ assert_eq!((author("first").as_deref(), author("second").as_deref()), (Some("Ana Ruiz"), Some("")));
+ assert_eq!(app.session.active().map(|d| d.doc.title.as_str()), Some("second"), "the active document stays active");
+
+ crate::menus::activate(&mut app, "file.info", &Value::Null);
+ app.run("file.close", json!({})).unwrap();
+ setup_fields(&mut app, json!({"author": "Studio"}));
+ confirm(&mut app).unwrap();
+ assert!(app.session.documents().iter().all(|d| d.doc.file_info.author != "Studio"), "the dialog's document closed");
+ }
+
+ /// File Info opened through `ui.dialog.open` with only some fields stores only those fields;
+ /// the others keep what the document holds.
+ #[test]
+ fn file_info_opened_with_some_fields_keeps_the_others() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("file.info", json!({"documentTitle": "Spring Catalog", "keywords": ["spring", "shoes"]})).unwrap();
+ assert_eq!(ctl(&mut app, "ui.dialog.open", json!({"id": "fileInfo", "fields": {"author": "Ana Ruiz", "description": ""}}))["ok"], true);
+ confirm(&mut app).unwrap();
+ let info = app.session.active().unwrap().doc.file_info.clone();
+ assert_eq!((info.document_title.as_str(), info.author.as_str(), info.description.as_str()), ("Spring Catalog", "Ana Ruiz", ""));
+ assert_eq!(info.keywords, ["spring", "shoes"]);
+ }
+
+ /// Fields given to `ui.dialog.open` as JSON other than text reach `file.info` as they are: a
+ /// keyword list stays a list, and `null` clears a field.
+ #[test]
+ fn file_info_opened_with_a_keyword_list_stores_the_list() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("file.info", json!({"author": "Ana Ruiz"})).unwrap();
+ let fields = json!({"keywords": ["Washington, DC", "map"], "author": null});
+ assert_eq!(ctl(&mut app, "ui.dialog.open", json!({"id": "fileInfo", "fields": fields}))["ok"], true);
+ confirm(&mut app).unwrap();
+ let info = app.session.active().unwrap().doc.file_info.clone();
+ assert_eq!(info.keywords, ["Washington, DC", "map"]);
+ assert_eq!(info.author, "");
+ }
+
+ /// File Info's OK for a document that is not the active one leaves the active document's
+ /// Data Merge preview showing the record it showed.
+ #[test]
+ fn file_info_for_another_document_keeps_the_active_preview() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"title": "first"})).unwrap();
+ crate::menus::activate(&mut app, "file.info", &Value::Null);
+ app.run("file.new", json!({"title": "second"})).unwrap();
+ let csv = designcraft_engine::cmd::base64_encode(b"Name\nAda\nGrace\n");
+ app.run("data.source.select", json!({"bytes": csv, "name": "people.csv"})).unwrap();
+ app.run("data.preview", json!({"record": 2})).unwrap();
+ setup_fields(&mut app, json!({"author": "Ana Ruiz"}));
+ confirm(&mut app).unwrap();
+ let active = app.session.active().unwrap();
+ assert_eq!((active.doc.title.as_str(), active.preview_record), ("second", Some(2)), "the preview still shows record 2");
+ let first = app.session.documents().iter().find(|d| d.doc.title == "first").map(|d| d.doc.file_info.author.clone());
+ assert_eq!(first.as_deref(), Some("Ana Ruiz"));
+ }
+
+ #[test]
+ fn document_setup_ok_applies_margins_bleed_and_size_in_one_step() {
+ let mut app = document_setup_app("millimeters");
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert_eq!(d.id, "documentSetup");
+ assert_eq!((d.s("marginTop"), d.b("marginLinked")), ("12.7 mm".to_string(), true), "the document's margins, in its units");
+ setup_fields(
+ &mut app,
+ json!({"marginTop": "20 mm", "marginBottom": "20 mm", "marginInside": "20 mm", "marginOutside": "20 mm", "bleedTop": "3 mm",
+ "bleedBottom": "3 mm", "bleedInside": "3 mm", "bleedOutside": "3 mm", "width": "210 mm", "height": "297 mm"}),
+ );
+ confirm(&mut app).unwrap();
+ assert!(app.ui.dialog.is_none());
+ let mm = designcraft_geom::units::PT_PER_MM;
+ let doc = &app.session.active().unwrap().doc;
+ assert!((doc.settings.page_width - 210.0 * mm).abs() < 1e-6 && (doc.settings.bleed[2] - 3.0 * mm).abs() < 1e-6);
+ assert!(doc.spreads.iter().flat_map(|s| &s.pages).all(|p| (p.margins.top - 20.0 * mm).abs() < 1e-6), "every page");
+ app.run("edit.undo", json!({})).unwrap();
+ let doc = &app.session.active().unwrap().doc;
+ assert!((doc.settings.page_width - 612.0).abs() < 1e-6 && doc.settings.bleed[0] == 0.0, "one undo step");
+ }
+
+ #[test]
+ fn document_setup_reads_a_bare_number_in_the_documents_units() {
+ let mut app = document_setup_app("millimeters");
+ setup_fields(&mut app, json!({"bleedTop": "5", "bleedBottom": "5", "bleedInside": "5", "bleedOutside": "5", "width": "210"}));
+ confirm(&mut app).unwrap();
+ let mm = designcraft_geom::units::PT_PER_MM;
+ let settings = &app.session.active().unwrap().doc.settings;
+ assert!(settings.bleed.iter().all(|b| (b - 5.0 * mm).abs() < 1e-6), "5 mm, not 5 picas: {:?}", settings.bleed);
+ assert!((settings.page_width - 210.0 * mm).abs() < 1e-6, "{}", settings.page_width);
+ }
+
+ #[test]
+ fn document_setup_keeps_each_pages_margins_unless_they_are_edited() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"pages": 3, "margins": 36})).unwrap();
+ app.run("layout.marginsAndColumns", json!({"pages": [1], "margins": 90})).unwrap();
+ let margins =
+ |app: &DesignApp| app.session.active().unwrap().doc.spreads.iter().flat_map(|s| &s.pages).map(|p| p.margins.top).collect::<Vec<_>>();
+ // Only the page count changes: every page keeps its own margins.
+ crate::menus::activate(&mut app, "layout.documentSetup", &Value::Null);
+ setup_fields(&mut app, json!({"pages": "4"}));
+ confirm(&mut app).unwrap();
+ assert_eq!(margins(&app), [36.0, 90.0, 36.0, 36.0]);
+ // Edited margins go to every page.
+ crate::menus::activate(&mut app, "layout.documentSetup", &Value::Null);
+ setup_fields(&mut app, json!({"marginTop": "1p0"}));
+ confirm(&mut app).unwrap();
+ assert_eq!(margins(&app), [12.0; 4]);
+ }
+
+ #[test]
+ fn document_setup_keeps_a_value_it_cannot_read_and_changes_nothing() {
+ for (key, value) in [("width", "wide"), ("marginTop", "-"), ("pages", "0"), ("bleedTop", "x")] {
+ let mut app = document_setup_app("points");
+ setup_fields(&mut app, json!({key: value, "bleedInside": "9"}));
+ assert!(confirm(&mut app).is_err(), "{key}");
+ assert!(app.ui.dialog.is_some(), "{key}: the dialog stays open");
+ assert_eq!(app.session.active().unwrap().doc.settings.bleed, [0.0; 4], "{key}: nothing changed");
+ }
+ }
+
+ #[test]
+ fn document_setup_links_edges_and_adjust_layout_applies() {
+ let mut app = document_setup_app("points");
+ let f = app.run("frame.create", json!({"rect": [36, 36, 576, 756], "content": "text"})).unwrap();
+ crate::menus::activate(&mut app, "layout.documentSetup", &Value::Null);
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1178.0, 900.0));
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ // Typing in a linked margin sets all four.
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ let top = labels.iter().filter(|(t, _, _)| t == "36 pt").map(|(_, r, _)| *r).next().expect("the top margin");
+ click_dialog(&mut app, &ctx, screen, top.center());
+ let select_all = egui::Event::Key { key: egui::Key::A, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::COMMAND };
+ dialog_frame(&mut app, &ctx, screen, vec![select_all, egui::Event::Text("72 pt".into())]);
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert!(["Top", "Bottom", "Inside", "Outside"].iter().all(|e| d.s(&format!("margin{e}")) == "72 pt"), "linked: {:?}", d.fields);
+ // Adjust Layout applies at once, and the frame follows the margins.
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, "Adjust Layout").center());
+ assert!(app.ui.dialog.is_none(), "applied");
+ let doc = &app.session.active().unwrap().doc;
+ let b = doc.item(designcraft_doc::ItemId(f["id"].as_u64().unwrap())).unwrap().bounds();
+ assert!((b.y0 - 72.0).abs() < 1e-6 && doc.page(0).unwrap().margins.outside == 72.0, "{b:?}");
+ }
+
+ #[test]
+ fn cell_options_dialog_draws_and_applies_only_changed_values_to_the_chosen_edges() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("frame.create", json!({"rect": [72, 72, 400, 400], "content": "text", "caret": true})).unwrap();
+ let tid = app.run("table.insert", json!({"rows": 2, "cols": 2})).unwrap()["table"].as_u64().unwrap();
+ app.run("table.select", json!({"what": "table"})).unwrap();
+ app.run("app.cellOptionsDialog", json!({})).unwrap();
+ let ctx = dialog_context("");
+ dialog_frame(&mut app, &ctx, egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(900.0, 700.0)), vec![]);
+ let d = app.ui.dialog.as_mut().unwrap();
+ assert_eq!(d.id, "cellOptions");
+ assert_eq!(d.fields["weight"], json!(1.0));
+ d.fields.insert("edges".into(), json!(["top", "bottom", "left", "right"]));
+ d.fields.insert("gapColor".into(), json!("[Paper]"));
+ d.fields.insert("fill".into(), json!("[Black]"));
+ d.fields.insert("fillTint".into(), json!(0.2));
+ confirm(&mut app).unwrap();
+ let st = app.session.active().unwrap();
+ let t = st.doc.stories.values().find_map(|s| s.tables.get(&tid)).unwrap();
+ let gap = |r: usize, c: usize, side: usize| t.cell(r, c).unwrap().strokes[side].gap_color.clone();
+ assert_eq!([gap(0, 0, 0), gap(0, 0, 1), gap(1, 1, 2), gap(1, 1, 3)], ["[Paper]"; 4].map(String::from), "outer edges");
+ assert_eq!([gap(0, 0, 2), gap(0, 0, 3)], ["[None]"; 2].map(String::from), "inner edges keep theirs");
+ assert!(t.cells.iter().all(|c| c.fill == "[Black]" && (c.fill_tint - 0.2).abs() < 1e-6));
+ assert!(t.cells.iter().all(|c| c.strokes.iter().all(|e| e.weight == 1.0)), "unchanged values are not applied");
+ }
+
+ #[test]
+ fn cell_options_edge_changes_reseed_every_stroke_field_and_survive_a_bad_seed() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("frame.create", json!({"rect": [72, 72, 400, 400], "content": "text", "caret": true})).unwrap();
+ let tid = app.run("table.insert", json!({"rows": 2, "cols": 2})).unwrap()["table"].as_u64().unwrap();
+ app.run("table.select", json!({"what": "table"})).unwrap();
+ app.run("table.setCell", json!({"stroke": {"weight": 3, "edges": "innerHorizontal"}})).unwrap();
+ app.run("app.cellOptionsDialog", json!({})).unwrap();
+ let mut d = app.ui.dialog.take().unwrap();
+ d.fields.insert("seed".into(), json!(5));
+ let outer = [true, true, true, true, false, false];
+ cell_options_edges_changed(&mut app, &mut d, &outer);
+ assert_eq!((&d.fields["weight"], &d.fields["seed"]["weight"]), (&json!(1.0), &json!(1.0)));
+ // A weight typed for the outer edges, then the inner horizontal edges (3 pt) chosen
+ // and 1 pt typed: 1 pt differs from what those edges show, so OK applies it.
+ d.fields.insert("weight".into(), json!(5.0));
+ cell_options_edges_changed(&mut app, &mut d, &[false, false, false, false, true, false]);
+ assert_eq!((&d.fields["weight"], &d.fields["seed"]["weight"]), (&json!(5.0), &json!(3.0)));
+ d.fields.insert("weight".into(), json!(1.0));
+ app.ui.dialog = Some(d);
+ confirm(&mut app).unwrap();
+ let st = app.session.active().unwrap();
+ let t = st.doc.stories.values().find_map(|s| s.tables.get(&tid)).unwrap();
+ assert_eq!([t.cell(0, 0).unwrap().strokes[2].weight, t.cell(1, 1).unwrap().strokes[0].weight], [1.0; 2]);
+ }
+
+ #[test]
+ fn preferences_ok_saves_a_story_editor_size_that_loads_back() {
+ // `ui.dialog.set` takes any value; a size that isn't finite is saved as `null`.
+ let sizes = [(json!("nan"), 20.0), (json!("inf"), 20.0), (json!(null), 20.0), (json!(1e39), 36.0), (json!(3), 8.0), (json!(11), 11.0)];
+ for (size, want) in sizes {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.ui.story_editor_size = 20.0;
+ app.run("app.preferences", json!({})).unwrap();
+ app.ui.dialog.as_mut().unwrap().fields.insert("storyEditorSize".into(), size);
+ confirm(&mut app).unwrap();
+ let saved = serde_json::to_vec(&app.ui).unwrap();
+ assert_eq!(crate::UiState::from_preferences_json(&saved).unwrap().story_editor_size, want);
+ }
+ }
+
+ #[test]
+ fn preferences_ok_sets_only_the_ruler_units_it_is_given() {
+ // `ui.dialog.open` takes any fields, so the vertical units can be missing.
+ for (vertical, want) in [(None, "inches"), (Some("points"), "points")] {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("document.preferences", json!({"verticalUnits": "inches"})).unwrap();
+ let mut fields = json!({"horizontalUnits": "millimeters", "bg.relativeTo": "topOfPage"});
+ if let Some(vertical) = vertical {
+ fields["verticalUnits"] = json!(vertical);
+ }
+ app.ui.dialog = Some(Dialog::new("preferences", fields));
+ confirm(&mut app).unwrap();
+ let units = app.run("document.preferences", json!({})).unwrap();
+ assert_eq!((units["horizontalUnits"].as_str(), units["verticalUnits"].as_str()), (Some("millimeters"), Some(want)));
+ }
+ }
+
+ #[test]
+ fn enter_and_escape_close_the_style_menu_not_numbering_and_section_options() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"pages": 2})).unwrap();
+ crate::menus::activate(&mut app, "layout.section", &Value::Null);
+ let ctx = dialog_context("en");
+ 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 key = |key| egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE };
+ for pressed in [egui::Key::Enter, egui::Key::Escape] {
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ // The section's Style menu (the first of the two).
+ let style = labels.iter().filter(|(t, r, c)| t.trim() == "1, 2, 3, 4…" && c.contains_rect(*r)).map(|(_, r, _)| *r).next().unwrap();
+ click_dialog(&mut app, &ctx, screen, style.center());
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert!(egui::Popup::is_any_open(&ctx), "the Style menu opened");
+ dialog_frame(&mut app, &ctx, screen, vec![key(pressed)]);
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert!(app.ui.dialog.is_some(), "{pressed:?} with the menu open leaves the dialog open");
+ assert!(app.session.active().unwrap().doc.sections.iter().all(|s| s.start_number != Some(0)));
+ if egui::Popup::is_any_open(&ctx) {
+ egui::Popup::close_all(&ctx);
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ }
+ // With no menu open, Escape closes the dialog.
+ dialog_frame(&mut app, &ctx, screen, vec![key(egui::Key::Escape)]);
+ assert!(app.ui.dialog.is_none());
+ }
+
+ #[test]
+ fn numbering_and_section_options_keep_their_actions_in_view() {
+ for language in ["en", "ar"] {
+ for size in [egui::vec2(1178.0, 814.0), egui::vec2(392.0, 271.0)] {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.ui.language = language.into();
+ app.run("file.new", json!({"pages": 2})).unwrap();
+ crate::menus::activate(&mut app, "layout.section", &Value::Null);
+ 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![]);
+ let tr = |s| crate::i18n::tr(language, s);
+ for expected in [tr("Numbering & Section Options…").trim_end_matches('…'), tr("OK"), tr("Cancel"), tr("Start Section")] {
+ visible_label(&labels, screen, expected);
+ }
+ if size.x > 1000.0 {
+ // Every option fits without scrolling, and choosing one then OK applies it.
+ visible_label(&labels, screen, &format!("{} {}", tr("Book Name:"), tr("N/A")));
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, tr("Automatic Page Numbering")).center());
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, tr("OK")).center());
+ assert!(app.ui.dialog.is_none(), "{language}: OK closes the dialog");
+ let doc = &app.session.active().unwrap().doc;
+ assert!(doc.sections.iter().all(|s| s.start != 0 || s.start_number.is_none()), "{language}: page 1 numbers automatically");
+ }
+ }
+ }
+ }
+
+ fn select_all_key() -> egui::Event {
+ egui::Event::Key {
+ key: egui::Key::A,
+ physical_key: None,
+ pressed: true,
+ repeat: false,
+ modifiers: egui::Modifiers { ctrl: true, command: true, ..Default::default() },
+ }
+ }
+
+ /// The Color Picker over a new document's selected frame, a few frames in.
+ fn picker(fields: Value) -> (DesignApp, egui::Context, egui::Rect, u64) {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ let id = app.run("frame.create", json!({"rect": [36, 36, 200, 200]})).unwrap()["id"].as_u64().unwrap();
+ app.run("selection.set", json!({"ids": [id]})).unwrap();
+ app.ui.dialog = Some(Dialog::new("colorPicker", fields));
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(700.0, 500.0));
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ (app, ctx, screen, id)
+ }
+
+ /// The rightmost painted `text`: the picker's own field, right of egui's colour editor (which
+ /// has R/G/B fields of its own).
+ fn rightmost(labels: &[(String, egui::Rect, egui::Rect)], text: &str) -> egui::Pos2 {
+ labels
+ .iter()
+ .filter(|(t, _, _)| t.trim() == text)
+ .map(|(_, r, _)| r.center())
+ .max_by(|a, b| a.x.total_cmp(&b.x))
+ .unwrap_or_else(|| panic!("{text} is painted"))
+ }
+
+ /// Types `text` one character per frame, with an idle frame after each.
+ fn type_slowly(app: &mut DesignApp, ctx: &egui::Context, screen: egui::Rect, text: &str) {
+ for ch in text.chars() {
+ dialog_frame(app, ctx, screen, vec![egui::Event::Text(ch.into())]);
+ dialog_frame(app, ctx, screen, vec![]);
+ }
+ }
+
+ fn fill(app: &DesignApp, id: u64) -> designcraft_color::Color {
+ let d = &app.session.active().unwrap().doc;
+ d.resolve_color(&d.item(designcraft_doc::ItemId(id)).unwrap().fill.swatch, 1.0).unwrap()
+ }
+
+ #[test]
+ fn the_hex_field_keeps_typed_text_and_commits_a_valid_code() {
+ let (mut app, ctx, screen, _) = picker(json!({"target": "fill", "hex": "#ffffff"}));
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, "ffffff").center());
+ dialog_frame(&mut app, &ctx, screen, vec![select_all_key()]);
+ type_slowly(&mut app, &ctx, screen, "#f5");
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert_eq!((d.s("hexEdit").as_str(), d.s("hex").as_str()), ("#f5", "#ffffff"), "half-typed text stays; the colour waits");
+ type_slowly(&mut app, &ctx, screen, "9019");
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert_eq!((d.s("hexEdit").as_str(), d.s("hex").as_str()), ("#f59019", "#f59019"), "a 7-character #rrggbb commits");
+ // Invalid text is replaced by the colour when focus leaves.
+ dialog_frame(&mut app, &ctx, screen, vec![select_all_key()]);
+ type_slowly(&mut app, &ctx, screen, "zz");
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, "#").center());
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ visible_label(&labels, screen, "f59019");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("hex"), "#f59019");
+ }
+
+ #[test]
+ fn typed_channel_values_are_kept_while_typing() {
+ let (mut app, ctx, screen, id) = picker(json!({"target": "fill", "hex": "#010203", "model": "rgb", "rgb": [1, 2, 3]}));
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, rightmost(&labels, "1"));
+ dialog_frame(&mut app, &ctx, screen, vec![select_all_key()]);
+ type_slowly(&mut app, &ctx, screen, "12.5");
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert!(rightmost(&labels, "12.5").x > rightmost(&labels, "2").x - 1.0, "the typed text stays in the R field");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("hex"), "#0d0203");
+ confirm(&mut app).unwrap();
+ let designcraft_color::Color::Rgb { r, .. } = fill(&app, id) else { panic!("not RGB") };
+ assert!((r - 12.5 / 255.0).abs() < 1e-6, "{r}");
+ }
+
+ #[test]
+ fn a_cmyk_colour_stays_cmyk_unless_rgb_values_are_typed() {
+ let cmyk = json!({"target": "fill", "hex": "#ff8000", "model": "cmyk", "cmyk": [0, 50, 100, 0]});
+ // Picked by hex: converted to CMYK.
+ let (mut app, ctx, screen, id) = picker(cmyk.clone());
+ let hex = app.ui.dialog.as_ref().unwrap().s("hex");
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, hex.trim_start_matches('#')).center());
+ dialog_frame(&mut app, &ctx, screen, vec![select_all_key()]);
+ type_slowly(&mut app, &ctx, screen, "3366cc");
+ confirm(&mut app).unwrap();
+ assert!(matches!(fill(&app, id), designcraft_color::Color::Cmyk { .. }), "{:?}", fill(&app, id));
+ // A typed C/M/Y/K percent is a percent: M 1 is 1 %.
+ let (mut app, ctx, screen, id) = picker(cmyk.clone());
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, rightmost(&labels, "50"));
+ dialog_frame(&mut app, &ctx, screen, vec![select_all_key()]);
+ type_slowly(&mut app, &ctx, screen, "1");
+ confirm(&mut app).unwrap();
+ let designcraft_color::Color::Cmyk { c, m, y, k } = fill(&app, id) else { panic!("not CMYK") };
+ assert!(c == 0.0 && (m - 0.01).abs() < 1e-6 && (y - 1.0).abs() < 1e-6 && k == 0.0, "{c} {m} {y} {k}");
+ // Typed R/G/B values: RGB.
+ let (mut app, ctx, screen, id) = picker(cmyk);
+ let r = app.ui.dialog.as_ref().unwrap().fields["rgb"][0].as_f64().unwrap();
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, rightmost(&labels, &r.to_string()));
+ dialog_frame(&mut app, &ctx, screen, vec![select_all_key()]);
+ type_slowly(&mut app, &ctx, screen, "10");
+ confirm(&mut app).unwrap();
+ assert!(matches!(fill(&app, id), designcraft_color::Color::Rgb { .. }), "{:?}", fill(&app, id));
+ }
+
+ #[test]
+ fn ok_without_edits_leaves_the_fill_alone() {
+ let (mut app, _, _, id) = picker(json!({"target": "fill", "hex": "#ff8000", "model": "cmyk", "cmyk": [0, 50, 100, 0]}));
+ let before = app.session.active().unwrap().doc.item(designcraft_doc::ItemId(id)).unwrap().fill.clone();
+ confirm(&mut app).unwrap();
+ assert_eq!(app.session.active().unwrap().doc.item(designcraft_doc::ItemId(id)).unwrap().fill, before);
+ }
+
+ #[test]
+ fn dialogs_do_not_dim_the_page() {
+ let (mut app, ctx, screen, _) = picker(json!({"target": "fill", "hex": "#ff8000"}));
+ let time = ctx.input(|i| i.time) + 1.0 / 60.0;
+ let output = ctx.run_ui(egui::RawInput { screen_rect: Some(screen), time: Some(time), ..Default::default() }, |ui| show(&mut app, ui.ctx()));
+ fn covers(shape: &egui::Shape, screen: egui::Rect) -> bool {
+ match shape {
+ egui::Shape::Rect(r) => r.rect.contains_rect(screen) && r.fill.a() > 0,
+ egui::Shape::Vec(v) => v.iter().any(|s| covers(s, screen)),
+ _ => false,
+ }
+ }
+ assert!(app.ui.dialog.is_some());
+ assert!(!output.shapes.iter().any(|s| covers(&s.shape, screen)), "nothing paints over the whole window");
+ }
+
+ fn draw(app: &mut DesignApp, ctx: &egui::Context) {
+ let input = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1400.0, 900.0))), ..Default::default() };
+ let mut out = ctx.run_ui(input, |ui| {
+ app.logic(&ui.ctx().clone());
+ app.ui(ui);
+ });
+ out.textures_delta.clear();
+ }
+
+ /// A paragraph styled "Ruled Child", whose Rule Below comes from its parent "Ruled".
+ fn ruled_paragraph() -> (DesignApp, Value) {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ let rule = json!({"on": true, "weight": 3.0, "color": "[Black]", "tint": 0.5, "columnWidth": false, "offset": 4.0, "leftIndent": 6.0, "rightIndent": 2.0});
+ app.run("style.paragraph.create", json!({"name": "Ruled", "para": {"ruleBelow": rule}})).unwrap();
+ app.run("style.paragraph.create", json!({"name": "Ruled Child", "basedOn": "Ruled"})).unwrap();
+ let r = app.run("frame.create", json!({"rect": [72, 72, 300, 400], "content": "text", "text": "One"})).unwrap();
+ app.run("text.select", json!({"story": r["story"], "anchor": 0, "focus": 0})).unwrap();
+ app.run("style.paragraph.apply", json!({"name": "Ruled Child"})).unwrap();
+ (app, rule)
+ }
+
+ fn undo_steps(app: &DesignApp) -> usize {
+ app.session.doc().map_or(0, |st| st.history.undo.len())
+ }
+
+ #[test]
+ fn paragraph_rules_dialog_shows_the_rule_and_applies_one_field() {
+ let (mut app, rule) = ruled_paragraph();
+ let ctx = egui::Context::default();
+ app.run("app.paragraphRulesDialog", json!({"rule": "ruleBelow"})).unwrap();
+ draw(&mut app, &ctx);
+ let d = app.ui.dialog.clone().unwrap();
+ assert_eq!(d.id, "paragraphRules");
+ let current = d.fields["current"].clone();
+ assert_eq!(shown_rule(&d, "", "ruleBelow", &current), rule, "the inherited rule");
+ assert_eq!(shown_rule(&d, "", "ruleAbove", &current)["on"], false);
+ // Pick a colour, as the Color menu does.
+ app.ui.dialog.as_mut().unwrap().fields.insert("ruleBelow.color".into(), json!("[Registration]"));
+ draw(&mut app, &ctx);
+ let before = undo_steps(&app);
+ confirm(&mut app).unwrap();
+ assert_eq!(undo_steps(&app), before + 1, "one undo step");
+ let mut want = rule.clone();
+ want["color"] = json!("[Registration]");
+ assert_eq!(app.run("type.selectionAttrs", json!({})).unwrap()["para"]["ruleBelow"], want);
+ app.run("edit.undo", json!({})).unwrap();
+ assert_eq!(app.run("type.selectionAttrs", json!({})).unwrap()["para"]["ruleBelow"], rule);
+ }
+
+ #[test]
+ fn paragraph_style_options_edit_one_rule_field() {
+ let (mut app, rule) = ruled_paragraph();
+ let ctx = egui::Context::default();
+ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": "Ruled Child", "section": "rules", "rule": "ruleBelow"})));
+ draw(&mut app, &ctx);
+ let resolved = |app: &DesignApp| serde_json::to_value(app.session.doc().unwrap().doc.styles.resolve_para_style("Ruled Child").0).unwrap();
+ let d = app.ui.dialog.clone().unwrap();
+ assert_eq!(shown_rule(&d, "p.", "ruleBelow", &resolved(&app)), rule, "inherited from the parent style");
+ app.ui.dialog.as_mut().unwrap().fields.insert("p.ruleBelow.weight".into(), json!(1.5));
+ draw(&mut app, &ctx);
+ let before = undo_steps(&app);
+ confirm(&mut app).unwrap();
+ assert_eq!(undo_steps(&app), before + 1, "one undo step");
+ let mut want = rule.clone();
+ want["weight"] = json!(1.5);
+ assert_eq!(resolved(&app)["ruleBelow"], want);
+ assert_eq!(app.run("type.selectionAttrs", json!({})).unwrap()["para"]["ruleBelow"], want, "the paragraph follows its style");
+ app.run("edit.undo", json!({})).unwrap();
+ assert_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_ignore_optical_margin_is_set_on_ok() {
+ use egui_kittest::{Harness, kittest::Queryable};
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("style.paragraph.create", json!({"name": "Flush"})).unwrap();
+ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": "Flush", "section": "indents"})));
+ let mut h = Harness::builder().with_size(egui::vec2(1000.0, 800.0)).build_ui_state(
+ |ui, app: &mut DesignApp| {
+ let key = egui::Id::unique("ignore_optical_margin_fonts");
+ if ui.data(|d| d.get_temp::<bool>(key)).is_none() {
+ crate::theme::install_fonts(ui.ctx(), "");
+ ui.data_mut(|d| d.insert_temp(key, true));
+ return;
+ }
+ show(app, ui.ctx());
+ },
+ app,
+ );
+ h.run_steps(3);
+ h.get_by_label("Ignore Optical Margin").click();
+ h.run_steps(3);
+ h.get_by_label(" OK ").click();
+ h.run_steps(3);
+ let app = h.state();
+ assert!(app.ui.dialog.is_none());
+ assert_eq!(app.session.doc().unwrap().doc.styles.para("Flush").unwrap().para.ignore_optical_margin, Some(true));
+ }
+
+ #[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);
+ }
+
+ #[test]
+ fn paragraph_style_options_show_a_refused_rename_on_general_and_trim_a_new_name() {
+ let (mut app, _) = ruled_paragraph();
+ let ctx = egui::Context::default();
+ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": "Ruled", "section": "rules"})));
+ draw(&mut app, &ctx);
+ app.ui.dialog.as_mut().unwrap().fields.insert("rename".into(), json!("Ruled Child"));
+ let e = confirm(&mut app).unwrap_err();
+ let d = app.ui.dialog.clone().expect("the dialog stays open");
+ assert_eq!(d.s("section"), "general", "the name field is on General");
+ assert!(d.s("status").contains("already exists"), "{e}");
+
+ app.ui.dialog.as_mut().unwrap().fields.insert("rename".into(), json!(" Fresh "));
+ app.ui.dialog.as_mut().unwrap().fields.insert("x.tag".into(), json!("h3"));
+ confirm(&mut app).unwrap();
+ let st = &app.session.doc().unwrap().doc.styles;
+ assert!(st.para("Fresh").is_some());
+ assert_eq!(st.export_tag("Fresh", false).map(|t| t.tag.as_str()), Some("h3"));
+ }
+
+ /// 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()
+ }
+
+ /// The hyphenation video (Graphd Tutorials, 0:39–1:13): the Paragraph panel menu's
+ /// Hyphenation… opens InDesign's Hyphenation Settings for the selected paragraphs. Preview
+ /// shows the slider moved to Fewer Hyphens on the page without an undo step, OK makes it one
+ /// step on the selected paragraph only, and Cancel puts it back.
+ #[test]
+ fn hyphenation_settings_preview_apply_and_cancel_on_the_selected_paragraph() {
+ let (mut app, story) = two_paragraphs();
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1400.0, 900.0));
+ let sid = designcraft_doc::StoryId(story.as_u64().unwrap());
+ let weight = |app: &DesignApp, para: usize| {
+ let d = &app.session.doc().unwrap().doc;
+ d.styles.resolve_para(&d.story(sid).unwrap().paras[para]).0.hyph_weight
+ };
+ assert!(crate::menus::menu_enabled(&app, "app.hyphenationDialog"));
+ app.run("app.hyphenationDialog", json!({})).unwrap();
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ let d = app.ui.dialog.clone().unwrap();
+ assert_eq!(
+ (d.id.as_str(), d.fields["current"]["hyphWeight"].as_f64(), d.fields["current"]["hyphenate"].as_bool()),
+ ("hyphenation", Some(0.5), Some(true))
+ );
+ for label in [
+ "Hyphenation Settings",
+ "Hyphenate",
+ "Words with at Least:",
+ "letters",
+ "Hyphen Limit:",
+ "hyphens",
+ "Hyphenation Zone:",
+ "Better Spacing",
+ "Fewer Hyphens",
+ "Hyphenate Capitalized Words",
+ "Hyphenate Last Word",
+ "Hyphenate Across Column",
+ "Preview",
+ ] {
+ assert!(labels.iter().any(|(t, _, _)| t == label), "{label}: {labels:?}");
+ }
+ // Fewer Hyphens (9 of 10) with Preview: on the page, no undo step.
+ let before = undo_steps(&app);
+ let d = app.ui.dialog.as_mut().unwrap();
+ d.fields.insert("hyphWeight".into(), json!(0.9));
+ d.fields.insert("preview".into(), json!(true));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert_eq!(weight(&app, 0), 0.9, "previewed");
+ assert_eq!(undo_steps(&app), before, "a preview is no step");
+ // Cancel: back as it was.
+ cancel(&mut app);
+ assert_eq!(weight(&app, 0), 0.5);
+ // Again, and OK: one step, the selected paragraph only.
+ app.run("app.hyphenationDialog", json!({})).unwrap();
+ let d = app.ui.dialog.as_mut().unwrap();
+ d.fields.insert("hyphWeight".into(), json!(0.9));
+ d.fields.insert("preview".into(), json!(true));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ confirm(&mut app).unwrap();
+ assert_eq!((weight(&app, 0), weight(&app, 1)), (0.9, 0.5));
+ assert_eq!(undo_steps(&app), before + 1, "one undo step");
+ // Paragraph Style Options › Hyphenation has the same form.
+ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": designcraft_doc::story::BASIC_PARAGRAPH, "section": "hyph"})));
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ for label in ["Hyphenation Zone:", "Better Spacing", "Fewer Hyphens", "Hyphenate Last Word", "Hyphenate Across Column"] {
+ assert!(labels.iter().any(|(t, _, _)| t == label), "style options: {label}");
+ }
+ app.ui.dialog = None;
+ app.run("edit.deselectAll", json!({})).unwrap();
+ assert!(!crate::menus::menu_enabled(&app, "app.hyphenationDialog"), "no paragraph");
+ }
+
+ /// Hyphenate differs across the selection: it shows mixed, and the first click turns it on for
+ /// all. Settings the command refuses show why: a preview goes back and isn't retried until they
+ /// change, and OK keeps the dialog open.
+ /// A mixed Better Spacing ↔ Fewer Hyphens slider: a click on its middle step sets every
+ /// selected paragraph to it, though the knob already sat there.
+ #[test]
+ fn hyphenation_settings_mixed_slider_click_sets_the_step() {
+ let (mut app, story) = two_paragraphs();
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1400.0, 900.0));
+ app.run("type.para", json!({"attrs": {"hyphWeight": 0.2}})).unwrap();
+ app.run("text.select", json!({"story": story, "anchor": 0, "focus": 7})).unwrap();
+ app.run("app.hyphenationDialog", json!({})).unwrap();
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ let rect = |l: &str| labels.iter().find(|(t, _, _)| t == l).map(|(_, r, _)| *r).unwrap();
+ let (better, fewer) = (rect("Better Spacing"), rect("Fewer Hyphens"));
+ click_dialog(&mut app, &ctx, screen, egui::pos2((better.right() + fewer.left()) / 2.0, better.center().y));
+ assert_eq!(app.ui.dialog.as_ref().unwrap().fields.get("hyphWeight"), Some(&json!(0.5)));
+ }
+
+ #[test]
+ fn hyphenation_settings_mixed_checkbox_and_refused_settings() {
+ let (mut app, story) = two_paragraphs();
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1400.0, 900.0));
+ app.run("type.para", json!({"attrs": {"hyphenate": false}})).unwrap();
+ app.run("text.select", json!({"story": story, "anchor": 0, "focus": 7})).unwrap();
+ app.run("app.hyphenationDialog", json!({})).unwrap();
+ assert!(app.ui.dialog.as_ref().unwrap().fields["current"]["hyphenate"].is_null(), "mixed");
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ let at = labels.iter().find(|(t, _, _)| t == "Hyphenate").map(|(_, r, _)| r.left_center() - egui::vec2(10.0, 0.0)).unwrap();
+ click_dialog(&mut app, &ctx, screen, at);
+ assert_eq!(app.ui.dialog.as_ref().unwrap().fields.get("hyphenate"), Some(&json!(true)), "the first click turns it on");
+ // A refused setting (as a control-channel caller could send it): no preview, the reason.
+ let before = undo_steps(&app);
+ let d = app.ui.dialog.as_mut().unwrap();
+ d.fields.insert("hyphWeight".into(), json!("heavy"));
+ d.fields.insert("preview".into(), json!(true));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert!(!d.fields.contains_key(PREVIEWED) && d.fields.contains_key("status"), "{:?}", d.fields);
+ assert!(app.session.doc().unwrap().interaction.is_none(), "the preview went back");
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert!(app.session.doc().unwrap().interaction.is_none(), "not tried again");
+ // OK with it: an error, and the dialog stays open with the reason.
+ assert!(confirm(&mut app).is_err());
+ let d = app.ui.dialog.as_ref().expect("the dialog stays open");
+ assert!(d.fields.contains_key("status"));
+ assert_eq!(undo_steps(&app), before);
+ // Corrected, it previews and applies.
+ app.ui.dialog.as_mut().unwrap().fields.insert("hyphWeight".into(), json!(0.9));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ assert!(!app.ui.dialog.as_ref().unwrap().fields.contains_key("status"));
+ confirm(&mut app).unwrap();
+ assert_eq!(para_attr(&mut app, &story, 0, "hyphenate"), true);
+ assert_eq!(para_attr(&mut app, &story, 4, "hyphWeight"), 0.9);
+ }
+
+ #[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 {
+ 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);
+ }
+ // `primaryTextFrame` is documented since #776, so the dialog passes it on (`status` isn't).
+ assert!(doc.spreads.iter().any(|s| !s.items.is_empty()), "documented fields reach the command");
+ 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 style_options_preview_choice_is_remembered_on_reopen() {
+ use egui_kittest::{Harness, kittest::Queryable};
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("style.paragraph.create", json!({"name":"Tutorial","chars":{"size":10}})).unwrap();
+ open_style_options(&mut app, true, "Tutorial");
+ let mut h = Harness::builder().with_size(egui::vec2(1000.0, 800.0)).build_ui_state(
+ |ui, app: &mut DesignApp| {
+ let key = egui::Id::unique("style_preview_remember_fonts");
+ if ui.data(|d| d.get_temp::<bool>(key)).is_none() {
+ crate::theme::install_fonts(ui.ctx(), "");
+ ui.data_mut(|d| d.insert_temp(key, true));
+ return;
+ }
+ show(app, ui.ctx());
+ },
+ app,
+ );
+ h.run_steps(3);
+ h.get_by_label("Preview").click();
+ h.run_steps(3);
+ cancel(h.state_mut());
+ open_style_options(h.state_mut(), true, "Tutorial");
+ assert!(h.state().ui.dialog.as_ref().unwrap().b("preview"), "Preview stays checked on reopen");
+ }
+
+ #[test]
+ fn style_options_preview_updates_all_uses_cancels_and_commits_once() {
+ use egui_kittest::{Harness, kittest::Queryable};
+ for paragraph in [true, false] {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ let f = app.run("frame.create", json!({"rect":[36,36,300,300],"content":"text","text":"First\nSecond"})).unwrap();
+ app.run("text.select", json!({"story":f["story"],"anchor":0,"focus":12})).unwrap();
+ let kind = if paragraph { "paragraph" } else { "character" };
+ app.run(&format!("style.{kind}.create"), json!({"name":"Tutorial","chars":{"size":10}})).unwrap();
+ app.run(&format!("style.{kind}.apply"), json!({"name":"Tutorial"})).unwrap();
+ let before = app.session.doc().unwrap().doc.clone();
+ let undo = app.session.doc().unwrap().history.undo.len();
+ let journal = app.session.journal.len();
+ open_style_options(&mut app, paragraph, "Tutorial");
+ let mut h = Harness::builder().with_size(egui::vec2(1000.0, 800.0)).build_ui_state(
+ |ui, app: &mut DesignApp| {
+ let key = egui::Id::unique("style_preview_test_fonts");
+ if ui.data(|d| d.get_temp::<bool>(key)).is_none() {
+ crate::theme::install_fonts(ui.ctx(), "");
+ ui.data_mut(|d| d.insert_temp(key, true));
+ return;
+ }
+ show(app, ui.ctx());
+ },
+ app,
+ );
+ h.run_steps(3);
+ h.get_by_label("Preview").click();
+ h.run_steps(3);
+ h.state_mut().ui.dialog.as_mut().unwrap().fields.insert("c.size".into(), json!(18));
+ h.run_steps(3);
+ let app = h.state_mut();
+ assert_eq!(app.run("type.selectionAttrs", json!({})).unwrap()["chars"]["size"], 18.0);
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), undo);
+ assert_eq!(app.session.journal.len(), journal);
+ // Repeated previews replace each other, never accumulate undo entries.
+ app.ui.dialog.as_mut().unwrap().fields.insert("c.size".into(), json!(20));
+ h.run_steps(3);
+ assert_eq!(h.state_mut().run("type.selectionAttrs", json!({})).unwrap()["chars"]["size"], 20.0);
+ h.get_by_label("Preview").click();
+ h.run_steps(3);
+ assert_eq!(h.state().session.doc().unwrap().doc, before);
+ h.get_by_label("Preview").click();
+ h.run_steps(3);
+ cancel(h.state_mut());
+ assert_eq!(h.state().session.doc().unwrap().doc, before);
+ assert_eq!(h.state().session.doc().unwrap().history.undo.len(), undo);
+ open_style_options(h.state_mut(), paragraph, "Tutorial");
+ let d = h.state_mut().ui.dialog.as_mut().unwrap();
+ d.fields.insert("preview".into(), json!(true));
+ d.fields.insert("c.size".into(), json!(24));
+ h.run_steps(3);
+ confirm(h.state_mut()).unwrap();
+ assert_eq!(h.state().session.doc().unwrap().history.undo.len(), undo + 1);
+ // Both paragraphs/character runs still use the globally edited definition.
+ for pos in [0, 6] {
+ h.state_mut().run("text.select", json!({"story":f["story"],"anchor":pos,"focus":pos+1})).unwrap();
+ assert_eq!(h.state_mut().run("type.selectionAttrs", json!({})).unwrap()["chars"]["size"], 24.0);
+ }
+ h.state_mut().run("edit.undo", json!({})).unwrap();
+ assert_eq!(h.state().session.doc().unwrap().doc, before);
+ }
+ }
+
+ #[test]
+ fn style_preview_refuses_justification_spacing_ok_would_refuse() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ let before = app.session.doc().unwrap().doc.clone();
+ let mut d = Dialog::new("paragraphStyleOptions", json!({"name": designcraft_doc::BASIC_PARAGRAPH, "preview": true, "p.wordSpaceDesired": 1.1}));
+ style_options_preview(&mut app, &mut d);
+ assert_ne!(app.session.doc().unwrap().doc, before, "a valid value previews");
+ // Minimum above Desired: the page goes back and the dialog says why.
+ d.fields.insert("p.wordSpaceMin".into(), json!(1.5));
+ style_options_preview(&mut app, &mut d);
+ assert_eq!(app.session.doc().unwrap().doc, before);
+ assert!(d.s("status").contains("Word Spacing"), "{:?}", d.fields.get("status"));
+ assert!(app.session.doc().unwrap().interaction.is_none());
+ }
+
+ #[test]
+ fn invalid_style_preview_leaves_the_starting_document_and_can_be_cancelled() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("style.character.create", json!({"name":"Emphasis"})).unwrap();
+ let before = app.session.doc().unwrap().doc.clone();
+ let mut d = Dialog::new("characterStyleOptions", json!({"name":"Emphasis","preview":true,"basedOn":"Emphasis"}));
+ style_options_preview(&mut app, &mut d);
+ assert!(d.fields.contains_key("status"));
+ assert_eq!(app.session.doc().unwrap().doc, before);
+ app.ui.dialog = Some(d);
+ cancel(&mut app);
+ assert_eq!(app.session.doc().unwrap().doc, before);
+ assert!(app.session.doc().unwrap().interaction.is_none());
+ }
+
+ #[test]
+ fn style_preview_rejects_conflicting_scalar_and_nested_rule_fields_without_panicking() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ let before = app.session.doc().unwrap().doc.clone();
+ let mut dialog = Dialog::new(
+ "paragraphStyleOptions",
+ json!({
+ "name": designcraft_doc::BASIC_PARAGRAPH, "preview": true,
+ "p.ruleAbove": false, "p.ruleAbove.weight": 2
+ }),
+ );
+ style_options_preview(&mut app, &mut dialog);
+ assert!(dialog.fields.contains_key("status"));
+ assert_eq!(app.session.doc().unwrap().doc, before);
+ app.ui.dialog = Some(dialog);
+ cancel(&mut app);
+ assert!(app.session.doc().unwrap().interaction.is_none());
+ }
+
+ #[test]
+ fn text_frame_options_set_columns_baseline_and_wrap_as_indesign_does() {
+ let mut app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ // A 300 pt frame, 2 columns, 12 pt gutter (picas in the dialog).
+ 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, "gutter": 12})).unwrap();
+ let opts = |app: &DesignApp| app.session.doc().unwrap().doc.item(id).unwrap().text_frame().unwrap().options.clone();
+ let mut d = Dialog::new("textFrameOptions", json!({}));
+ seed_text_frame_options(&app, &mut d);
+ // Fixed Number shows each column's width: (300 - 12) / 2 = 144 pt.
+ assert_eq!((d.s("columnsKind"), d.s("columnWidth"), d.s("firstBaseline")), ("fixedNumber".into(), "12p0".into(), "ascent".into()));
+ for (k, v) in [
+ ("columnsKind", json!("fixedWidth")),
+ ("columnWidth", json!("10p0")),
+ ("firstBaseline", json!("capHeight")),
+ ("firstBaselineMin", json!("0p6")),
+ ("balanceColumns", json!(true)),
+ ("ignoreWrap", json!(true)),
+ ] {
+ d.fields.insert(k.into(), v);
+ }
+ app.ui.dialog = Some(d);
+ confirm(&mut app).unwrap();
+ let o = opts(&app);
+ assert_eq!(o.columns_kind, designcraft_doc::ColumnsKind::FixedWidth);
+ assert_eq!((o.column_width, o.first_baseline_min, o.columns), (120.0, 6.0, 2));
+ assert_eq!(o.first_baseline, designcraft_doc::FirstBaseline::CapHeight);
+ assert!(o.balance_columns && o.ignore_wrap);
+ // Fixed Number again: the width isn't sent.
+ let mut d = Dialog::new("textFrameOptions", json!({}));
+ seed_text_frame_options(&app, &mut d);
+ assert_eq!(d.s("columnWidth"), "10p0", "Fixed Width shows its own width");
+ d.fields.insert("columnsKind".into(), json!("fixedNumber"));
+ app.ui.dialog = Some(d);
+ confirm(&mut app).unwrap();
+ assert_eq!((opts(&app).columns_kind, opts(&app).column_width), (designcraft_doc::ColumnsKind::FixedNumber, 120.0));
+ }
+
+ #[test]
+ fn baseline_grid_increment_error_explains_the_positive_measure_rule() {
+ 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());
+ for increment in ["0", "-1 pt", "not a measure"] {
+ let mut d = Dialog::new("textFrameOptions", json!({}));
+ seed_text_frame_options(&app, &mut d);
+ d.fields.insert("customGrid".into(), json!(true));
+ d.fields.insert("gridIncrement".into(), json!(increment));
+ app.ui.dialog = Some(d);
+ let error = confirm(&mut app).unwrap_err().to_string();
+ assert!(error.contains("the baseline grid increment must be a measure greater than zero"), "{increment}: {error}");
+ assert!(app.session.doc().unwrap().doc.item(id).unwrap().text_frame().unwrap().options.baseline_grid.is_none());
+ }
+ }
+
+ #[test]
+ fn text_frame_options_set_a_custom_baseline_grid_relative_to() {
+ use designcraft_doc::{FrameBaselineGrid, FrameGridRelative};
+ 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());
+ let grid = |app: &DesignApp| app.session.doc().unwrap().doc.item(id).unwrap().text_frame().unwrap().options.baseline_grid;
+ let open = |app: &mut DesignApp, fields: &[(&str, Value)]| {
+ let mut d = Dialog::new("textFrameOptions", json!({}));
+ 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)
+ };
+ app.run("selection.set", json!({"ids": [id.0]})).unwrap();
+ // Turned on, the grid takes the shown start and increment (the document grid's: 3p0 and 1p0).
+ open(&mut app, &[("customGrid", json!(true)), ("gridRelativeTo", json!("frame"))]).unwrap();
+ assert_eq!(grid(&app), Some(FrameBaselineGrid { start: 36.0, increment: 12.0, relative_to: FrameGridRelative::TopOfFrame }));
+ // The dialog shows the frame's grid; changing Relative To keeps its start and increment.
+ open(&mut app, &[("gridStart", json!("0p10"))]).unwrap();
+ open(&mut app, &[("gridRelativeTo", json!("inset"))]).unwrap();
+ assert_eq!(grid(&app), Some(FrameBaselineGrid { start: 10.0, increment: 12.0, relative_to: FrameGridRelative::TopInset }));
+ open(&mut app, &[("customGrid", json!(false))]).unwrap();
+ assert_eq!(grid(&app), None);
+ }
+
+ #[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]);
+ open(&mut app, &[("balanceColumns", json!(true))]).unwrap();
+ let o = opts(&app);
+ assert!(o.balance_columns && o.column_rule && o.columns == 2, "{o:?}");
+ // 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..4 {
+ app.run("edit.undo", json!({})).unwrap();
+ }
+ assert_eq!(opts(&app), before);
+ }
+
+ #[test]
+ fn toc_dialog_adds_a_style_and_ok_makes_the_table_of_contents() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.newSample", json!({})).unwrap();
+ crate::menus::activate(&mut app, "toc.generate", &Value::Null);
+ assert_eq!(app.ui.dialog.as_ref().map(|d| d.id.as_str()), Some(TOC));
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1200.0, 800.0));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ for expected in
+ ["Table of Contents", "Title:", "Include Paragraph Styles:", "Other Styles:", "« Add", "Remove »", "Replace Existing Table of Contents"]
+ {
+ visible_label(&labels, screen, expected);
+ }
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, "Headline").center());
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, "« Add").center());
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ for expected in ["Entry Style:", "TOC Level 1", "After Entry", "Between Entry and Number:", "Level:"] {
+ visible_label(&labels, screen, expected);
+ }
+ let undo = app.session.doc().unwrap().history.undo.len();
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, "OK").center());
+ assert!(app.ui.dialog.is_none());
+ let d = &app.session.doc().unwrap().doc;
+ let toc = d.toc.clone().unwrap();
+ assert_eq!(toc.entries, vec![designcraft_doc::TocEntry::new("Headline", 1)]);
+ let text = &d.story(toc.story).unwrap().text;
+ assert!(text.starts_with("Contents\n") && text.contains("\nNotes on the Grid\t"), "{text}");
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), undo + 1);
+ // Reopened, the dialog shows the table of contents and replaces it.
+ crate::menus::activate(&mut app, "toc.generate", &Value::Null);
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert!(d.b("replace"));
+ assert_eq!(toc_rows(d).iter().map(|r| r.style.as_str()).collect::<Vec<_>>(), ["Headline"]);
+ }
+
+ #[test]
+ fn margins_and_columns_link_arithmetic_preview_and_one_undo_step() {
+ // Adobe's "Set up a modern magazine layout" (1:41–3:04): linked margins to 0.4375 in, then
+ // 5 columns with a 0.1875 in gutter, unlinked, and "*2" typed after the outside margin.
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"preset": "A4", "pages": 3, "facingPages": true, "margins": 36})).unwrap();
+ app.canvas_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1000.0, 800.0)));
+ open_margins_and_columns(&mut app);
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1178.0, 814.0));
+ let mut labels = vec![];
+ for _ in 0..3 {
+ labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ for expected in
+ ["Margins and Columns", "Margins", "Top:", "Bottom:", "Inside:", "Outside:", "Columns", "Number:", "Gutter:", "Adjust Layout", "Preview"]
+ {
+ visible_label(&labels, screen, expected);
+ }
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert!(d.b("link"), "four equal margins open linked");
+ // Linked: one margin typed is all four.
+ app.ui.dialog.as_mut().unwrap().fields.insert("marginTop".into(), json!("0.4375 in"));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert!(MARGIN_FIELDS.iter().all(|(k, _, _)| d.s(k) == "0.4375 in"), "{:?}", d.fields);
+ // Preview: the page changes, with no undo step.
+ let undo = app.session.doc().unwrap().history.undo.len();
+ app.ui.dialog.as_mut().unwrap().fields.insert("preview".into(), json!(true));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ let top = |app: &DesignApp| app.session.doc().unwrap().doc.spreads[0].pages[0].margins.top;
+ assert!((top(&app) - 31.5).abs() < 1e-6, "previewed: {}", top(&app));
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), undo);
+ // Unlinked (the link button), the outside margin alone: "*2" typed after it is worked out
+ // when the field is left.
+ app.ui.dialog.as_mut().unwrap().fields.insert("link".into(), json!(false));
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ let key = |k| egui::Event::Key { key: k, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE };
+ let field = labels
+ .iter()
+ .filter(|(t, _, _)| t.trim() == "0.4375 in")
+ .map(|(_, r, _)| *r)
+ .max_by(|a, b| (a.max.x + a.max.y).total_cmp(&(b.max.x + b.max.y)))
+ .unwrap();
+ click_dialog(&mut app, &ctx, screen, field.center());
+ dialog_frame(&mut app, &ctx, screen, vec![key(egui::Key::End), egui::Event::Text("*2".into())]);
+ dialog_frame(&mut app, &ctx, screen, vec![key(egui::Key::Tab)]);
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert!(
+ !d.s("marginOutside").contains('*') && (d.m("marginOutside").unwrap() - 63.0).abs() < 1e-6,
+ "worked out on leaving the field: {}",
+ d.s("marginOutside")
+ );
+ let d = app.ui.dialog.as_mut().unwrap();
+ d.fields.insert("link".into(), json!(false));
+ for (k, v) in [("marginOutside", "0.4375 in*2"), ("columns", "5"), ("gutter", "0.1875 in"), ("target", "all")] {
+ d.fields.insert(k.into(), json!(v));
+ }
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ confirm(&mut app).unwrap();
+ let pg = app.session.doc().unwrap().doc.spreads[1].pages[0].clone();
+ assert_eq!((pg.margins.top, pg.margins.outside, pg.columns.count), (31.5, 63.0, 5));
+ assert!((pg.columns.gutter - 13.5).abs() < 1e-6);
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), undo + 1, "one undo step");
+ // Cancel after a preview puts the page back.
+ open_margins_and_columns(&mut app);
+ let d = app.ui.dialog.as_mut().unwrap();
+ d.fields.insert("preview".into(), json!(true));
+ d.fields.insert("columns".into(), json!("2"));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ cancel(&mut app);
+ assert_eq!(app.session.doc().unwrap().doc.spreads[1].pages[0].columns.count, 5);
+ }
+
+ #[test]
+ fn create_guides_reads_like_indesigns_and_previews() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"pages": 1, "facingPages": false})).unwrap();
+ app.canvas_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1000.0, 800.0)));
+ open_create_guides(&mut app);
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1178.0, 814.0));
+ let mut labels = vec![];
+ for _ in 0..3 {
+ labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ for expected in ["Create Guides", "Rows", "Columns", "Options", "Fit Guides to:", "Margins", "Page", "Remove Existing Ruler Guides", "Preview"] {
+ visible_label(&labels, screen, expected);
+ }
+ // Rows and Columns side by side.
+ let (r, c) = (visible_label(&labels, screen, "Rows"), visible_label(&labels, screen, "Columns"));
+ assert!((r.center().y - c.center().y).abs() < 2.0 && r.center().x < c.center().x);
+ // Thirds, single guides, fitted to the page: clicking the Page radio.
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, "Page").center());
+ let d = app.ui.dialog.as_mut().unwrap();
+ assert_eq!(d.s("fitTo"), "page");
+ d.fields.insert("rows".into(), json!("3"));
+ d.fields.insert("rowGutter".into(), json!("0"));
+ d.fields.insert("preview".into(), json!(true));
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ let guides = |app: &DesignApp| app.session.doc().unwrap().doc.spreads[0].pages[0].guides.len();
+ assert_eq!(guides(&app), 2, "previewed");
+ confirm(&mut app).unwrap();
+ assert_eq!(guides(&app), 2, "made once");
+ app.run("edit.undo", json!({})).unwrap();
+ assert_eq!(guides(&app), 0, "one undo step");
+ }
+
+ 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,
+ source: egui::MouseWheelSource::Unknown,
+ },
+ ],
+ );
+ // Let smooth wheel scrolling and scrollbar visibility settle before clicking.
+ for _ in 0..30 {
+ dialog_frame(app, ctx, screen, vec![]);
+ }
+ }
+
+ fn scope_control(app: &mut DesignApp, ctx: &egui::Context, method: &str, params: Value) -> Value {
+ let (request, _reply) = crate::control::ControlRequest::new(method, params);
+ let crate::control::Outcome::Done(value) = crate::control::handle(app, ctx, &request) else { panic!("ordinary control response") };
+ assert_eq!(value["ok"], true, "{value}");
+ value["result"].clone()
+ }
+
+ fn scope_click(app: &mut DesignApp, ctx: &egui::Context, screen: egui::Rect, label: &str) {
+ let labels = dialog_frame(app, ctx, screen, vec![]);
+ let pos = visible_label(&labels, screen, label).center();
+ click_dialog(app, ctx, screen, pos);
+ }
+
+ fn scope_dialog() -> (DesignApp, egui::Context, egui::Rect, designcraft_engine::doc::StoryId) {
+ scope_dialog_with_selection("red red | red", 7)
+ }
+
+ fn scope_dialog_with_selection(text: &str, end: usize) -> (DesignApp, egui::Context, egui::Rect, designcraft_engine::doc::StoryId) {
+ scope_dialog_with_tool(text, end, None)
+ }
+
+ fn scope_dialog_with_tool(text: &str, end: usize, tool: Option<&str>) -> (DesignApp, egui::Context, egui::Rect, designcraft_engine::doc::StoryId) {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.ui.language = "en".into();
+ app.run("file.new", json!({})).unwrap();
+ let frame = app.run("frame.create", json!({"rect": [36, 36, 100, 100], "content": "text", "text": text})).unwrap();
+ let sid = designcraft_engine::doc::StoryId(frame["story"].as_u64().unwrap());
+ let ctx = dialog_context("en");
+ if let Some(tool) = tool {
+ scope_control(&mut app, &ctx, "ui.tool.select", json!({"tool": tool}));
+ }
+ app.run("text.select", json!({"story": sid.0, "anchor": 0, "focus": end})).unwrap();
+ app.run("app.findChange", json!({})).unwrap();
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1178.0, 814.0));
+ for (field, value) in [("find", "red"), ("change", "unused")] {
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": field, "value": value}));
+ }
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ scope_click(&mut app, &ctx, screen, "document");
+ scope_click(&mut app, &ctx, screen, "selection");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("scope"), "selection");
+ (app, ctx, screen, sid)
+ }
+
+ fn scope_selected(app: &DesignApp, sid: designcraft_engine::doc::StoryId, a: usize, b: usize) {
+ let t = app.session.doc().unwrap().selection.text.unwrap();
+ assert_eq!((t.story, t.range(), t.cell), (sid, a..b, None));
+ }
+
+ fn scope_state_unchanged(app: &DesignApp, before: &designcraft_engine::DocState) {
+ let after = app.session.doc().unwrap();
+ assert!(std::sync::Arc::ptr_eq(&before.doc, &after.doc));
+ assert_eq!(after.uid, before.uid);
+ assert_eq!(after.revision, before.revision);
+ assert_eq!(after.selection, before.selection);
+ assert_eq!(after.history.limit, before.history.limit);
+ for (actual, expected) in [(&after.history.undo, &before.history.undo), (&after.history.redo, &before.history.redo)] {
+ assert_eq!(actual.len(), expected.len());
+ for (a, b) in actual.iter().zip(expected) {
+ assert_eq!(a.label, b.label);
+ assert_eq!(a.selection, b.selection);
+ assert!(std::sync::Arc::ptr_eq(&a.doc, &b.doc));
+ }
+ }
+ }
+
+ #[test]
+ fn find_scope_dialog_control_effective_noops_retain_bounds() {
+ for (field, value) in [("objectMode", json!(false)), ("story", Value::Null)] {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ assert!(!app.ui.dialog.as_ref().unwrap().fields.contains_key(field));
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "change", "value": "blue"}));
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ let before = app.session.doc().unwrap().clone();
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": field, "value": value}));
+ assert_eq!(app.ui.dialog.as_ref().unwrap().fields[field], value);
+ scope_state_unchanged(&app, &before);
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 4, 7);
+ scope_click(&mut app, &ctx, screen, "Change All");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 replacement(s) made");
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue blue | red");
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), before.history.undo.len() + 1);
+ }
+ }
+
+ #[test]
+ fn find_scope_dialog_explicit_story_ignored_scope_preserves_grep_cursor() {
+ for physical in [false, true] {
+ for (text, pattern, hits, changed) in [
+ ("é", "é|(?:)", vec![(0, 2)], "X"),
+ ("é🙂", "é|(?:)", vec![(0, 2), (6, 6)], "X🙂X"),
+ ("é🙂", "(?:)", vec![(0, 0), (2, 2), (6, 6)], "XéX🙂X"),
+ ] {
+ let (mut app, ctx, screen, sid) = scope_dialog_with_selection(text, 0);
+ for (field, value) in [("find", json!(pattern)), ("change", json!("X")), ("story", json!(sid.0))] {
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": field, "value": value}));
+ }
+ scope_click(&mut app, &ctx, screen, "GREP");
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), format!("{} match(es)", hits.len()));
+ for &(a, b) in &hits {
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "Found");
+ scope_selected(&app, sid, a, b);
+ let before = app.session.doc().unwrap().clone();
+ let cur = app.ui.dialog.as_ref().unwrap().s("scope");
+ let next = if cur == "selection" { "document" } else { "selection" };
+ if physical {
+ scope_click(&mut app, &ctx, screen, &cur);
+ scope_click(&mut app, &ctx, screen, next);
+ } else {
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "scope", "value": next}));
+ }
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("scope"), next);
+ assert_eq!(app.ui.dialog.as_ref().unwrap().fields["story"], json!(sid.0));
+ scope_state_unchanged(&app, &before);
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), format!("{} match(es)", hits.len()));
+ }
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "No matches");
+ // An ignored scope change must not revive an exhausted endpoint either.
+ let before = app.session.doc().unwrap().clone();
+ let cur = app.ui.dialog.as_ref().unwrap().s("scope");
+ let next = if cur == "selection" { "document" } else { "selection" };
+ if physical {
+ scope_click(&mut app, &ctx, screen, &cur);
+ scope_click(&mut app, &ctx, screen, next);
+ } else {
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "scope", "value": next}));
+ }
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "No matches");
+ scope_state_unchanged(&app, &before);
+ scope_click(&mut app, &ctx, screen, "Change All");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), format!("{} replacement(s) made", hits.len()));
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, changed);
+ }
+ }
+ }
+
+ #[test]
+ fn find_scope_dialog_explicit_story_transitions_reset_cursor() {
+ for remove_override in [false, true] {
+ let (mut app, ctx, screen, sid) = scope_dialog_with_selection("é🙂", 0);
+ let other = app.run("frame.create", json!({"rect": [180, 36, 100, 100], "content": "text", "text": "other"})).unwrap();
+ app.run("text.select", json!({"story": sid.0, "anchor": 0, "focus": 0})).unwrap();
+ for (field, value) in [("find", json!("(?:)")), ("story", json!(sid.0))] {
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": field, "value": value}));
+ }
+ scope_click(&mut app, &ctx, screen, "GREP");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 0);
+ let before = app.session.doc().unwrap().clone();
+ let value = if remove_override { Value::Null } else { other["story"].clone() };
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "story", "value": value}));
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "story", "value": sid.0}));
+ scope_state_unchanged(&app, &before);
+ // Away and back still releases continuation even if no Find command intervenes.
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 0);
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 2, 2);
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "é🙂");
+ let other_sid = designcraft_engine::doc::StoryId(other["story"].as_u64().unwrap());
+ assert_eq!(app.session.doc().unwrap().doc.story(other_sid).unwrap().text, "other");
+ }
+ }
+
+ #[test]
+ fn find_scope_dialog_control_mode_changes_release_bounds() {
+ for object_mode in [false, true] {
+ let (mut app, ctx, _, sid) = scope_dialog();
+ if object_mode {
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "objectMode", "value": true}));
+ }
+ // Direct Session consumers share the retained domain even while Object is shown.
+ let p = json!({"find": "red", "change": "blue", "scope": "selection"});
+ let count = scope_control(&mut app, &ctx, "engine.execute", json!({"command": "find.find", "params": p}));
+ assert_eq!(count.as_array().unwrap().len(), 2);
+ scope_control(&mut app, &ctx, "engine.execute", json!({"command": "find.next", "params": p}));
+ scope_selected(&app, sid, 0, 3);
+ let before = app.session.doc().unwrap().clone();
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "objectMode", "value": !object_mode}));
+ assert_eq!(app.ui.dialog.as_ref().unwrap().b("objectMode"), !object_mode);
+ scope_state_unchanged(&app, &before);
+ let count = scope_control(&mut app, &ctx, "engine.execute", json!({"command": "find.find", "params": p}));
+ assert_eq!(count, json!([{"story": sid.0, "start": 0, "end": 3, "text": "red"}]));
+ let changed = scope_control(&mut app, &ctx, "engine.execute", json!({"command": "find.change", "params": p}));
+ assert_eq!(changed, json!({"count": 1}));
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue red | red");
+ }
+ }
+
+ #[test]
+ fn find_scope_dialog_tool_replacement_releases_bounds() {
+ for (tool, replacement) in [("page", "cmd:layout.pageSize"), ("rectangleFrame", "frameSize")] {
+ let (mut app, ctx, screen, sid) = scope_dialog_with_tool("red red | red", 7, Some(tool));
+ assert_eq!(app.session.tool_id(), tool);
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ let before = app.session.doc().unwrap().clone();
+ let active = (app.session.active_index(), app.session.documents().len());
+ let off = app.session.layout().xf(designcraft_engine::doc::SpreadRef::Doc(0)).translation();
+ let x = off.x + before.doc.spreads[0].pages[0].x + 200.0;
+ let y = off.y + 200.0;
+ // The Page tool opens Page Size on a double-click (a click selects the page).
+ let events = if tool == "page" {
+ json!([{"kind": "doubleclick", "x": x, "y": y}])
+ } else {
+ json!([{"kind": "down", "x": x, "y": y}, {"kind": "up", "x": x, "y": y}])
+ };
+ // Real tool -> Action::Dialog -> after_engine; no injected UI request.
+ scope_control(&mut app, &ctx, "ui.pointer", json!({"events": events}));
+ assert_eq!(app.ui.dialog.as_ref().unwrap().id, replacement);
+ assert!(app.session.ui_requests.is_empty());
+ assert_eq!((app.session.active_index(), app.session.documents().len()), active);
+ scope_state_unchanged(&app, &before);
+ scope_click(&mut app, &ctx, screen, "Cancel");
+ assert!(app.ui.dialog.is_none());
+ assert_eq!((app.session.active_index(), app.session.documents().len()), active);
+ scope_state_unchanged(&app, &before);
+ let p = json!({"find": "red", "change": "blue", "scope": "selection"});
+ let count = scope_control(&mut app, &ctx, "engine.execute", json!({"command": "find.find", "params": p}));
+ assert_eq!(count, json!([{"story": sid.0, "start": 0, "end": 3, "text": "red"}]));
+ scope_state_unchanged(&app, &before);
+ let changed = scope_control(&mut app, &ctx, "engine.execute", json!({"command": "find.change", "params": p}));
+ assert_eq!(changed, json!({"count": 1}));
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue red | red");
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), before.history.undo.len() + 1);
+ }
+ }
+
+ #[test]
+ fn find_scope_dialog_tool_without_replacement_retains_bounds() {
+ for tool in ["page", "rectangleFrame"] {
+ let (mut app, ctx, screen, sid) = scope_dialog_with_tool("red red | red", 7, Some(tool));
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "change", "value": "blue"}));
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ let before = app.session.doc().unwrap().clone();
+ let fields = app.ui.dialog.as_ref().unwrap().fields.clone();
+ scope_control(&mut app, &ctx, "ui.pointer", json!({"events": [{"kind": "move", "x": 200, "y": 200}]}));
+ assert_eq!(app.ui.dialog.as_ref().unwrap().id, "findChange");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().fields, fields);
+ scope_state_unchanged(&app, &before);
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 4, 7);
+ scope_click(&mut app, &ctx, screen, "Change All");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 replacement(s) made");
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue blue | red");
+ }
+ }
+
+ #[cfg(not(target_arch = "wasm32"))]
+ #[test]
+ fn find_scope_dialog_native_pdf_replacement_releases_bounds() {
+ let directory = tempfile::tempdir().unwrap();
+ let path = directory.path().join("three.pdf");
+ std::fs::write(&path, crate::browser_import_tests::pdf()).unwrap();
+ for dismissal in ["Cancel", "Escape", "control"] {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ let picked = std::sync::Arc::new(std::sync::atomic::AtomicUsize::new(0));
+ let read = std::sync::Arc::new(std::sync::atomic::AtomicUsize::new(0));
+ let seen_pick = picked.clone();
+ let seen_read = read.clone();
+ let pick_path = path.to_string_lossy().to_string();
+ let read_path = pick_path.clone();
+ app.answer_dialogs(move |request| {
+ assert_eq!(place_filter(request), Some("Graphics and text"));
+ seen_pick.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
+ craft_dialogs::Answer::Paths(vec![pick_path.clone().into()])
+ });
+ app.services.read = Some(Box::new(move |path| {
+ assert_eq!(path, read_path);
+ seen_read.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
+ std::fs::read(path).map_err(|e| e.to_string())
+ }));
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ let before = app.session.doc().unwrap().clone();
+ let active = (app.session.active_index(), app.session.documents().len());
+ // Exercise engine.execute -> UiRequest::Pick -> native host PDF replacement.
+ scope_control(&mut app, &ctx, "engine.execute", json!({"command": "file.place", "params": {}}));
+ app.settle_dialogs();
+ assert_eq!(picked.load(std::sync::atomic::Ordering::SeqCst), 1);
+ assert_eq!(read.load(std::sync::atomic::Ordering::SeqCst), 1);
+ let dialog = app.ui.dialog.as_ref().unwrap();
+ assert_eq!(dialog.id, "pdfImport");
+ assert_eq!(dialog.s("path"), path.to_string_lossy());
+ assert_eq!(dialog.fields["pages"], 3);
+ assert_eq!(dialog.s("page"), "1");
+ assert!(!dialog.b("async"));
+ assert_eq!(dialog.fields["target"], json!(before.uid));
+ assert!(app.session.ui_requests.is_empty());
+ assert!(app.pending_pdf.is_none());
+ assert_eq!((app.session.active_index(), app.session.documents().len()), active);
+ scope_state_unchanged(&app, &before);
+ match dismissal {
+ "Cancel" => scope_click(&mut app, &ctx, screen, "Cancel"),
+ "Escape" => {
+ dialog_frame(
+ &mut app,
+ &ctx,
+ screen,
+ vec![egui::Event::Key {
+ key: egui::Key::Escape,
+ physical_key: None,
+ pressed: true,
+ repeat: false,
+ modifiers: egui::Modifiers::NONE,
+ }],
+ );
+ }
+ "control" => {
+ scope_control(&mut app, &ctx, "ui.dialog.cancel", json!({}));
+ }
+ _ => panic!("known dismissal"),
+ }
+ assert!(app.ui.dialog.is_none());
+ assert!(app.pending_pdf.is_none());
+ assert_eq!(picked.load(std::sync::atomic::Ordering::SeqCst), 1);
+ assert_eq!(read.load(std::sync::atomic::Ordering::SeqCst), 1);
+ assert_eq!((app.session.active_index(), app.session.documents().len()), active);
+ scope_state_unchanged(&app, &before);
+ let p = json!({"find": "red", "change": "blue", "scope": "selection"});
+ let count = scope_control(&mut app, &ctx, "engine.execute", json!({"command": "find.find", "params": p}));
+ assert_eq!(count, json!([{"story": sid.0, "start": 0, "end": 3, "text": "red"}]));
+ scope_state_unchanged(&app, &before);
+ let changed = scope_control(&mut app, &ctx, "engine.execute", json!({"command": "find.change", "params": p}));
+ assert_eq!(changed, json!({"count": 1}));
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue red | red");
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), before.history.undo.len() + 1);
+ }
+ }
+
+ /// The first file type an open dialog offers: Place's is "Graphics and text".
+ fn place_filter(request: &craft_dialogs::Request) -> Option<&str> {
+ let craft_dialogs::Request::File(dialog) = request else { return None };
+ dialog.filters.first().map(|filter| filter.name.as_str())
+ }
+
+ #[cfg(not(target_arch = "wasm32"))]
+ #[test]
+ fn find_scope_dialog_native_picker_cancel_retains_bounds() {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ let picked = std::sync::Arc::new(std::sync::atomic::AtomicUsize::new(0));
+ let seen = picked.clone();
+ app.answer_dialogs(move |request| {
+ assert_eq!(place_filter(request), Some("Graphics and text"));
+ seen.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
+ craft_dialogs::Answer::Cancelled
+ });
+ let read = std::sync::Arc::new(std::sync::atomic::AtomicUsize::new(0));
+ let seen_read = read.clone();
+ app.services.read = Some(Box::new(move |_| {
+ seen_read.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
+ Err("canceled picker must not read".into())
+ }));
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "change", "value": "blue"}));
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ let before = app.session.doc().unwrap().clone();
+ let active = (app.session.active_index(), app.session.documents().len());
+ let fields = app.ui.dialog.as_ref().unwrap().fields.clone();
+ scope_control(&mut app, &ctx, "engine.execute", json!({"command": "file.place", "params": {}}));
+ app.settle_dialogs();
+ assert_eq!(picked.load(std::sync::atomic::Ordering::SeqCst), 1);
+ assert_eq!(read.load(std::sync::atomic::Ordering::SeqCst), 0);
+ assert_eq!(app.ui.dialog.as_ref().unwrap().id, "findChange");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().fields, fields);
+ assert_eq!((app.session.active_index(), app.session.documents().len()), active);
+ scope_state_unchanged(&app, &before);
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 4, 7);
+ scope_click(&mut app, &ctx, screen, "Change All");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 replacement(s) made");
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue blue | red");
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), before.history.undo.len() + 1);
+ }
+
+ #[test]
+ fn find_scope_dialog_exact_baseline_buttons() {
+ let (mut app, ctx, screen, sid) = scope_dialog_with_selection("red red", 3);
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "change", "value": "blue"}));
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "1 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ scope_click(&mut app, &ctx, screen, "Change All");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "1 replacement(s) made");
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue red");
+ }
+
+ #[test]
+ fn find_scope_dialog_grep_tab_alone_restarts_original_selection() {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ scope_click(&mut app, &ctx, screen, "GREP");
+ assert!(app.ui.dialog.as_ref().unwrap().b("grep"));
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("find"), "red");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 4, 7);
+ scope_click(&mut app, &ctx, screen, "Text");
+ assert!(!app.ui.dialog.as_ref().unwrap().b("grep"));
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ }
+
+ #[test]
+ fn find_scope_dialog_buttons_retain_nonempty_hits_and_change_all() {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ let history = app.session.doc().unwrap().history.undo.len();
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "change", "value": "blue"}));
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 4, 7);
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "No matches");
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), history);
+ scope_click(&mut app, &ctx, screen, "Change All");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 replacement(s) made");
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue blue | red");
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), history + 1);
+ scope_click(&mut app, &ctx, screen, "Cancel");
+ assert!(app.ui.dialog.is_none());
+ app.run("edit.undo", json!({})).unwrap();
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "red red | red");
+ app.run("edit.redo", json!({})).unwrap();
+ let native = app.run("file.serialize", json!({})).unwrap();
+ app.run("file.openBytes", json!({"name": "scope.designcraft", "base64": native["base64"]})).unwrap();
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue blue | red");
+ }
+
+ fn scope_confirm_case(action: &str) {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ scope_click(&mut app, &ctx, screen, "Count");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "change", "value": "blue"}));
+ match action {
+ "OK" => scope_click(&mut app, &ctx, screen, "OK"),
+ "Enter" => {
+ dialog_frame(
+ &mut app,
+ &ctx,
+ screen,
+ vec![egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }],
+ );
+ }
+ "control" => {
+ assert_eq!(scope_control(&mut app, &ctx, "ui.dialog.confirm", json!({}))["count"], 2);
+ }
+ _ => panic!("known confirmation route"),
+ }
+ assert!(app.ui.dialog.is_none());
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue blue | red");
+ // The closed dialog cannot leave its old seven-byte range for a later direct query.
+ let matches = app.run("find.find", json!({"find": "blue", "scope": "selection"})).unwrap();
+ assert_eq!(matches.as_array().unwrap().len(), 0);
+ }
+
+ #[test]
+ fn find_scope_dialog_ok_consumes_retained_bounds() {
+ scope_confirm_case("OK");
+ }
+
+ #[test]
+ fn find_scope_dialog_enter_consumes_retained_bounds() {
+ scope_confirm_case("Enter");
+ }
+
+ #[test]
+ fn find_scope_dialog_control_confirm_consumes_retained_bounds() {
+ scope_confirm_case("control");
+ }
+
+ #[test]
+ fn find_scope_dialog_query_reselection_cancel_and_reopen() {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "grep", "value": true}));
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "find", "value": "r.d"}));
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_control(&mut app, &ctx, "ui.dialog.cancel", json!({}));
+ assert_eq!(app.run("find.find", json!({"find": "red", "scope": "selection"})).unwrap().as_array().unwrap().len(), 1);
+ app.run("text.select", json!({"story": sid.0, "anchor": 0, "focus": 7})).unwrap();
+ app.run("find.next", json!({"find": "red", "scope": "selection"})).unwrap();
+ scope_control(&mut app, &ctx, "ui.dialog.open", json!({"id": "findChange", "fields": {"find": "red", "scope": "selection"}}));
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "1 match(es)");
+ app.run("text.select", json!({"story": sid.0, "anchor": 4, "focus": 7})).unwrap();
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 4, 7);
+ app.run("app.findChange", json!({})).unwrap();
+ for (field, value) in [("find", "red"), ("scope", "selection")] {
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": field, "value": value}));
+ }
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "1 match(es)");
+ }
+
+ #[test]
+ fn find_scope_dialog_word_reselection_limits_count_and_change_buttons() {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ let selected = app.session.doc().unwrap().selection.clone();
+ let frame = selected.text.unwrap().frame.unwrap();
+ let point = {
+ let st = app.session.doc().unwrap();
+ let cs = app.session.cache.get(&st.doc, sid, None);
+ let (fi, x, baseline, ascent, _) = designcraft_compose::caret(&cs, 1).unwrap();
+ let inner = designcraft_geom::Point::new(x, baseline - ascent * 0.5);
+ assert_eq!(cs.frames[fi].frame, frame);
+ assert_eq!(designcraft_compose::hit(&cs, fi, inner), Some(1));
+ let loc = st.doc.find(frame).unwrap();
+ st.doc.parent_xf(&loc) * st.doc.text_xf(st.doc.item(frame).unwrap()) * inner
+ };
+ let before = app.session.doc().unwrap().doc.clone();
+ let revision = app.session.doc().unwrap().revision;
+ app.run("text.selectWord", json!({"frame": frame.0, "point": [point.x, point.y]})).unwrap();
+ assert_eq!(app.session.doc().unwrap().selection, selected);
+ assert!(app.session.doc().unwrap().revision > revision, "a new revision");
+ assert!(std::sync::Arc::ptr_eq(&before, &app.session.doc().unwrap().doc));
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "1 match(es)");
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "change", "value": "blue"}));
+ scope_click(&mut app, &ctx, screen, "Change All");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "1 replacement(s) made");
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue red | red");
+ }
+
+ #[cfg(not(target_arch = "wasm32"))]
+ #[test]
+ fn find_scope_dialog_failed_native_drop_alert_releases_bounds() {
+ let directory = tempfile::tempdir().unwrap();
+ let path = directory.path().join("broken.designcraft");
+ std::fs::write(&path, b"not a native document").unwrap();
+ for dismissal in ["OK", "Escape", "control"] {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "2 match(es)");
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ let before = app.session.doc().unwrap().doc.clone();
+ let selected = app.session.doc().unwrap().selection.clone();
+ let revision = app.session.doc().unwrap().revision;
+ let history = app.session.doc().unwrap().history.undo.len();
+ let uid = app.session.doc().unwrap().uid;
+ let error = app.open_dropped(&path.to_string_lossy()).unwrap_err();
+ let alert = app.ui.dialog.as_ref().unwrap();
+ assert_eq!(alert.id, "alert");
+ assert_eq!(alert.s("title"), "Can't Open the File");
+ assert_eq!(alert.s("message"), error);
+ assert!(std::sync::Arc::ptr_eq(&before, &app.session.doc().unwrap().doc));
+ assert_eq!(app.session.doc().unwrap().selection, selected);
+ assert_eq!(app.session.doc().unwrap().revision, revision);
+ assert_eq!(app.session.doc().unwrap().uid, uid);
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), history);
+ match dismissal {
+ "OK" => scope_click(&mut app, &ctx, screen, "OK"),
+ "Escape" => {
+ dialog_frame(
+ &mut app,
+ &ctx,
+ screen,
+ vec![egui::Event::Key {
+ key: egui::Key::Escape,
+ physical_key: None,
+ pressed: true,
+ repeat: false,
+ modifiers: egui::Modifiers::NONE,
+ }],
+ );
+ }
+ "control" => {
+ scope_control(&mut app, &ctx, "ui.dialog.cancel", json!({}));
+ }
+ _ => panic!("known dismissal"),
+ }
+ assert!(app.ui.dialog.is_none());
+ let p = json!({"find": "red", "change": "blue", "scope": "selection"});
+ assert_eq!(app.run("find.find", p.clone()).unwrap(), json!([{"story": sid.0, "start": 0, "end": 3, "text": "red"}]));
+ assert_eq!(app.run("find.change", p).unwrap(), json!({"count": 1}));
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "blue red | red");
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), history + 1);
+ }
+ }
+
+ #[test]
+ fn find_scope_dialog_child_errors_and_explicit_parent() {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ app.run("text.select", json!({"story": sid.0, "anchor": 13, "focus": 13})).unwrap();
+ app.run("table.insert", json!({"rows": 1, "cols": 1})).unwrap();
+ app.run("text.insert", json!({"text": "red child", "raw": true})).unwrap();
+ let child = app.session.doc().unwrap().selection.text.unwrap();
+ let before = app.session.doc().unwrap().doc.clone();
+ let selection = app.session.doc().unwrap().selection.clone();
+ let history = app.session.doc().unwrap().history.undo.len();
+ for label in ["Count", "Find Next", "Change All"] {
+ scope_click(&mut app, &ctx, screen, label);
+ assert!(app.ui.dialog.as_ref().unwrap().s("status").contains("not supported"));
+ assert!(std::sync::Arc::ptr_eq(&before, &app.session.doc().unwrap().doc));
+ assert_eq!(app.session.doc().unwrap().selection, selection);
+ assert_eq!(app.session.doc().unwrap().history.undo.len(), history);
+ }
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "change", "value": "blue"}));
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "story", "value": sid.0}));
+ scope_click(&mut app, &ctx, screen, "Count");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "3 match(es)");
+ scope_click(&mut app, &ctx, screen, "Change All");
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("status"), "3 replacement(s) made");
+ assert_eq!(app.session.doc().unwrap().doc.text_story(sid, child.cell).unwrap().text, "red child");
+ assert!(app.session.doc().unwrap().doc.story(sid).unwrap().text.starts_with("blue blue | blue"));
+ }
+
+ #[test]
+ fn find_scope_dialog_error_confirmation_and_escape_release_context() {
+ for escape in [false, true] {
+ let (mut app, ctx, screen, sid) = scope_dialog();
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ scope_selected(&app, sid, 0, 3);
+ if escape {
+ dialog_frame(
+ &mut app,
+ &ctx,
+ screen,
+ vec![egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }],
+ );
+ } else {
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "find", "value": "["}));
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "grep", "value": true}));
+ scope_click(&mut app, &ctx, screen, "OK");
+ }
+ assert!(app.ui.dialog.is_none());
+ assert_eq!(app.session.doc().unwrap().doc.story(sid).unwrap().text, "red red | red");
+ assert_eq!(app.run("find.find", json!({"find": "red", "scope": "selection"})).unwrap().as_array().unwrap().len(), 1);
+ }
+ }
+
+ #[test]
+ fn find_scope_dialog_domain_and_object_changes_release_original_range() {
+ for route in ["scope", "object", "menu", "command"] {
+ let (mut app, ctx, screen, _) = scope_dialog();
+ scope_click(&mut app, &ctx, screen, "Find Next");
+ match route {
+ "scope" => {
+ for scope in ["story", "selection"] {
+ scope_control(&mut app, &ctx, "ui.dialog.set", json!({"field": "scope", "value": scope}));
+ }
+ }
+ "object" => {
+ scope_click(&mut app, &ctx, screen, "Object");
+ scope_click(&mut app, &ctx, screen, "Text");
+ }
+ "menu" => crate::menus::activate(&mut app, "app.newDocumentDialog", &Value::Null),
+ "command" => {
+ app.run("app.newDocumentDialog", json!({})).unwrap();
+ }
+ _ => panic!("known reset route"),
+ }
+ assert_eq!(app.run("find.find", json!({"find": "red", "scope": "selection"})).unwrap().as_array().unwrap().len(), 1);
+ }
+ }
+
+ #[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, crate::i18n::tr("de", "Interface Language"));
+ 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");
+ }
+
+ /// Preferences › Interface › Panels holds Auto-Collapse Iconic Panels, the same setting as the
+ /// iconic column's menu.
+ #[test]
+ fn preferences_set_auto_collapse_iconic_panels() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("app.preferences", json!({})).unwrap();
+ assert_eq!(app.ui.dialog.as_ref().unwrap().fields["autoCollapseIconicPanels"], json!(false));
+ app.ui.dialog.as_mut().unwrap().fields.insert("autoCollapseIconicPanels".into(), json!(true));
+ confirm(&mut app).unwrap();
+ assert!(app.ui.dock_auto_collapse);
+ app.run("app.preferences", json!({})).unwrap();
+ assert_eq!(app.ui.dialog.as_ref().unwrap().fields["autoCollapseIconicPanels"], json!(true));
+ }
+
+ #[test]
+ fn preferences_sidebar_scroll_keeps_selected_options_visible() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ 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]
+ fn preferences_horizontal_scroll_reaches_clipped_options() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("app.preferences", json!({})).unwrap();
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(450.0, 280.0));
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ let body = visible_label(&labels, screen, "When Scaling").center();
+ // The last General option sits below this short viewport.
+ scroll_dialog(&mut app, &ctx, screen, body, egui::vec2(0.0, -600.0));
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ let option = "Absolute Numbering (instead of Section Numbering)";
+ let (_, rect, clip) = labels.iter().find(|(text, _, _)| text == option).unwrap();
+ assert!(rect.right() > clip.right(), "rightmost option starts horizontally clipped: {rect:?}, {clip:?}");
+ scroll_dialog(&mut app, &ctx, screen, body, egui::vec2(-600.0, 0.0));
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ for expected in [option, "Preferences", "OK", "Cancel"] {
+ visible_label(&labels, screen, expected);
+ }
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, option).center());
+ assert!(app.ui.dialog.as_ref().unwrap().b("absolutePageNumbers"));
+ }
+
+ /// Scroll the dialog body down at `at` until `text` is painted unclipped on screen.
+ fn scroll_to_label(app: &mut DesignApp, ctx: &egui::Context, screen: egui::Rect, at: egui::Pos2, text: &str) -> egui::Rect {
+ for _ in 0..40 {
+ let labels = dialog_frame(app, ctx, screen, vec![]);
+ if let Some((_, rect, _)) = labels.iter().find(|(t, r, clip)| t.trim() == text && screen.contains_rect(*r) && clip.contains_rect(*r)) {
+ return *rect;
+ }
+ scroll_dialog(app, ctx, screen, at, egui::vec2(0.0, -60.0));
+ }
+ panic!("{text} never scrolled into view");
+ }
+
+ #[test]
+ fn new_document_vertical_scroll_reaches_every_field_and_preset() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("app.newDocumentDialog", json!({})).unwrap();
+ let ctx = dialog_context("en");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(392.0, 271.0));
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ let body = visible_label(&labels, screen, "Width").center();
+ let shown = |labels: &[(String, egui::Rect, egui::Rect)]| labels.iter().any(|(t, r, clip)| t == "Primary Text Frame" && clip.contains_rect(*r));
+ assert!(!shown(&labels), "the details start vertically clipped");
+ let ptf = scroll_to_label(&mut app, &ctx, screen, body, "Primary Text Frame");
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ for expected in ["New Document", "Create", "Close"] {
+ visible_label(&labels, screen, expected);
+ }
+ click_dialog(&mut app, &ctx, screen, ptf.center());
+ assert!(app.ui.dialog.as_ref().unwrap().b("primaryTextFrame"), "the caption toggles its checkbox");
+ // Below the details: the preset tabs and cards.
+ scroll_to_label(&mut app, &ctx, screen, body, "[Default]");
+ }
+
+ #[test]
+ fn arabic_new_document_fields_remain_reachable_and_editable() {
+ for size in [egui::vec2(392.0, 271.0), egui::vec2(450.0, 280.0), egui::vec2(1178.0, 814.0)] {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.ui.language = "ar".into();
+ app.run("app.newDocumentDialog", json!({})).unwrap();
+ let fields = [("height", "66p1"), ("gutter", "1p2"), ("marginBottom", "3p3"), ("marginOutside", "3p4")];
+ for (field, value) in fields {
+ app.ui.dialog.as_mut().unwrap().fields.insert(field.into(), json!(value));
+ }
+ let ctx = dialog_context("ar");
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, size);
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ // With craft-fonts' Noto Sans Arabic the rows above are taller, so at the smallest size the
+ // Height field starts partly below the body's clip: scroll to it like the other fields.
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ let (_, _, body) = labels.iter().find(|(text, _, _)| text.trim() == "66p1").expect("66p1 is painted");
+ let height = scroll_to_label(&mut app, &ctx, screen, body.center(), "66p1");
+ click_dialog(&mut app, &ctx, screen, height.center());
+ dialog_frame(
+ &mut app,
+ &ctx,
+ screen,
+ vec![
+ egui::Event::Key {
+ key: egui::Key::A,
+ physical_key: None,
+ pressed: true,
+ repeat: false,
+ modifiers: egui::Modifiers { ctrl: true, command: true, ..Default::default() },
+ },
+ egui::Event::Text("88p8".into()),
+ ],
+ );
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("height"), "88p8", "numeric fields accept edits");
+ let caption = scroll_to_label(&mut app, &ctx, screen, height.center(), crate::i18n::tr("ar", "Primary Text Frame"));
+ click_dialog(&mut app, &ctx, screen, caption.center());
+ assert!(app.ui.dialog.as_ref().unwrap().b("primaryTextFrame"), "checkboxes remain clickable");
+ for (_, value) in &fields[1..] {
+ scroll_to_label(&mut app, &ctx, screen, height.center(), value);
+ }
+ }
+ }
+
+ #[test]
+ fn resized_dialogs_cancel_and_reopen_without_applying_edits() {
+ for (command, title, field, ok, cancel) in
+ [("app.preferences", "Preferences", "recoveryMinutes", "OK", "Cancel"), ("app.newDocumentDialog", "New Document", "pages", "Create", "Close")]
+ {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run(command, json!({})).unwrap();
+ let original = app.ui.dialog.as_ref().unwrap().fields[field].clone();
+ app.ui.dialog.as_mut().unwrap().fields.insert(field.into(), json!(42));
+ let ctx = dialog_context("en");
+ for size in [egui::vec2(1178.0, 814.0), egui::vec2(392.0, 271.0), egui::vec2(589.0, 407.0)] {
+ 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, expected);
+ }
+ }
+ let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(589.0, 407.0));
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ click_dialog(&mut app, &ctx, screen, visible_label(&labels, screen, cancel).center());
+ assert!(app.ui.dialog.is_none());
+ assert!(app.session.active().is_none(), "cancelling must not create a document");
+ app.run(command, json!({})).unwrap();
+ assert_eq!(app.ui.dialog.as_ref().unwrap().fields[field], original, "cancelled edits must not survive reopening");
+ for _ in 0..3 {
+ dialog_frame(&mut app, &ctx, screen, vec![]);
+ }
+ let labels = dialog_frame(&mut app, &ctx, screen, vec![]);
+ visible_label(&labels, screen, title);
+ dialog_frame(
+ &mut app,
+ &ctx,
+ screen,
+ vec![egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }],
+ );
+ assert!(app.ui.dialog.is_none(), "Escape must also close the reopened dialog");
+ }
+ }
+
+ #[test]
+ fn paragraph_style_options_tabs_section_adds_a_stop_on_its_ruler() {
+ use egui_kittest::kittest::Queryable;
+ let (app, _) = ruled_paragraph();
+ let mut h = crate::test_window::open(app, egui::vec2(1400.0, 900.0));
+ h.state_mut().app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": "Ruled Child", "section": "tabs"})));
+ h.run_steps(4);
+ h.get_by_label("Clear All");
+ // The ruler sits below the row of alignment buttons; its strip takes the click.
+ let b = h.get_by_label("Right-aligned tab").rect();
+ h.get_by_label("Right-aligned tab").click();
+ h.run_steps(2);
+ let left = h.get_by_label("Left-aligned tab").rect();
+ let at = egui::pos2(left.min.x + crate::panels::tabs::PAD + 100.0, b.max.y + 14.0);
+ crate::test_window::click_at(&mut h, at);
+ let d = h.state().app.ui.dialog.clone().unwrap();
+ let tabs = d.fields.get("p.tabs").cloned().unwrap_or_default();
+ assert_eq!(tabs.as_array().map(Vec::len), Some(1), "{tabs}");
+ assert_eq!(tabs[0]["align"], "right");
+ confirm(&mut h.state_mut().app).unwrap();
+ let app = &mut h.state_mut().app;
+ let style = app.session.execute("type.tabs.get", &json!({"style": "Ruled Child"})).unwrap();
+ assert_eq!(style["tabs"], tabs);
+ assert_eq!(app.session.execute("type.tabs.get", &json!({})).unwrap()["tabs"], tabs, "the paragraph follows its style");
+ }
+
+ #[test]
+ fn parses_command_params() {
+ let f = command_fields("{name, type: custom|lastPageNumber|chapterNumber, text?, rule?: {on, weight}, flag?: bool} — creates");
+ let keys: Vec<&str> = f.iter().map(|f| f.key.as_str()).collect();
+ assert_eq!(keys, ["name", "type", "text", "rule", "flag"]);
+ assert_eq!(f[1].choices, ["custom", "lastPageNumber", "chapterNumber"]);
+ assert!(!f[0].optional && f[2].optional);
+ assert!(f[4].boolean);
+ assert!(command_fields("{}").is_empty());
+ assert!(command_fields("no params").is_empty());
+ // A parenthetical after the key describes the value.
+ let f = command_fields("{angle (degrees, CCW), ids?}");
+ let keys: Vec<&str> = f.iter().map(|f| f.key.as_str()).collect();
+ assert_eq!(keys, ["angle", "ids"]);
+ assert!(!f[0].optional && f[1].optional);
+ assert_eq!(f[0].hint, "degrees, CCW");
+ let f = command_fields("{scaleX? (%), ref?: 0..8, ids?: parent items (default: all)}");
+ let keys: Vec<&str> = f.iter().map(|f| f.key.as_str()).collect();
+ assert_eq!(keys, ["scaleX", "ref", "ids"]);
+ assert!(f.iter().all(|f| f.optional));
+ assert_eq!(f[0].hint, "%");
+ assert_eq!(f[2].hint, "parent items (default: all)");
+ // Every command with a "…" label parses without panicking.
+ for c in designcraft_engine::command_specs() {
+ let _ = command_fields(c.params);
+ }
+ }
+
+ fn test_app() -> crate::DesignApp {
+ let mut app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.session.execute("file.new", &json!({"pages": 1})).unwrap();
+ app
+ }
+
+ #[test]
+ fn toc_dialog_keeps_the_character_styles_and_sorting_of_its_entries() {
+ let mut app = test_app();
+ app.session.execute("style.paragraph.create", &json!({"name": "Head"})).unwrap();
+ app.session.execute("style.character.create", &json!({"name": "Number"})).unwrap();
+ app.session.execute("style.character.create", &json!({"name": "Dots"})).unwrap();
+ let sid = app.session.execute("frame.create", &json!({"rect": [36, 36, 300, 200], "content": "text", "text": "Pears\nApples"})).unwrap()["story"]
+ .clone();
+ app.session.execute("text.select", &json!({"story": sid, "anchor": 0, "focus": 8})).unwrap();
+ app.session.execute("style.paragraph.apply", &json!({"name": "Head"})).unwrap();
+ app.session.execute("layout.pages.insert", &json!({"count": 1})).unwrap();
+ let entries = json!([{"style": "Head", "pageNumberStyle": "Number", "separatorStyle": "Dots", "sort": true}]);
+ app.session.execute("toc.generate", &json!({"page": 2, "entries": entries})).unwrap();
+ let before = app.session.active().unwrap().doc.toc.clone().unwrap();
+ // The dialog shows the options, and OK (Replace Existing) writes them back unchanged.
+ open_toc(&mut app);
+ let d = app.ui.dialog.as_ref().unwrap();
+ let row = &toc_rows(d)[0];
+ assert_eq!((row.page_number_style.as_str(), row.separator_style.as_str(), row.sort), ("Number", "Dots", true));
+ let chars: Vec<String> = serde_json::from_value(d.fields["charStyles"].clone()).unwrap();
+ assert_eq!(chars, ["Number", "Dots"], "[None] is the menu's first choice, not a style");
+ let p = toc_params(&app, d);
+ assert_eq!(
+ (&p["entries"][0]["pageNumberStyle"], &p["entries"][0]["separatorStyle"], &p["entries"][0]["sort"]),
+ (&json!("Number"), &json!("Dots"), &json!(true))
+ );
+ confirm(&mut app).expect("OK regenerates the table of contents");
+ let st = app.session.active().unwrap();
+ assert_eq!(st.doc.toc.as_ref().unwrap().entries, before.entries);
+ // [None] and unsorted are left out of the params.
+ let mut d = Dialog::new(TOC, json!({"included": [{"style": "Head", "level": 1, "separator": "^t"}]}));
+ d.fields.insert("replace".into(), json!(true));
+ let p = toc_params(&app, &d);
+ assert!(p["entries"][0].get("pageNumberStyle").is_none() && p["entries"][0].get("sort").is_none(), "{p}");
+ }
+
+ #[test]
+ fn paragraph_style_options_dialog_saves_edits() {
+ let mut app = test_app();
+ let name = app.session.execute("style.paragraph.create", &json!({"name": "Body Copy"})).unwrap()["name"].as_str().unwrap().to_string();
+ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": name, "p.align": "center"})));
+ confirm(&mut app).expect("OK saves the style edit");
+ let st = app.session.active().unwrap();
+ assert_eq!(st.doc.styles.para(&name).unwrap().para.align, Some(designcraft_doc::Align::Center));
+ }
+
+ #[test]
+ fn paragraph_style_options_align_to_grid_shows_and_sets_the_style_grid_alignment() {
+ use designcraft_doc::GridAlign;
+ use egui_kittest::kittest::Queryable;
+ let mut app = test_app();
+ app.session.execute("style.paragraph.create", &json!({"name": "Grid Body", "para": {"gridAlign": "firstLineOnly"}})).unwrap();
+ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": "Grid Body", "section": "indents"})));
+ let mut h = crate::test_window::open(app, egui::vec2(1400.0, 900.0));
+ let grid = |h: &egui_kittest::Harness<'static, crate::test_window::Window>| {
+ h.state().app.session.active().unwrap().doc.styles.para("Grid Body").unwrap().para.grid_align
+ };
+ h.run_steps(4);
+ h.get_by_value("First Line Only");
+ confirm(&mut h.state_mut().app).unwrap();
+ assert_eq!(grid(&h), Some(GridAlign::FirstLineOnly), "OK without edits keeps the style's alignment");
+ h.state_mut().app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", json!({"name": "Grid Body", "section": "indents"})));
+ h.run_steps(4);
+ h.get_by_value("First Line Only").click();
+ h.run_steps(3);
+ h.get_by_label("All Lines").click();
+ h.run_steps(3);
+ confirm(&mut h.state_mut().app).unwrap();
+ assert_eq!(grid(&h), Some(GridAlign::AllLines));
+ }
+
+ #[test]
+ fn delete_paragraph_style_dialog_removes_the_style_and_reassigns_text() {
+ let mut app = test_app();
+ let name = app.session.execute("style.paragraph.create", &json!({"name": "Caption"})).unwrap()["name"].as_str().unwrap().to_string();
+ let sid = app.session.execute("frame.create", &json!({"rect": [36, 36, 300, 200], "content": "text"})).unwrap()["story"].as_u64().unwrap();
+ app.session.execute("text.insert", &json!({"text": "Hello"})).unwrap();
+ app.session.execute("text.select", &json!({"story": sid, "anchor": 0, "focus": 0})).unwrap();
+ app.session.execute("style.paragraph.apply", &json!({"name": name})).unwrap();
+ app.ui.dialog = Some(Dialog::new("deleteParagraphStyle", json!({"name": name, "replaceWith": designcraft_doc::BASIC_PARAGRAPH})));
+ confirm(&mut app).expect("OK deletes the style");
+ let st = app.session.active().unwrap();
+ assert!(st.doc.styles.para(&name).is_none(), "style removed");
+ let story = st.doc.stories.get(&designcraft_doc::StoryId(sid)).unwrap();
+ assert_eq!(story.paras[0].style, designcraft_doc::BASIC_PARAGRAPH, "text reassigned to the replacement style");
+ }
+
+ #[test]
+ fn delete_paragraph_style_dialog_defaults_replacement_to_basic_paragraph() {
+ let mut app = test_app();
+ let name = app.session.execute("style.paragraph.create", &json!({"name": "Caption"})).unwrap()["name"].as_str().unwrap().to_string();
+ // No `replaceWith` set — the dialog's default field.
+ app.ui.dialog = Some(Dialog::new("deleteParagraphStyle", json!({"name": name})));
+ confirm(&mut app).expect("OK deletes the style with the default replacement");
+ let st = app.session.active().unwrap();
+ assert!(st.doc.styles.para(&name).is_none());
+ }
+
+ #[test]
+ fn character_style_options_dialog_saves_edits() {
+ let mut app = test_app();
+ let name = app.session.execute("style.character.create", &json!({"name": "Key Term"})).unwrap()["name"].as_str().unwrap().to_string();
+ app.ui.dialog = Some(Dialog::new("characterStyleOptions", json!({"name": name, "c.tracking": 20.0})));
+ confirm(&mut app).expect("OK saves the style edit");
+ let st = app.session.active().unwrap();
+ assert_eq!(st.doc.styles.char_style(&name).unwrap().chars.tracking, Some(20.0));
+ }
+
+ #[test]
+ fn delete_character_style_dialog_removes_the_style_and_reassigns_text() {
+ let mut app = test_app();
+ let name = app.session.execute("style.character.create", &json!({"name": "Key Term"})).unwrap()["name"].as_str().unwrap().to_string();
+ let sid = app.session.execute("frame.create", &json!({"rect": [36, 36, 300, 200], "content": "text"})).unwrap()["story"].as_u64().unwrap();
+ app.session.execute("text.insert", &json!({"text": "Hello"})).unwrap();
+ app.session.execute("text.select", &json!({"story": sid, "anchor": 0, "focus": 5})).unwrap();
+ app.session.execute("style.character.apply", &json!({"name": name})).unwrap();
+ app.ui.dialog = Some(Dialog::new("deleteCharacterStyle", json!({"name": name, "replaceWith": designcraft_doc::NO_CHAR_STYLE})));
+ confirm(&mut app).expect("OK deletes the style");
+ let st = app.session.active().unwrap();
+ assert!(st.doc.styles.char_style(&name).is_none(), "style removed");
+ let story = st.doc.stories.get(&designcraft_doc::StoryId(sid)).unwrap();
+ assert_eq!(story.chars[0].format.style, designcraft_doc::NO_CHAR_STYLE, "text reassigned to the replacement style");
+ }
+
+ #[test]
+ fn delete_character_style_dialog_defaults_replacement_to_none() {
+ let mut app = test_app();
+ let name = app.session.execute("style.character.create", &json!({"name": "Key Term"})).unwrap()["name"].as_str().unwrap().to_string();
+ // No `replaceWith` set — the dialog's default field.
+ app.ui.dialog = Some(Dialog::new("deleteCharacterStyle", json!({"name": name})));
+ confirm(&mut app).expect("OK deletes the style with the default replacement");
+ let st = app.session.active().unwrap();
+ assert!(st.doc.styles.char_style(&name).is_none());
+ }
+
+ /// File › Export EPUB… opens EPUB Export Options from the document's setting; OK stores a
+ /// changed Split Document as one undo step, and an unchanged one adds none.
+ #[test]
+ fn epub_export_passes_its_options_to_the_engine() {
+ use std::io::Read;
+ use std::sync::{Arc, Mutex};
+ let mut app = test_app();
+ app.session.execute("style.paragraph.create", &json!({"name": "Chapter"})).unwrap();
+ let r = app.session.execute("frame.create", &json!({"rect": [36, 36, 300, 300], "content": "text", "text": "One\nTwo"})).unwrap();
+ let sid = r["story"].as_u64().unwrap();
+ for anchor in [0, 4] {
+ app.session.execute("text.select", &json!({"story": sid, "anchor": anchor, "focus": anchor})).unwrap();
+ app.session.execute("style.paragraph.apply", &json!({"name": "Chapter"})).unwrap();
+ }
+ let written: Arc<Mutex<Vec<u8>>> = Arc::new(Mutex::new(Vec::new()));
+ let sink = written.clone();
+ app.services.write = Some(Box::new(move |_: &str, bytes: &[u8]| {
+ *sink.lock().unwrap() = bytes.to_vec();
+ Ok(())
+ }));
+ crate::menus::export_epub(&mut app, &json!({"path": "book.epub", "split": {"style": "Chapter"}})).unwrap();
+ let bytes = written.lock().unwrap().clone();
+ let mut z = zip::ZipArchive::new(std::io::Cursor::new(bytes)).unwrap();
+ let mut opf = String::new();
+ z.by_name("OEBPS/content.opf").unwrap().read_to_string(&mut opf).unwrap();
+ assert!(opf.contains("properties=\"cover-image\""), "the first page is the cover: {opf}");
+ assert!(z.by_name("OEBPS/content2.xhtml").is_ok(), "the split override reaches the export");
+ assert_eq!(app.session.active().unwrap().doc.settings.epub_split, designcraft_doc::EpubSplit::Off, "an override is not stored");
+ crate::menus::export_epub(&mut app, &json!({"path": "book.epub", "cover": false})).unwrap();
+ let bytes = written.lock().unwrap().clone();
+ let mut z = zip::ZipArchive::new(std::io::Cursor::new(bytes)).unwrap();
+ let mut opf = String::new();
+ z.by_name("OEBPS/content.opf").unwrap().read_to_string(&mut opf).unwrap();
+ assert!(!opf.contains("cover-image"), "a caller's cover: false stays: {opf}");
+ }
+
+ #[test]
+ fn epub_export_options_store_split_document() {
+ use designcraft_doc::EpubSplit;
+ let mut app = test_app();
+ app.session.execute("style.paragraph.create", &json!({"name": "Chapter"})).unwrap();
+ let undo_steps = |app: &crate::DesignApp| app.session.active().map(|st| st.history.undo.len());
+ app.run("app.exportEpub", json!({})).unwrap();
+ let d = app.ui.dialog.as_mut().unwrap();
+ assert_eq!((d.id.as_str(), d.b("split"), d.s("style").as_str()), ("epubExport", false, designcraft_doc::BASIC_PARAGRAPH));
+ d.fields.insert("split".into(), json!(true));
+ d.fields.insert("style".into(), json!("Chapter"));
+ let before = undo_steps(&app);
+ confirm(&mut app).unwrap();
+ assert_eq!(app.session.active().unwrap().doc.settings.epub_split, EpubSplit::Style("Chapter".into()));
+ assert_eq!(undo_steps(&app), before.map(|n| n + 1));
+ open_epub_export(&mut app);
+ assert_eq!(app.ui.dialog.as_ref().map(|d| (d.b("split"), d.s("mode"), d.s("style"))), Some((true, "style".into(), "Chapter".into())));
+ confirm(&mut app).unwrap();
+ assert_eq!(undo_steps(&app), before.map(|n| n + 1), "unchanged: no undo step");
+ open_epub_export(&mut app);
+ app.ui.dialog.as_mut().unwrap().fields.insert("mode".into(), json!("exportTags"));
+ confirm(&mut app).unwrap();
+ assert_eq!(app.session.active().unwrap().doc.settings.epub_split, EpubSplit::ExportTags);
+ open_epub_export(&mut app);
+ cancel(&mut app);
+ assert_eq!(app.session.active().unwrap().doc.settings.epub_split, EpubSplit::ExportTags, "Cancel stores nothing");
+ }
+
+ #[test]
+ fn pdf_export_defaults() {
+ let d = Dialog::new("pdfExport", json!({}));
+ let keys: Vec<&str> = d.fields.iter().map(|(k, _)| k.as_str()).collect();
+ // serde_json::Map keeps keys sorted.
+ let expected = [
+ "bleed",
+ "compressImages",
+ "flatten",
+ "marksBleed",
+ "marksCrop",
+ "marksOffset",
+ "marksPageInfo",
+ "marksWeight",
+ "preset",
+ "spreads",
+ "standard",
+ "tagged",
+ ];
+ assert_eq!(keys, expected);
+ assert_eq!(d.fields["preset"].as_str(), Some("Desktop Printing"));
+ assert_eq!(d.fields["standard"].as_str(), Some("none"));
+ assert_eq!(d.fields["compressImages"].as_bool(), Some(false));
+ assert_eq!(d.fields["flatten"].as_str(), Some(""));
+ assert_eq!(d.fields["spreads"].as_bool(), Some(false));
+ assert_eq!(d.fields["bleed"].as_bool(), Some(true));
+ assert_eq!(d.fields["marksCrop"].as_bool(), Some(false));
+ assert_eq!(d.fields["marksBleed"].as_bool(), Some(false));
+ assert_eq!(d.fields["marksPageInfo"].as_bool(), Some(false));
+ assert_eq!(d.fields["marksWeight"].as_str(), Some("0.25"));
+ assert_eq!(d.fields["marksOffset"].as_str(), Some("6"));
+ assert_eq!(d.fields["tagged"].as_bool(), Some(true));
+ }
+
+ #[test]
+ fn pdf_export_override_keeps_override() {
+ let d = Dialog::new("pdfExport", json!({"bleed": false}));
+ assert_eq!(d.fields["bleed"].as_bool(), Some(false));
+ assert_eq!(d.fields["preset"].as_str(), Some("Desktop Printing"));
+ assert_eq!(d.fields["tagged"].as_bool(), Some(true));
+ }
+
+ #[test]
+ fn pdf_export_preset_high_quality_print_keeps_flatten() {
+ let mut d = Dialog::new("pdfExport", json!({}));
+ d.fields.insert("flatten".into(), json!("medium"));
+ apply_pdf_preset(&mut d, "Desktop Printing");
+ assert_eq!(d.s("standard"), "none");
+ assert!(!d.b("compressImages"));
+ assert!(!d.b("marksCrop"));
+ assert!(!d.b("marksBleed"));
+ assert!(!d.b("marksPageInfo"));
+ assert_eq!(d.s("flatten"), "medium", "a leave-unchanged preset must not touch flatten");
+ }
+
+ #[test]
+ fn pdf_export_preset_press_quality_keeps_flatten() {
+ let mut d = Dialog::new("pdfExport", json!({}));
+ d.fields.insert("flatten".into(), json!("high"));
+ apply_pdf_preset(&mut d, "Commercial Printing");
+ assert_eq!(d.s("standard"), "none");
+ assert!(d.b("compressImages"));
+ assert!(d.b("marksCrop"));
+ assert!(d.b("marksBleed"));
+ assert!(!d.b("marksPageInfo"));
+ assert_eq!(d.s("flatten"), "high");
+ }
+
+ #[test]
+ fn pdf_export_preset_smallest_file_size_sets_flatten_low() {
+ let mut d = Dialog::new("pdfExport", json!({}));
+ apply_pdf_preset(&mut d, "Screen and Email");
+ assert_eq!(d.s("standard"), "none");
+ assert!(d.b("compressImages"));
+ assert!(!d.b("marksCrop"));
+ assert!(!d.b("marksBleed"));
+ assert!(!d.b("marksPageInfo"));
+ assert_eq!(d.s("flatten"), "low");
+ }
+
+ /// The PDF/X-1a preset exports X-1a with the High Resolution flattener and printer's marks.
+ #[test]
+ fn pdf_export_preset_pdf_x1a_flattens_at_high_resolution() {
+ let mut d = Dialog::new("pdfExport", json!({}));
+ apply_pdf_preset(&mut d, "PDF/X-1a:2003");
+ assert_eq!(d.s("standard"), "x1a");
+ assert_eq!(d.s("flatten"), "high");
+ assert!(d.b("marksCrop") && d.b("marksBleed"));
+ assert!(PDF_EXPORT_PRESETS.contains(&"PDF/X-1a:2003"));
+ }
+
+ #[test]
+ fn pdf_export_preset_pdf_x4_keeps_flatten() {
+ let mut d = Dialog::new("pdfExport", json!({}));
+ d.fields.insert("flatten".into(), json!("medium"));
+ apply_pdf_preset(&mut d, "PDF/X-4");
+ assert_eq!(d.s("standard"), "x4");
+ assert!(!d.b("compressImages"));
+ assert!(d.b("marksCrop"));
+ assert!(d.b("marksBleed"));
+ assert!(!d.b("marksPageInfo"));
+ assert_eq!(d.s("flatten"), "medium");
+ }
+
+ #[test]
+ fn pdf_export_preset_pdf_a2b_keeps_flatten() {
+ let mut d = Dialog::new("pdfExport", json!({}));
+ d.fields.insert("flatten".into(), json!("low"));
+ apply_pdf_preset(&mut d, "PDF/A-2b");
+ assert_eq!(d.s("standard"), "a2b");
+ assert!(!d.b("compressImages"));
+ assert!(!d.b("marksCrop"));
+ assert!(!d.b("marksBleed"));
+ assert!(!d.b("marksPageInfo"));
+ assert_eq!(d.s("flatten"), "low");
+ }
+
+ #[test]
+ fn open_pdf_export_seeds_fields_from_settings() {
+ let mut app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.ui.pdf_export.standard = "x4".into();
+ app.ui.pdf_export.tagged = false;
+ app.ui.pdf_export.marks_crop = true;
+ app.ui.pdf_export.flatten = String::new();
+ app.ui.flattener = "medium".into();
+ open_pdf_export(&mut app);
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert_eq!(d.id, "pdfExport");
+ assert_eq!(d.s("standard"), "x4");
+ assert!(!d.b("tagged"));
+ assert!(d.b("marksCrop"));
+ assert_eq!(d.s("pages"), "all");
+ assert_eq!(d.s("flatten"), "medium", "empty flatten falls back to the global flattener");
+ assert_eq!(d.s("title"), "", "no document → empty title");
+
+ // A non-empty persisted flatten is used verbatim, not the global fallback.
+ app.ui.pdf_export.flatten = "low".into();
+ app.ui.flattener = "medium".into();
+ open_pdf_export(&mut app);
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert_eq!(d.s("flatten"), "low");
+ }
+
+ #[test]
+ fn pdf_export_preset_custom_changes_nothing() {
+ let mut d = Dialog::new("pdfExport", json!({}));
+ d.fields.insert("standard".into(), json!("x4"));
+ d.fields.insert("compressImages".into(), json!(true));
+ d.fields.insert("marksCrop".into(), json!(true));
+ d.fields.insert("marksBleed".into(), json!(true));
+ d.fields.insert("marksPageInfo".into(), json!(true));
+ d.fields.insert("flatten".into(), json!("high"));
+ let before = d.fields.clone();
+ apply_pdf_preset(&mut d, "Custom");
+ assert_eq!(d.fields, before);
+ }
+
+ #[test]
+ fn confirm_pdf_export_writes_file_and_persists_settings() {
+ use std::sync::{Arc, Mutex};
+ let mut app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.session.execute("file.new", &json!({})).unwrap();
+ let writes: Arc<Mutex<Vec<(String, Vec<u8>)>>> = Arc::new(Mutex::new(Vec::new()));
+ let sink = writes.clone();
+ app.services.write = Some(Box::new(move |path: &str, bytes: &[u8]| {
+ sink.lock().unwrap().push((path.to_string(), bytes.to_vec()));
+ Ok(())
+ }));
+ app.answer_dialogs(crate::app::file_dialogs::testing::answer_with(Some("/tmp/designcraft-test.pdf".into())));
+
+ app.ui.dialog = Some(Dialog::new("pdfExport", json!({})));
+ {
+ let d = app.ui.dialog.as_mut().unwrap();
+ d.fields.insert("standard".into(), json!("x4"));
+ d.fields.insert("bleed".into(), json!(false));
+ d.fields.insert("marksCrop".into(), json!(true));
+ d.fields.insert("tagged".into(), json!(false));
+ d.fields.insert("title".into(), json!("Report"));
+ }
+ confirm(&mut app).unwrap();
+ app.settle_dialogs();
+
+ let got = writes.lock().unwrap();
+ assert_eq!(got.len(), 1, "confirming the dialog writes exactly one file");
+ assert_eq!(got[0].0, "/tmp/designcraft-test.pdf");
+ assert!(got[0].1.starts_with(b"%PDF"), "the written bytes are a PDF");
+ drop(got);
+
+ assert_eq!(app.ui.pdf_export.standard, "x4");
+ assert!(!app.ui.pdf_export.bleed);
+ assert!(app.ui.pdf_export.marks_crop);
+ assert!(!app.ui.pdf_export.tagged);
+ }
+
+ #[test]
+ fn update_link_asks_before_replacing_edits_made_in_the_layout() {
+ let dir = std::env::temp_dir().join(format!("dc-update-link-dialog-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ std::fs::create_dir_all(&dir).unwrap();
+ let path = dir.join("note.txt");
+ std::fs::write(&path, "One").unwrap();
+ let mut app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.session.execute("file.new", &json!({})).unwrap();
+ let r = app.session.execute("file.place", &json!({"path": path.to_string_lossy(), "link": true, "rect": [72, 72, 300, 200]})).unwrap();
+ let sid = r["story"].as_u64().unwrap();
+ let text = |app: &crate::DesignApp| app.session.doc().unwrap().doc.story(designcraft_doc::StoryId(sid)).unwrap().text.clone();
+
+ // Not edited in the layout: updates without asking.
+ std::fs::write(&path, "Two").unwrap();
+ crate::panels::properties::update_links(&mut app, json!({"story": sid}));
+ assert!(app.ui.dialog.is_none());
+ assert_eq!(text(&app), "Two");
+
+ // Edited in the layout: asks first; Cancel changes nothing.
+ app.session.execute("story.setText", &json!({"story": sid, "text": "Mine"})).unwrap();
+ std::fs::write(&path, "Three").unwrap();
+ crate::panels::properties::update_links(&mut app, json!({"story": sid}));
+ let d = app.ui.dialog.as_ref().unwrap();
+ assert_eq!((d.id.as_str(), d.s("files").as_str()), ("updateLink", "note.txt"));
+ app.ui.dialog = None;
+ assert_eq!(text(&app), "Mine");
+
+ // Window › Links › Update Link (all links) asks too; confirming updates.
+ crate::menus::activate(&mut app, "links.update", &Value::Null);
+ assert_eq!(app.ui.dialog.as_ref().map(|d| d.id.as_str()), Some("updateLink"));
+ confirm(&mut app).unwrap();
+ assert!(app.ui.dialog.is_none());
+ assert_eq!(text(&app), "Three");
+ let _ = std::fs::remove_dir_all(&dir);
+ }
+
+ #[test]
+ fn confirm_pdf_export_cancelled_save_writes_nothing() {
+ use std::sync::{Arc, Mutex};
+ let mut app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.session.execute("file.new", &json!({})).unwrap();
+ let writes: Arc<Mutex<Vec<(String, Vec<u8>)>>> = Arc::new(Mutex::new(Vec::new()));
+ let sink = writes.clone();
+ app.services.write = Some(Box::new(move |path: &str, bytes: &[u8]| {
+ sink.lock().unwrap().push((path.to_string(), bytes.to_vec()));
+ Ok(())
+ }));
+ app.answer_dialogs(crate::app::file_dialogs::testing::answer_with(None));
+
+ app.ui.dialog = Some(Dialog::new("pdfExport", json!({})));
+ let r = confirm(&mut app).unwrap();
+ assert_eq!(r, Value::Null);
+ app.settle_dialogs();
+ assert!(writes.lock().unwrap().is_empty(), "cancelling the save picker must not write");
+ }
+
+ use designcraft_doc::{CharAttrs, CharacterStyle};
+
+ /// A document with character styles Base (bold) and Emphasis (italic) on the first two letters.
+ fn styled_app() -> DesignApp {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("style.character.create", json!({"name": "Base", "chars": {"fontStyle": "Bold"}})).unwrap();
+ app.run("style.character.create", json!({"name": "Emphasis", "chars": {"fontStyle": "Italic"}})).unwrap();
+ let r = app.run("frame.create", json!({"rect": [72, 72, 300, 200], "content": "text", "text": "Hi there"})).unwrap();
+ app.run("text.select", json!({"story": r["story"], "anchor": 0, "focus": 2})).unwrap();
+ app.run("style.character.apply", json!({"name": "Emphasis"})).unwrap();
+ app
+ }
+
+ /// One control-channel request, as the control port or MCP would send it.
+ fn ctl(app: &mut DesignApp, method: &str, params: Value) -> Value {
+ let (req, _reply) = crate::control::ControlRequest::new(method, params);
+ match crate::control::handle(app, &egui::Context::default(), &req) {
+ crate::control::Outcome::Done(v) => v,
+ crate::control::Outcome::Screenshot { .. } => Value::Null,
+ }
+ }
+
+ fn char_style(app: &DesignApp, name: &str) -> Option<CharacterStyle> {
+ app.session.active().and_then(|st| st.doc.styles.char_style(name).cloned())
+ }
+
+ #[test]
+ fn character_style_options_set_exactly_the_edited_attributes() {
+ let mut app = styled_app();
+ assert_eq!(ctl(&mut app, "ui.dialog.open", json!({"id": "characterStyleOptions", "fields": {"name": "Emphasis"}}))["ok"], true);
+ ctl(&mut app, "ui.dialog.set", json!({"field": "c.size", "value": 14}));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "c.fill", "value": "[Paper]"}));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "basedOn", "value": "Base"}));
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ assert!(app.ui.dialog.is_none());
+ let st = char_style(&app, "Emphasis").unwrap();
+ assert_eq!(st.based_on.as_deref(), Some("Base"));
+ assert_eq!(st.chars, CharAttrs { font_style: Some("Italic".into()), size: Some(14.0), fill: Some("[Paper]".into()), ..Default::default() });
+ }
+
+ #[test]
+ fn character_style_options_unset_cleared_fields_and_rename_every_use() {
+ let mut app = styled_app();
+ ctl(&mut app, "ui.dialog.open", json!({"id": "characterStyleOptions", "fields": {"name": "Emphasis"}}));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "c.fontStyle", "value": null}));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "rename", "value": "Strong"}));
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ assert!(char_style(&app, "Emphasis").is_none());
+ assert!(char_style(&app, "Strong").unwrap().chars.is_empty());
+ let st = app.session.active().unwrap();
+ let story = st.doc.stories.values().next().unwrap();
+ assert!(story.chars.iter().any(|r| r.format.style == "Strong"));
+ // A taken name keeps the dialog open with the reason.
+ ctl(&mut app, "ui.dialog.open", json!({"id": "characterStyleOptions", "fields": {"name": "Strong"}}));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "rename", "value": "Base"}));
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], false);
+ assert!(app.ui.dialog.as_ref().is_some_and(|d| !d.s("status").is_empty()));
+ assert!(char_style(&app, "Strong").is_some());
+ }
+
+ #[test]
+ fn new_character_style_opens_its_options_and_creates_the_style() {
+ let mut app = styled_app();
+ crate::menus::activate(&mut app, "style.character.create", &Value::Null);
+ let d = app.ui.dialog.clone().unwrap();
+ assert_eq!((d.id.as_str(), d.b("new"), d.s("rename").as_str()), ("characterStyleOptions", true, "Character Style 1"));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "c.size", "value": 9}));
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ let st = char_style(&app, "Character Style 1").unwrap();
- assert_eq!((st.based_on, st.chars), (None, CharAttrs { size: Some(9.0), ..Default::default() }));
++ // The selected text's own Italic (its Emphasis style) comes along, as InDesign's New
++ // Character Style takes it.
++ assert_eq!((st.based_on, st.chars), (None, CharAttrs { size: Some(9.0), font_style: Some("Italic".into()), ..Default::default() }));
+ crate::menus::activate(&mut app, "style.character.create", &Value::Null);
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("rename"), "Character Style 2");
+ }
+
+ #[test]
+ fn new_paragraph_style_opens_its_options_and_creates_the_style() {
+ let mut app = styled_app();
+ crate::menus::activate(&mut app, "style.paragraph.create", &Value::Null);
+ let d = app.ui.dialog.clone().unwrap();
+ assert_eq!((d.id.as_str(), d.b("new"), d.s("rename").as_str()), ("paragraphStyleOptions", true, "Paragraph Style 1"));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "c.size", "value": 20}));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "basedOn", "value": designcraft_doc::BASIC_PARAGRAPH}));
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ let st = app.session.active().unwrap().doc.styles.para("Paragraph Style 1").cloned().unwrap();
+ assert_eq!(st.based_on.as_deref(), Some(designcraft_doc::BASIC_PARAGRAPH));
- assert_eq!(st.chars, CharAttrs { size: Some(20.0), ..Default::default() });
++ // The selected text's own Italic comes along, as InDesign's New Paragraph Style takes it.
++ assert_eq!(st.chars, CharAttrs { size: Some(20.0), font_style: Some("Italic".into()), ..Default::default() });
+ }
+
+ #[test]
+ fn style_rows_open_their_options_except_none() {
+ let mut app = styled_app();
+ open_style_options(&mut app, false, "Emphasis");
+ let d = app.ui.dialog.take().unwrap();
+ assert_eq!((d.id.as_str(), d.s("name").as_str()), ("characterStyleOptions", "Emphasis"));
+ open_style_options(&mut app, false, designcraft_doc::NO_CHAR_STYLE);
+ assert!(app.ui.dialog.is_none());
+ open_style_options(&mut app, true, designcraft_doc::BASIC_PARAGRAPH);
+ assert_eq!(app.ui.dialog.take().unwrap().id, "paragraphStyleOptions");
+ }
+
+ #[test]
+ fn style_options_sections_draw() {
+ let mut app = styled_app();
+ let ctx = egui::Context::default();
+ let frame = |app: &mut DesignApp| {
+ for _ in 0..2 {
+ let raw = egui::RawInput {
+ screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1440.0, 900.0))),
+ max_texture_side: Some(8192),
+ ..Default::default()
+ };
+ let mut out = ctx.run_ui(raw, |ui| {
+ app.logic(&ui.ctx().clone());
+ app.ui(ui);
+ });
+ out.textures_delta.clear();
+ }
+ };
+ for lang in ["", "ar"] {
+ app.run("app.language", json!({"lang": lang})).unwrap();
+ for fields in [json!({"name": "Emphasis"}), json!({"new": true}), json!({"name": "Emphasis", "c.size": null, "c.underline": false})] {
+ for section in ["general", "chars", "advanced", "color", "openType", "underline", "strikethrough"] {
+ let mut f = fields.clone();
+ f["section"] = json!(section);
+ app.ui.dialog = Some(Dialog::new("characterStyleOptions", f));
+ frame(&mut app);
+ assert!(app.ui.dialog.is_some(), "{section} stays open");
+ }
+ }
+ for section in
+ ["general", "chars", "advanced", "border", "shading", "keep", "span", "bullets", "color", "openType", "underline", "strikethrough"]
+ {
+ for fields in [
+ json!({"new": true}),
+ json!({"new": true, "p.listType": "bullets", "p.spanColumns": {"kind": "span", "columns": 0}, "p.borderOn": true}),
+ json!({"new": true, "p.listType": "numbers", "p.startAt": 1, "p.spanColumns": {"kind": "split", "columns": 2}, "p.keepLinesTogether": true}),
+ ] {
+ let mut f = fields;
+ f["section"] = json!(section);
+ app.ui.dialog = Some(Dialog::new("paragraphStyleOptions", f));
+ frame(&mut app);
+ assert!(app.ui.dialog.is_some(), "{section} stays open");
+ }
+ }
+ }
+ }
+
+ #[test]
+ fn dragging_the_title_moves_the_dialog_and_dragging_the_body_does_not() {
+ use egui::{Event, Modifiers, PointerButton, Pos2, vec2};
+ use egui_kittest::{Harness, kittest::Queryable};
+ fn drag(h: &mut Harness<'static, DesignApp>, from: Pos2, to: Pos2) {
+ h.event(Event::PointerMoved(from));
+ h.run_steps(1);
+ h.event(Event::PointerButton { pos: from, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE });
+ h.run_steps(1);
+ for step in 1..=8 {
+ h.event(Event::PointerMoved(from + (to - from) * (step as f32 / 8.0)));
+ h.run_steps(1);
+ }
+ h.event(Event::PointerButton { pos: to, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE });
+ h.run_steps(3);
+ }
+ let rect = |h: &Harness<'static, DesignApp>| h.ctx.memory(|m| m.area_rect(egui::Id::unique("dialog"))).unwrap();
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.ui.dialog = Some(Dialog::new("insertTable", Value::Null));
+ let mut ready = false;
+ let mut h = Harness::builder().with_size(vec2(1200.0, 800.0)).with_step_dt(1.0 / 60.0).build_ui_state(
+ move |ui, app: &mut DesignApp| {
+ if !ready {
+ crate::theme::install_fonts(ui.ctx(), &app.ui.language);
+ crate::theme::apply(ui.ctx(), &crate::theme::Tokens::for_brightness(crate::theme::Brightness::default()));
+ ready = true;
+ return;
+ }
+ show(app, ui.ctx());
+ },
+ app,
+ );
+ h.run_steps(4);
+ let centred = rect(&h);
+ assert!((centred.center() - egui::pos2(600.0, 400.0)).length() < 1.0, "{centred:?}");
+ assert!(centred.width() < 1000.0 && centred.height() < 700.0, "the area is the dialog, not the backdrop: {centred:?}");
+
+ let title = h.get_by_label("Create Table").rect().center();
+ drag(&mut h, title, title + vec2(100.0, 60.0));
+ let moved = rect(&h);
+ assert!((moved.min - centred.min - vec2(100.0, 60.0)).length() < 2.0, "{centred:?} -> {moved:?}");
+
+ let body = egui::pos2(moved.right() - 40.0, moved.center().y);
+ drag(&mut h, body, body + vec2(-150.0, 80.0));
+ assert_eq!(rect(&h), moved, "a drag in the body leaves the dialog in place");
+
+ // The title row stays inside the top edge.
+ let title = h.get_by_label("Create Table").rect().center();
+ drag(&mut h, title, title - vec2(0.0, 1000.0));
+ assert!(rect(&h).top().abs() < 1.0, "{:?}", rect(&h));
+
+ // Opened again, the dialog starts centred.
+ h.state_mut().ui.dialog = None;
+ h.run_steps(2);
+ h.state_mut().ui.dialog = Some(Dialog::new("insertTable", Value::Null));
+ h.run_steps(4);
+ assert!((rect(&h).center() - centred.center()).length() < 1.0, "{:?}", rect(&h));
+
+ // Past the left edge, about 100 px of the title row stays inside.
+ let title = h.get_by_label("Create Table").rect().center();
+ drag(&mut h, title, title - vec2(900.0, 0.0));
+ assert!((rect(&h).right() - 100.0).abs() < 2.0, "{:?}", rect(&h));
+ }
+
+ #[test]
+ fn the_new_document_window_drags_mostly_aside_and_keeps_its_preview() {
+ use egui::{Event, Modifiers, PointerButton, vec2};
+ use egui_kittest::{Harness, kittest::Queryable};
+ let rect = |h: &Harness<'static, DesignApp>| h.ctx.memory(|m| m.area_rect(egui::Id::unique("dialog"))).unwrap();
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"title": "A"})).unwrap();
+ app.ui.new_document_preview = true;
+ app.run("app.newDocumentDialog", json!({})).unwrap();
+ let mut ready = false;
+ let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_step_dt(1.0 / 60.0).build_ui_state(
+ move |ui, app: &mut DesignApp| {
+ if !ready {
+ crate::theme::install_fonts(ui.ctx(), &app.ui.language);
+ crate::theme::apply(ui.ctx(), &crate::theme::Tokens::for_brightness(crate::theme::Brightness::default()));
+ ready = true;
+ return;
+ }
+ show(app, ui.ctx());
+ },
+ app,
+ );
+ h.run_steps(6);
+ let preview = h.state().session.new_document_preview();
+ assert!(preview.is_some(), "Preview is on");
+ let centred = rect(&h);
+ assert!(centred.width() > 900.0, "{centred:?}");
+ let from = h.get_all_by_label("New Document").map(|n| n.rect().center()).min_by(|a, b| a.y.total_cmp(&b.y)).unwrap();
+ let to = from + vec2(1300.0, 0.0);
+ h.event(Event::PointerMoved(from));
+ h.run_steps(1);
+ h.event(Event::PointerButton { pos: from, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE });
+ h.run_steps(1);
+ for step in 1..=8 {
+ h.event(Event::PointerMoved(from + (to - from) * (step as f32 / 8.0)));
+ h.run_steps(1);
+ }
+ h.event(Event::PointerButton { pos: to, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE });
+ h.run_steps(3);
+ // All but 100 px of the window's width is past the right edge, over the preview.
+ assert!((rect(&h).left() - 1300.0).abs() < 2.0, "{:?}", rect(&h));
+ let app = h.state();
+ assert_eq!(app.ui.dialog.as_ref().map(|d| d.id.as_str()), Some("newDocument"));
+ assert_eq!(app.session.new_document_preview(), preview, "moving the window keeps the preview");
+ assert_eq!(app.session.documents().len(), 2);
+ }
+
+ #[test]
+ fn margins_dialog_reads_bare_numbers_in_the_ruler_unit() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ app.run("document.preferences", json!({"horizontalUnits": "millimeters"})).unwrap();
+ crate::menus::activate(&mut app, "layout.marginsAndColumns", &Value::Null);
+ for k in ["marginTop", "marginBottom", "marginInside", "marginOutside"] {
+ ctl(&mut app, "ui.dialog.set", json!({"field": k, "value": "15"}));
+ }
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ let top = app.session.active().unwrap().doc.page(0).unwrap().margins.top;
+ assert!((top - 15.0 * 72.0 / 25.4).abs() < 0.01, "top margin was {top} pt");
+ }
+ fn facing_app(pages: u64) -> DesignApp {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({"pages": pages, "facingPages": true})).unwrap();
+ app.canvas_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1400.0, 900.0)));
+ app
+ }
+
+ fn guide_counts(app: &DesignApp) -> Vec<usize> {
+ let doc = &app.session.active().unwrap().doc;
+ (0..doc.page_count()).map(|abs| doc.page(abs).unwrap().guides.len()).collect()
+ }
+
+ #[test]
+ fn create_guides_dialog_targets_the_page_in_view() {
+ let mut app = facing_app(6);
+ crate::canvas::go_to_page(&mut app, 4);
+ crate::menus::activate(&mut app, "layout.createGuides", &Value::Null);
+ ctl(&mut app, "ui.dialog.set", json!({"field": "columns", "value": "3"}));
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ assert_eq!(guide_counts(&app), vec![0, 0, 0, 0, 4, 0]);
+ // "Both pages of the spread" covers the facing pair.
+ crate::canvas::go_to_page(&mut app, 1);
+ crate::menus::activate(&mut app, "layout.createGuides", &Value::Null);
+ ctl(&mut app, "ui.dialog.set", json!({"field": "columns", "value": "2"}));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "target", "value": "spread"}));
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ assert_eq!(guide_counts(&app), vec![0, 2, 2, 0, 4, 0]);
+ }
+
+ #[test]
+ fn parent_dialogs_cover_both_pages_of_the_parent_spread_by_default() {
+ let mut app = facing_app(4);
+ app.run("layout.parents.edit", json!({"on": true})).unwrap();
+ crate::menus::activate(&mut app, "layout.marginsAndColumns", &Value::Null);
+ assert_eq!(app.ui.dialog.as_ref().unwrap().s("target"), "spread");
+ for k in ["marginTop", "marginBottom", "marginInside", "marginOutside"] {
+ ctl(&mut app, "ui.dialog.set", json!({"field": k, "value": "20 pt"}));
+ }
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ crate::menus::activate(&mut app, "layout.createGuides", &Value::Null);
+ ctl(&mut app, "ui.dialog.set", json!({"field": "columns", "value": "2"}));
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ let doc = &app.session.active().unwrap().doc;
+ for pg in &doc.parents[0].pages {
+ assert_eq!((pg.margins.top, pg.margins.outside, pg.guides.len()), (20.0, 20.0, 2));
+ }
+ // Every document page shows the parent's guides.
+ assert!((0..doc.page_count()).all(|abs| doc.inherited_guides(abs).len() == 2));
+ }
+
+ #[test]
+ fn other_dialogs_keep_reading_bare_numbers_as_picas() {
+ let mut app = facing_app(2);
+ app.run("document.preferences", json!({"horizontalUnits": "millimeters"})).unwrap();
+ app.ui.dialog = Some(Dialog::new("newDocument", json!({"width": "15"})));
+ assert_eq!(app.ui.dialog.as_ref().unwrap().m("width"), Some(180.0));
+ }
+ #[test]
+ fn character_style_options_set_the_digits() {
+ let mut app = styled_app();
+ ctl(&mut app, "ui.dialog.open", json!({"id": "characterStyleOptions", "fields": {"name": "Emphasis"}}));
+ ctl(&mut app, "ui.dialog.set", json!({"field": "c.digits", "value": "farsi"}));
+ assert_eq!(ctl(&mut app, "ui.dialog.confirm", json!({}))["ok"], true);
+ assert_eq!(char_style(&app, "Emphasis").unwrap().chars.digits, Some(designcraft_doc::Digits::Farsi));
+ }
diff --cc crates/ui-egui/src/i18n/table.rs
index 000000000,fc1618bf2..0c0454d3b
mode 000000,100644..100644
--- a/crates/ui-egui/src/i18n/table.rs
+++ b/crates/ui-egui/src/i18n/table.rs
@@@ -1,0 -1,4678 +1,4693 @@@
+ /// English → [German, French, Spanish, Japanese, Simplified Chinese].
+ pub(super) const TABLE: &[(&str, [&str; 5])] = &[
++ ("Next Style:", ["Nächstes Format:", "Style suivant :", "Estilo siguiente:", "次のスタイル :", "下一样式:"]),
++ ("[Same style]", ["[Gleiches Format]", "[Même style]", "[Mismo estilo]", "[同じスタイル]", "[相同样式]"]),
++ ("Reset To Base", ["Auf Basis zurücksetzen", "Rétablir la base", "Restablecer a base", "基準に戻す", "重置为基准"]),
++ ("New Paragraph Style", ["Neues Absatzformat", "Nouveau style de paragraphe", "Nuevo estilo de párrafo", "新規段落スタイル", "新建段落样式"]),
++ ("New Character Style", ["Neues Zeichenformat", "Nouveau style de caractère", "Nuevo estilo de carácter", "新規文字スタイル", "新建字符样式"]),
++ (
++ "Apply Style to Selection",
++ [
++ "Format auf Auswahl anwenden",
++ "Appliquer le style à la sélection",
++ "Aplicar estilo a la selección",
++ "選択範囲にスタイルを適用",
++ "将样式应用于选区",
++ ],
++ ),
+ (
+ "Character Formatting Controls",
+ [
+ "Steuerelemente für Zeichenformatierung",
+ "Commandes de mise en forme des caractères",
+ "Controles de formato de carácter",
+ "文字形式コントロール",
+ "字符格式控制",
+ ],
+ ),
+ (
+ "Paragraph Formatting Controls",
+ [
+ "Steuerelemente für Absatzformatierung",
+ "Commandes de mise en forme des paragraphes",
+ "Controles de formato de párrafo",
+ "段落形式コントロール",
+ "段落格式控制",
+ ],
+ ),
+ ("Font Size", ["Schriftgrad", "Corps", "Tamaño de fuente", "フォントサイズ", "字体大小"]),
+ ("Vertical Scale", ["Vertikal skalieren", "Échelle verticale", "Escala vertical", "垂直比率", "垂直缩放"]),
+ ("Horizontal Scale", ["Horizontal skalieren", "Échelle horizontale", "Escala horizontal", "水平比率", "水平缩放"]),
+ ("Baseline Shift", ["Grundlinienversatz", "Décalage vertical", "Desplazamiento vertical", "ベースラインシフト", "基线偏移"]),
+ (
+ "Skew (False Italic)",
+ ["Verzerren (falscher Kursivstil)", "Inclinaison (faux italique)", "Sesgar (cursiva falsa)", "歪み(斜体)", "倾斜(伪斜体)"],
+ ),
+ ("Left Indent", ["Einzug links", "Retrait gauche", "Sangría izquierda", "左インデント", "左缩进"]),
+ ("Right Indent", ["Einzug rechts", "Retrait droit", "Sangría derecha", "右インデント", "右缩进"]),
+ (
+ "First Line Left Indent",
+ ["Einzug links in erster Zeile", "Retrait gauche de première ligne", "Sangría izquierda en primera línea", "1行目左インデント", "首行左缩进"],
+ ),
+ (
+ "Last Line Right Indent",
+ ["Einzug rechts in letzter Zeile", "Retrait droit de dernière ligne", "Sangría derecha en última línea", "最終行右インデント", "末行右缩进"],
+ ),
+ (
+ "Drop Cap Number of Lines",
+ ["Initiale: Anzahl der Zeilen", "Lettrine (nombre de lignes)", "Capitular: número de líneas", "ドロップキャップの行数", "首字下沉行数"],
+ ),
+ (
+ "Drop Cap One or More Characters",
+ [
+ "Initiale: ein oder mehrere Zeichen",
+ "Lettrine (un ou plusieurs caractères)",
+ "Capitular: uno o más caracteres",
+ "ドロップキャップの文字数",
+ "首字下沉一个或多个字符",
+ ],
+ ),
+ (
+ "Align to Baseline Grid",
+ [
+ "An Grundlinienraster ausrichten",
+ "Aligner sur la grille de ligne de base",
+ "Alinear con cuadrícula base",
+ "ベースライングリッドに揃える",
+ "对齐基线网格",
+ ],
+ ),
+ // Properties › Paragraph (•••).
+ ("Space Before", ["Abstand davor", "Espace avant", "Espacio anterior", "段落前の間隔", "段前间距"]),
+ ("Space After", ["Abstand danach", "Espace après", "Espacio posterior", "段落後の間隔", "段后间距"]),
+ // Menus.
+ ("File", ["Datei", "Fichier", "Archivo", "ファイル", "文件"]),
+ ("Edit", ["Bearbeiten", "Édition", "Edición", "編集", "编辑"]),
+ ("Layout", ["Layout", "Page", "Maquetación", "レイアウト", "版面"]),
+ ("Type", ["Schrift", "Texte", "Texto", "書式", "文字"]),
+ ("Object", ["Objekt", "Objet", "Objeto", "オブジェクト", "对象"]),
+ ("Table", ["Tabelle", "Tableau", "Tabla", "表", "表"]),
+ ("View", ["Ansicht", "Affichage", "Ver", "表示", "视图"]),
+ ("Window", ["Fenster", "Fenêtre", "Ventana", "ウィンドウ", "窗口"]),
+ ("Help", ["Hilfe", "Aide", "Ayuda", "ヘルプ", "帮助"]),
+ // File.
+ ("New", ["Neu", "Nouveau", "Nuevo", "新規", "新建"]),
+ ("New Document…", ["Neues Dokument …", "Nouveau document…", "Nuevo documento…", "新規ドキュメント…", "新建文档…"]),
+ ("Open…", ["Öffnen …", "Ouvrir…", "Abrir…", "開く…", "打开…"]),
+ (
+ "Open Recent",
+ ["Zuletzt verwendete Datei öffnen", "Ouvrir les fichiers récents", "Abrir recientes", "最近使用したファイルを開く", "打开最近的文件"],
+ ),
+ (
+ "Open Recent File",
+ ["Zuletzt verwendete Datei öffnen", "Ouvrir un fichier récent", "Abrir archivo reciente", "最近使用したファイルを開く", "打开最近的文件"],
+ ),
+ (
+ "Clear Recent Files",
+ ["Liste leeren", "Effacer les fichiers récents", "Borrar archivos recientes", "最近使用したファイルをクリア", "清除最近的文件"],
+ ),
+ ("Recent files", ["Zuletzt geöffnet", "Fichiers récents", "Archivos recientes", "最近使用したファイル", "最近的文件"]),
+ (
+ "Number of Recent Items to Display:",
+ [
+ "Anzahl zuletzt verwendeter Dateien:",
+ "Nombre de fichiers récents à afficher :",
+ "Número de elementos recientes:",
+ "最近使用したファイルの表示数:",
+ "最近项目显示数量:",
+ ],
+ ),
+ ("Close", ["Schließen", "Fermer", "Cerrar", "閉じる", "关闭"]),
+ ("Dismiss", ["Ausblenden", "Ignorer", "Descartar", "閉じる", "关闭"]),
+ ("Save", ["Speichern", "Enregistrer", "Guardar", "保存", "保存"]),
+ ("Save As…", ["Speichern unter …", "Enregistrer sous…", "Guardar como…", "別名で保存…", "另存为…"]),
+ ("Save a Copy…", ["Kopie speichern …", "Enregistrer une copie…", "Guardar una copia…", "コピーを保存…", "保存副本…"]),
+ ("Revert", ["Zurück zur letzten Version", "Version précédente", "Volver a la versión guardada", "復帰", "恢复到上次保存"]),
+ ("Place…", ["Platzieren …", "Importer…", "Colocar…", "配置…", "置入…"]),
+ ("Export PDF…", ["PDF exportieren …", "Exporter en PDF…", "Exportar PDF…", "PDF を書き出し…", "导出PDF…"]),
+ ("Print…", ["Drucken …", "Imprimer…", "Imprimir…", "プリント…", "打印…"]),
+ ("Document Setup…", ["Dokument einrichten …", "Format de document…", "Ajustar documento…", "ドキュメント設定…", "文档设置…"]),
+ ("File Info…", ["Dateiinformationen …", "Informations sur le fichier…", "Información de archivo…", "ファイル情報…", "文件信息…"]),
+ ("File Info", ["Dateiinformationen", "Informations sur le fichier", "Información de archivo", "ファイル情報", "文件信息"]),
+ ("Package…", ["Verpacken …", "Assemblage…", "Empaquetar…", "パッケージ…", "打包…"]),
+ // Edit.
+ ("Undo", ["Rückgängig", "Annuler", "Deshacer", "取り消し", "还原"]),
+ ("Redo", ["Wiederholen", "Rétablir", "Rehacer", "やり直し", "重做"]),
+ ("Cut", ["Ausschneiden", "Couper", "Cortar", "カット", "剪切"]),
+ ("Copy", ["Kopieren", "Copier", "Copiar", "コピー", "复制"]),
+ ("Paste", ["Einfügen", "Coller", "Pegar", "ペースト", "粘贴"]),
+ ("Hide Rulers", ["Lineale ausblenden", "Masquer les règles", "Ocultar reglas", "定規を隠す", "隐藏标尺"]),
+ ("Inches Decimal", ["Zoll dezimal", "Pouces décimaux", "Pulgadas decimales", "インチ(10 進)", "十进制英寸"]),
+ (
+ "Paste Vector Art",
+ ["Vektorgrafik einfügen", "Coller l’illustration vectorielle", "Pegar ilustración vectorial", "ベクトルアートをペースト", "粘贴矢量图稿"],
+ ),
+ ("Back", ["Zurück", "Retour", "Atrás", "戻る", "返回"]),
+ ("Margins and Columns", ["Ränder und Spalten", "Marges et colonnes", "Márgenes y columnas", "マージン・段組", "边距和分栏"]),
+ ("Warning", ["Warnung", "Avertissement", "Advertencia", "警告", "警告"]),
+ ("Don't show again", ["Nicht mehr anzeigen", "Ne plus afficher", "No volver a mostrar", "今後表示しない", "不再显示"]),
+ (
+ "The affected page contains objects. Delete the page anyway?",
+ [
+ "Die betroffene Seite enthält Objekte. Seite trotzdem löschen?",
+ "La page concernée contient des objets. Supprimer quand même la page ?",
+ "La página afectada contiene objetos. ¿Desea eliminarla de todos modos?",
+ "対象のページにはオブジェクトが含まれています。ページを削除しますか?",
+ "受影响的页面包含对象。仍要删除该页面吗?",
+ ],
+ ),
+ (
+ "The affected pages contain objects. Delete the pages anyway?",
+ [
+ "Die betroffenen Seiten enthalten Objekte. Seiten trotzdem löschen?",
+ "Les pages concernées contiennent des objets. Supprimer quand même les pages ?",
+ "Las páginas afectadas contienen objetos. ¿Desea eliminarlas de todos modos?",
+ "対象のページにはオブジェクトが含まれています。ページを削除しますか?",
+ "受影响的页面包含对象。仍要删除这些页面吗?",
+ ],
+ ),
+ ("Capture", ["Erfassen", "Capturer", "Capturar", "取り込み", "捕捉"]),
+ ("Panel Locations", ["Bedienfeldpositionen", "Emplacements des panneaux", "Ubicaciones de paneles", "パネルの位置", "面板位置"]),
+ ("First Page", ["Erste Seite", "Première page", "Primera página", "最初のページ", "第一页"]),
+ ("Previous Page", ["Vorherige Seite", "Page précédente", "Página anterior", "前のページ", "上一页"]),
+ ("Next Page", ["Nächste Seite", "Page suivante", "Página siguiente", "次のページ", "下一页"]),
+ ("Last Page", ["Letzte Seite", "Dernière page", "Última página", "最後のページ", "最后一页"]),
+ ("Go Back", ["Zurück gehen", "Revenir", "Retroceder", "前に戻る", "后退"]),
+ ("Go Forward", ["Vorwärts gehen", "Avancer", "Avanzar", "次に進む", "前进"]),
+ (
+ "Close Tab Group",
+ ["Registerkartengruppe schließen", "Fermer le groupe d'onglets", "Cerrar grupo de fichas", "タブグループを閉じる", "关闭选项卡组"],
+ ),
+ ("Minimize", ["Minimieren", "Réduire", "Minimizar", "最小化", "最小化"]),
+ ("Collapse to Icons", ["Auf Symbole minimieren", "Réduire en icônes", "Contraer a iconos", "アイコンパネルに折りたたむ", "折叠为图标"]),
+ // Docking chrome (craft-ui labels in DesignCraft's wording, `panel_docking::DOCK_LABELS`).
+ ("Group with", ["Gruppieren mit", "Grouper avec", "Agrupar con", "次とグループ化", "编组到"]),
+ ("Panels", ["Bedienfelder", "Panneaux", "Paneles", "パネル", "面板"]),
+ (
+ "Resize panels",
+ ["Größe der Bedienfelder ändern", "Redimensionner les panneaux", "Cambiar tamaño de los paneles", "パネルのサイズを変更", "调整面板大小"],
+ ),
+ (
+ "Resize panel window",
+ [
+ "Größe des Bedienfeldfensters ändern",
+ "Redimensionner la fenêtre de panneau",
+ "Cambiar tamaño de la ventana de panel",
+ "パネルウィンドウのサイズを変更",
+ "调整面板窗口大小",
+ ],
+ ),
+ (
+ "Move tab group",
+ ["Registerkartengruppe verschieben", "Déplacer le groupe d'onglets", "Mover grupo de fichas", "タブグループを移動", "移动选项卡组"],
+ ),
+ ("Expand", ["Erweitern", "Développer", "Expandir", "展開", "展开"]),
+ (
+ "Float Tab Group",
+ [
+ "Registerkartengruppe lösen",
+ "Détacher le groupe d'onglets",
+ "Hacer flotante el grupo de fichas",
+ "タブグループをフローティング表示",
+ "浮动选项卡组",
+ ],
+ ),
+ (
+ "Group Tab Group with",
+ [
+ "Registerkartengruppe gruppieren mit",
+ "Grouper le groupe d'onglets avec",
+ "Agrupar grupo de fichas con",
+ "タブグループを次とグループ化",
+ "将选项卡组编组到",
+ ],
+ ),
+ (
+ "Move panel column",
+ ["Bedienfeldspalte verschieben", "Déplacer la colonne de panneaux", "Mover columna de paneles", "パネル列を移動", "移动面板列"],
+ ),
+ ("Expand Panels", ["Bedienfelder erweitern", "Développer les panneaux", "Expandir paneles", "パネルを展開", "展开面板"]),
+ (
+ "Move panel window",
+ ["Bedienfeldfenster verschieben", "Déplacer la fenêtre de panneau", "Mover ventana de panel", "パネルウィンドウを移動", "移动面板窗口"],
+ ),
+ (
+ "Close panel window",
+ ["Bedienfeldfenster schließen", "Fermer la fenêtre de panneau", "Cerrar ventana de panel", "パネルウィンドウを閉じる", "关闭面板窗口"],
+ ),
+ (
+ "Close Other Panels in Group",
+ [
+ "Andere Bedienfelder der Gruppe schließen",
+ "Fermer les autres panneaux du groupe",
+ "Cerrar los demás paneles del grupo",
+ "グループ内の他のパネルを閉じる",
+ "关闭组中的其他面板",
+ ],
+ ),
+ ("Maximize Frame", ["Bereich maximieren", "Agrandir la zone", "Maximizar área", "領域を最大化", "最大化区域"]),
+ (
+ "Restore Frame Size",
+ ["Bereichsgröße wiederherstellen", "Restaurer la taille de la zone", "Restaurar tamaño del área", "領域のサイズを元に戻す", "恢复区域大小"],
+ ),
+ (
+ "Move Panel to New Window",
+ [
+ "Bedienfeld in neues Fenster verschieben",
+ "Déplacer le panneau dans une nouvelle fenêtre",
+ "Mover panel a una ventana nueva",
+ "パネルを新規ウィンドウに移動",
+ "将面板移到新窗口",
+ ],
+ ),
+ (
+ "Auto-Collapse Iconic Panels",
+ [
+ "Symbolbedienfelder automatisch minimieren",
+ "Réduire automatiquement les panneaux d’icônes",
+ "Contraer automáticamente los paneles de iconos",
+ "アイコンパネルを自動的に折りたたむ",
+ "自动折叠图标面板",
+ ],
+ ),
+ ("Panel Options", ["Bedienfeldoptionen", "Options du panneau", "Opciones de panel", "パネルオプション", "面板选项"]),
+ ("Panel Options…", ["Bedienfeldoptionen…", "Options du panneau…", "Opciones de panel…", "パネルオプション…", "面板选项…"]),
+ ("Show Thumbnails", ["Miniaturen anzeigen", "Afficher les vignettes", "Mostrar miniaturas", "サムネールを表示", "显示缩览图"]),
+ ("Show Vertically", ["Vertikal anzeigen", "Afficher verticalement", "Mostrar verticalmente", "縦に表示", "垂直显示"]),
+ ("Panel Layout", ["Bedienfeldlayout", "Disposition du panneau", "Diseño del panel", "パネルレイアウト", "面板版面"]),
+ ("Pages on Top", ["Seiten oben", "Pages en haut", "Páginas en la parte superior", "ページを上に表示", "页面在上"]),
+ (
+ "Parents on Top",
+ ["Übergeordnete Seiten oben", "Gabarits en haut", "Páginas principales en la parte superior", "親ページを上に表示", "父页面在上"],
+ ),
+ ("Resize:", ["Größe ändern:", "Redimensionner :", "Cambiar tamaño:", "サイズ変更:", "调整大小:"]),
+ ("Extra Small", ["Sehr klein", "Très petite", "Extra pequeño", "極小", "特小"]),
+ ("Small", ["Klein", "Petite", "Pequeño", "小", "小"]),
+ ("Medium", ["Mittel", "Moyenne", "Mediano", "中", "中"]),
+ ("Large", ["Groß", "Grande", "Grande", "大", "大"]),
+ ("Extra Large", ["Sehr groß", "Très grande", "Extra grande", "特大", "特大"]),
+ ("Jumbo", ["Riesig", "Géante", "Gigante", "最大", "巨大"]),
+ ("Proportional", ["Proportional", "Proportionnel", "Proporcional", "比例", "按比例"]),
+ ("Pages Fixed", ["Seiten fixiert", "Pages fixes", "Páginas fijas", "ページを固定", "页面固定"]),
+ ("Parents Fixed", ["Übergeordnete fixiert", "Gabarits fixes", "Páginas principales fijas", "親ページを固定", "父页面固定"]),
+ ("Parents", ["Übergeordnete Seiten", "Gabarits", "Páginas principales", "親ページ", "父页面"]),
+ (
+ "Bulleted & Numbered Lists",
+ [
+ "Aufzählungszeichen und nummerierte Listen",
+ "Listes à puces et numérotées",
+ "Listas con viñetas y numeradas",
+ "箇条書き",
+ "项目符号列表和编号列表",
+ ],
+ ),
+ ("Current Page Number", ["Aktuelle Seitenzahl", "Numéro de page actuelle", "Número de página actual", "現在のページ番号", "当前页码"]),
+ ("Apply Color (,)", ["Farbe anwenden (,)", "Appliquer la couleur (,)", "Aplicar color (,)", "カラーを適用 (,)", "应用颜色 (,)"]),
+ ("Apply Gradient (.)", ["Verlauf anwenden (.)", "Appliquer le dégradé (.)", "Aplicar degradado (.)", "グラデーションを適用 (.)", "应用渐变 (.)"]),
+ ("View Options", ["Ansichtsoptionen", "Options d’affichage", "Opciones de visualización", "表示オプション", "视图选项"]),
+ ("Frame Edges", ["Rahmenkanten", "Bords du bloc", "Bordes del marco", "フレーム枠", "框架边缘"]),
+ ("Rulers", ["Lineale", "Règles", "Reglas", "定規", "标尺"]),
+ ("Hidden Characters", ["Verborgene Zeichen", "Caractères masqués", "Caracteres ocultos", "制御文字", "隐藏字符"]),
+ ("Flex Layout", ["Flex-Layout", "Mise en page flexible", "Diseño flexible", "フレックスレイアウト", "弹性布局"]),
+ (
+ "Create Flex Layout",
+ ["Flex-Layout erstellen", "Créer une mise en page flexible", "Crear diseño flexible", "フレックスレイアウトを作成", "创建弹性布局"],
+ ),
+ (
+ "Add to Flex Layout",
+ [
+ "Zu Flex-Layout hinzufügen",
+ "Ajouter à la mise en page flexible",
+ "Añadir a diseño flexible",
+ "フレックスレイアウトに追加",
+ "添加到弹性布局",
+ ],
+ ),
+ (
+ "Convert to Flex Layout",
+ [
+ "In Flex-Layout umwandeln",
+ "Convertir en mise en page flexible",
+ "Convertir en diseño flexible",
+ "フレックスレイアウトに変換",
+ "转换为弹性布局",
+ ],
+ ),
+ (
+ "Remove Flex Layout",
+ ["Flex-Layout entfernen", "Supprimer la mise en page flexible", "Quitar diseño flexible", "フレックスレイアウトを削除", "移除弹性布局"],
+ ),
+ (
+ "Show Flex Controls",
+ [
+ "Flex-Steuerelemente einblenden",
+ "Afficher les commandes flexibles",
+ "Mostrar controles flexibles",
+ "フレックスコントロールを表示",
+ "显示弹性控件",
+ ],
+ ),
+ (
+ "Flex Layout Options",
+ ["Flex-Layout-Optionen", "Options de mise en page flexible", "Opciones de diseño flexible", "フレックスレイアウトオプション", "弹性布局选项"],
+ ),
+ (
+ "Reorder in Flex Layout",
+ [
+ "Im Flex-Layout umordnen",
+ "Réorganiser dans la mise en page flexible",
+ "Reordenar en diseño flexible",
+ "フレックスレイアウト内で並べ替え",
+ "在弹性布局中重新排序",
+ ],
+ ),
+ ("Flex Start", ["Flex-Anfang", "Début flexible", "Inicio flexible", "フレックス開始", "弹性起点"]),
+ ("Flex End", ["Flex-Ende", "Fin flexible", "Fin flexible", "フレックス終了", "弹性终点"]),
+ ("Space Between", ["Abstand dazwischen", "Espace entre", "Espacio entre", "間隔を均等", "两端对齐"]),
+ ("Space Around", ["Abstand ringsum", "Espace autour", "Espacio alrededor", "周囲に間隔", "周围间距"]),
+ ("Space Evenly", ["Gleichmäßig verteilen", "Espace uniforme", "Espacio uniforme", "均等に配置", "均匀分布"]),
+ ("Row", ["Zeile", "Ligne", "Fila", "行", "行"]),
+ ("Reverse Row", ["Zeile umgekehrt", "Ligne inversée", "Fila invertida", "行(逆方向)", "反向行"]),
+ ("Reverse Column", ["Spalte umgekehrt", "Colonne inversée", "Columna invertida", "列(逆方向)", "反向列"]),
+ ("Wrap Content", ["Inhalt umbrechen", "Renvoyer le contenu à la ligne", "Ajustar contenido", "コンテンツを折り返す", "内容换行"]),
+ ("Spacing", ["Abstände", "Espacement", "Espaciado", "間隔", "间距"]),
+ ("Horizontal Spacing", ["Horizontaler Abstand", "Espacement horizontal", "Espaciado horizontal", "水平方向の間隔", "水平间距"]),
+ ("Vertical Spacing", ["Vertikaler Abstand", "Espacement vertical", "Espaciado vertical", "垂直方向の間隔", "垂直间距"]),
+ ("Constrain proportions", ["Proportionen beibehalten", "Conserver les proportions", "Restringir proporciones", "縦横比を固定", "约束比例"]),
+ ("Auto", ["Automatisch", "Automatique", "Automático", "自動", "自动"]),
+ ("W:", ["B:", "L :", "An.:", "幅:", "宽:"]),
+ ("H:", ["H:", "H :", "Al.:", "高さ:", "高:"]),
+ ("Number:", ["Zahl:", "Numéro:", "Número:", "番号:", "编号:"]),
+ ("Gutter:", ["Steg:", "Gouttière :", "Medianil:", "間隔:", "栏间距:"]),
+ ("Fit Guides to:", ["Hilfslinien einpassen in:", "Ajuster les repères à :", "Ajustar guías a:", "ガイドの適用先:", "参考线适合:"]),
+ ("Top:", ["Oben:", "Haut :", "Superior:", "天:", "上:"]),
+ ("Bottom:", ["Unten:", "Bas :", "Inferior:", "地:", "下:"]),
+ ("Inside:", ["Innen:", "Intérieur :", "Interior:", "ノド:", "内:"]),
+ ("Outside:", ["Außen:", "Extérieur :", "Exterior:", "小口:", "外:"]),
+ ("Left:", ["Links:", "Gauche :", "Izquierda:", "左:", "左:"]),
+ ("Right:", ["Rechts:", "Droite :", "Derecha:", "右:", "右:"]),
+ ("Paths:", ["Pfade:", "Tracés :", "Trazados:", "パス:", "路径:"]),
+ ("Pathfinder:", ["Pathfinder:", "Pathfinder :", "Buscatrazos:", "パスファインダー:", "路径查找器:"]),
+ ("Convert Shape:", ["Form konvertieren:", "Convertir la forme :", "Convertir forma:", "シェイプを変換:", "转换形状:"]),
+ ("Convert Point:", ["Punkt konvertieren:", "Convertir le point :", "Convertir punto:", "ポイントを変換:", "转换点:"]),
+ ("Join Path", ["Pfad zusammenfügen", "Joindre le tracé", "Unir trazado", "パスを連結", "连接路径"]),
+ ("Open Path", ["Pfad öffnen", "Ouvrir le tracé", "Abrir trazado", "パスをオープン", "开放路径"]),
+ ("Plain", ["Einfach", "Simple", "Normal", "プレーン", "普通"]),
+ ("Symmetrical", ["Symmetrisch", "Symétrique", "Simétrico", "対称", "对称"]),
+ (
+ "The stroke isn't a gradient.",
+ [
+ "Die Kontur ist kein Verlauf.",
+ "Le contour n’est pas un dégradé.",
+ "El trazo no es un degradado.",
+ "線はグラデーションではありません。",
+ "描边不是渐变。",
+ ],
+ ),
+ ("Baseline Options", ["Grundlinienoptionen", "Options de ligne de base", "Opciones de línea de base", "ベースラインオプション", "基线选项"]),
+ ("Fixed Number", ["Feste Anzahl", "Nombre fixe", "Número fijo", "固定数", "固定数字"]),
+ ("Fixed Width", ["Feste Breite", "Largeur fixe", "Anchura fija", "固定幅", "固定宽度"]),
+ ("Inset Spacing", ["Versatzabstand", "Marge intérieure", "Espaciado de margen interior", "フレーム内マージン", "内边距"]),
+ ("Vertical Justification", ["Vertikale Ausrichtung", "Justification verticale", "Justificación vertical", "垂直比率", "垂直对齐"]),
+ ("Align:", ["Ausrichten:", "Alignement :", "Alinear:", "整列:", "对齐:"]),
+ ("Ignore Text Wrap", ["Textumfluss ignorieren", "Ignorer l’habillage", "Ignorar ceñir texto", "テキストの回り込みを無視", "忽略文本绕排"]),
+ ("Technique:", ["Technik:", "Technique :", "Técnica:", "テクニック:", "方法:"]),
+ ("Softer", ["Weicher", "Plus flou", "Más suave", "さらにソフトに", "柔和"]),
+ ("Precise", ["Präzise", "Précis", "Precisa", "精細", "精确"]),
+ ("Corners:", ["Ecken:", "Angles :", "Esquinas:", "角:", "角点:"]),
+ ("Sharp", ["Spitz", "Vifs", "Nítidas", "シャープ", "锐利"]),
+ ("Diffused", ["Weich", "Diffus", "Difusas", "拡散", "扩散"]),
+ ("Reverse Path", ["Pfadrichtung umkehren", "Inverser le tracé", "Invertir trazado", "パスの方向反転", "反转路径"]),
+ ("Set Anchor", ["Ankerpunkt festlegen", "Définir le point d’ancrage", "Definir punto de ancla", "アンカーポイントを設定", "设置锚点"]),
+ ("Effects…", ["Effekte…", "Effets…", "Efectos…", "効果…", "效果…"]),
+ ("Settings for:", ["Einstellungen für:", "Paramètres pour :", "Ajustes para:", "設定対象:", "设置:"]),
+ ("Transparency", ["Transparenz", "Transparence", "Transparencia", "透明", "透明度"]),
+ ("Transparency…", ["Transparenz…", "Transparence…", "Transparencia…", "透明…", "透明度…"]),
+ (
+ "Transparency Flattener",
+ ["Transparenzreduzierung", "Aplatissement de la transparence", "Acoplador de transparencia", "透明の分割・統合", "透明度拼合"],
+ ),
+ ("Basic Blending", ["Grundlegendes Füllen", "Fusion de base", "Fusión básica", "基本的な描画モード", "基本混合"]),
+ ("Opacity:", ["Deckkraft:", "Opacité :", "Opacidad:", "不透明度:", "不透明度:"]),
+ ("Blending", ["Füllmethode", "Fusion", "Fusión", "描画モード", "混合"]),
+ ("Distance:", ["Abstand:", "Distance :", "Distancia:", "距離:", "距离:"]),
+ ("X Offset:", ["X-Versatz:", "Décalage X :", "Desplazamiento X:", "X オフセット:", "X 位移:"]),
+ ("Y Offset:", ["Y-Versatz:", "Décalage Y :", "Desplazamiento Y:", "Y オフセット:", "Y 位移:"]),
+ ("Spread:", ["Größe ändern:", "Étendue :", "Extensión:", "スプレッド:", "扩展:"]),
+ ("Choke:", ["Unterfüllen:", "Contraction :", "Contracción:", "チョーク:", "收缩:"]),
+ ("Source:", ["Quelle:", "Source :", "Origen:", "ソース:", "源:"]),
+ ("Edge", ["Kante", "Contour", "Borde", "エッジ", "边缘"]),
+ ("Depth:", ["Tiefe:", "Profondeur :", "Profundidad:", "深さ:", "深度:"]),
+ ("Highlight:", ["Lichter:", "Lumière :", "Iluminación:", "ハイライト:", "高光:"]),
+ ("Shadow:", ["Tiefen:", "Ombre :", "Sombra:", "シャドウ:", "阴影:"]),
+ ("Feather Width:", ["Breite der weichen Kante:", "Largeur du contour progressif :", "Anchura de desvanecimiento:", "ぼかしの幅:", "羽化宽度:"]),
+ ("Feather Widths", ["Breiten der weichen Kante", "Largeurs du contour progressif", "Anchuras de desvanecimiento", "ぼかしの幅", "羽化宽度"]),
+ ("Gradient Stops", ["Verlaufsregler", "Arrêts de dégradé", "Paradas de degradado", "グラデーション分岐点", "渐变色标"]),
+ ("Start Opacity:", ["Anfangsdeckkraft:", "Opacité de début :", "Opacidad inicial:", "開始の不透明度:", "起始不透明度:"]),
+ ("End Opacity:", ["Enddeckkraft:", "Opacité de fin :", "Opacidad final:", "終了の不透明度:", "结束不透明度:"]),
+ ("(no effects)", ["(keine Effekte)", "(aucun effet)", "(sin efectos)", "(効果なし)", "(无效果)"]),
+ ("OBJECT", ["OBJEKT", "OBJET", "OBJETO", "オブジェクト", "对象"]),
+ (
+ "Add an object effect to the selected target",
+ [
+ "Dem ausgewählten Ziel einen Objekteffekt hinzufügen",
+ "Ajouter un effet d’objet à la cible sélectionnée",
+ "Añadir un efecto de objeto al destino seleccionado",
+ "選択した対象にオブジェクト効果を追加",
+ "为所选目标添加对象效果",
+ ],
+ ),
+ ("Clear", ["Löschen", "Effacer", "Borrar", "消去", "清除"]),
+ ("Duplicate", ["Duplizieren", "Dupliquer", "Duplicar", "複製", "重复"]),
+ ("Select All", ["Alles auswählen", "Tout sélectionner", "Seleccionar todo", "すべてを選択", "全选"]),
+ ("Deselect All", ["Auswahl aufheben", "Tout désélectionner", "Deseleccionar todo", "すべての選択を解除", "取消全选"]),
+ (
+ "Select All Guides",
+ ["Alle Hilfslinien auswählen", "Sélectionner tous les repères", "Seleccionar todas las guías", "すべてのガイドを選択", "选择所有参考线"],
+ ),
+ ("Ruler Guide", ["Hilfslinie", "Repère de règle", "Guía de regla", "定規ガイド", "标尺参考线"]),
+ ("Find/Change…", ["Suchen/Ersetzen …", "Rechercher/Remplacer…", "Buscar/Cambiar…", "検索と置換…", "查找/更改…"]),
+ ("Check Spelling…", ["Rechtschreibprüfung …", "Vérifier l'orthographe…", "Revisar ortografía…", "スペルチェック…", "拼写检查…"]),
+ ("Preferences…", ["Voreinstellungen …", "Préférences…", "Preferencias…", "環境設定…", "首选项…"]),
+ ("Settings…", ["Einstellungen …", "Réglages…", "Ajustes…", "設定…", "设置…"]),
+ (
+ "Keyboard Shortcuts…",
+ ["Tastaturbefehle …", "Raccourcis clavier…", "Métodos abreviados de teclado…", "キーボードショートカット…", "键盘快捷键…"],
+ ),
+ ("Interface Language", ["Sprache der Oberfläche", "Langue de l'interface", "Idioma de la interfaz", "インターフェイスの言語", "界面语言"]),
+ // Layout.
+ ("Pages", ["Seiten", "Pages", "Páginas", "ページ", "页面"]),
+ ("Margins and Columns…", ["Ränder und Spalten …", "Marges et colonnes…", "Márgenes y columnas…", "マージン・段組…", "边距和分栏…"]),
+ ("Create Guides…", ["Hilfslinien erstellen …", "Créer des repères…", "Crear guías…", "ガイドを作成…", "创建参考线…"]),
+ (
+ "Numbering & Section Options…",
+ [
+ "Nummerierungs- und Abschnittsoptionen …",
+ "Options de numérotation et de section…",
+ "Opciones de numeración y sección…",
+ "ノンブルとセクション設定…",
+ "页码和章节选项…",
+ ],
+ ),
+ // Type.
+ ("Story Direction", ["Textrichtung", "Sens du texte", "Dirección del texto", "組み方向", "文章方向"]),
+ ("Horizontal", ["Horizontal", "Horizontal", "Horizontal", "横書き", "水平"]),
+ ("Vertical", ["Vertikal", "Vertical", "Vertical", "縦書き", "垂直"]),
+ ("Tate-Chu-Yoko", ["Tate-Chu-Yoko", "Tate-Chu-Yoko", "Tate-Chu-Yoko", "縦中横", "纵中横"]),
+ ("Ruby…", ["Ruby …", "Ruby…", "Ruby…", "ルビ…", "旁注…"]),
+ ("Kenten", ["Kenten", "Kenten", "Kenten", "圏点", "圈点"]),
+ ("Warichu", ["Warichu", "Warichu", "Warichu", "割り注", "割注"]),
+ // Style Options: CJK sections.
+ ("Tate-chu-yoko Settings", ["Tate-Chu-Yoko-Einstellungen", "Paramètres Tate-Chu-Yoko", "Ajustes de Tate-Chu-Yoko", "縦中横設定", "纵中横设置"]),
+ ("Kenten Settings", ["Kenten-Einstellungen", "Paramètres Kenten", "Ajustes de Kenten", "圏点設定", "圈点设置"]),
+ (
+ "Japanese Composition Settings",
+ ["Japanischer Satz", "Paramètres de composition japonaise", "Ajustes de composición japonesa", "日本語文字組版", "日文排版设置"],
+ ),
+ ("Grid Settings", ["Rastereinstellungen", "Paramètres de grille", "Ajustes de cuadrícula", "グリッド設定", "网格设置"]),
+ ("Warichu Settings", ["Warichu-Einstellungen", "Paramètres Warichu", "Ajustes de Warichu", "割注設定", "割注设置"]),
+ (
+ "Auto Tate-chu-yoko Settings",
+ [
+ "Automatische Tate-Chu-Yoko-Einstellungen",
+ "Paramètres Tate-Chu-Yoko automatiques",
+ "Ajustes de Tate-Chu-Yoko automático",
+ "自動縦中横設定",
+ "自动纵中横设置",
+ ],
+ ),
+ (
+ "Ruby Placement and Spacing",
+ ["Ruby-Position und -Abstand", "Position et espacement ruby", "Posición y espaciado de ruby", "ルビの位置と間隔", "注音位置和间距"],
+ ),
+ (
+ "Ruby Font and Size",
+ ["Ruby-Schrift und -Größe", "Police et taille ruby", "Fuente y tamaño de ruby", "ルビのフォントとサイズ", "注音字体和大小"],
+ ),
+ (
+ "Adjustment When Ruby Is Longer Than Parent",
+ [
+ "Anpassung bei Ruby länger als Grundtext",
+ "Ajustement si le ruby dépasse le texte parent",
+ "Ajuste cuando el ruby es más largo que la base",
+ "ルビが親文字より長い時の調整",
+ "注音长于基础文字时的调整",
+ ],
+ ),
+ ("Ruby Color", ["Ruby-Farbe", "Couleur ruby", "Color de ruby", "ルビカラー", "注音颜色"]),
+ ("Kenten Color", ["Kenten-Farbe", "Couleur kenten", "Color de kenten", "圏点カラー", "圈点颜色"]),
+ ("Shatai", ["Shatai", "Shatai", "Shatai", "斜体", "斜体"]),
+ ("Tate-chu-yoko Digits:", ["Tate-Chu-Yoko-Ziffern:", "Chiffres Tate-Chu-Yoko:", "Dígitos Tate-Chu-Yoko:", "組数字(桁まで):", "纵中横位数:"]),
+ (
+ "Include Roman Characters",
+ ["Lateinische Zeichen einbeziehen", "Inclure les caractères latins", "Incluir caracteres latinos", "欧文も含める", "包括罗马字符"],
+ ),
+ ("Ruby Type:", ["Ruby-Art:", "Type de ruby:", "Tipo de ruby:", "種類:", "注音类型:"]),
+ ("Per-Character Ruby", ["Einzelzeichen-Ruby", "Ruby par caractère", "Ruby por carácter", "モノルビ", "单字注音"]),
+ ("Group Ruby", ["Gruppen-Ruby", "Ruby de groupe", "Ruby de grupo", "グループルビ", "组注音"]),
+ ("Left/Top", ["Links/oben", "Gauche/haut", "Izquierda/arriba", "肩付き", "左/上"]),
+ ("Centered", ["Zentriert", "Centré", "Centrado", "中付き", "居中"]),
+ ("Right/Bottom", ["Rechts/unten", "Droite/bas", "Derecha/abajo", "右/下揃え", "右/下"]),
+ ("Full Justify", ["Blocksatz", "Justifié", "Justificado", "両端揃え", "两端对齐"]),
+ ("1-2-1 (JIS) Rule", ["1-2-1-Regel (JIS)", "Règle 1-2-1 (JIS)", "Regla 1-2-1 (JIS)", "1-2-1(JIS)ルール", "1-2-1 (JIS) 规则"]),
+ ("Equal Aki", ["Gleicher Abstand", "Espacement égal", "Espaciado igual", "均等アキ", "均等间距"]),
+ (
+ "1 Ruby Character Aki",
+ ["1 Ruby-Zeichen Abstand", "Espace de 1 caractère ruby", "Espacio de 1 carácter ruby", "1ルビ文字アキ", "1注音字符间距"],
+ ),
+ ("Above/Right", ["Oben/rechts", "Au-dessus/à droite", "Arriba/derecha", "上/右", "上/右"]),
+ ("Below/Left", ["Unten/links", "En dessous/à gauche", "Abajo/izquierda", "下/左", "下/左"]),
+ (
+ "Offset from Parent",
+ [
+ "Versatz zum Grundtext",
+ "Décalage par rapport au texte parent",
+ "Desplazamiento respecto a la base",
+ "親文字からのオフセット",
+ "与基础文字的偏移",
+ ],
+ ),
+ ("Across the Line:", ["Quer zur Zeile:", "Perpendiculaire à la ligne:", "Perpendicular a la línea:", "横組み上下/縦組み左右:", "垂直于行:"]),
+ ("Along the Line:", ["Entlang der Zeile:", "Le long de la ligne:", "A lo largo de la línea:", "横組み左右/縦組み上下:", "沿行方向:"]),
+ ("Parent's Font", ["Schrift des Grundtexts", "Police du texte parent", "Fuente de la base", "親文字と同じ", "基础文字的字体"]),
+ (
+ "Use OpenType Pro Ruby Glyphs",
+ [
+ "OpenType-Pro-Ruby-Glyphen verwenden",
+ "Utiliser les glyphes ruby OpenType Pro",
+ "Usar glifos ruby de OpenType Pro",
+ "OpenType Pro のルビ字形を使用",
+ "使用 OpenType Pro 注音字形",
+ ],
+ ),
+ ("Fit to Width", ["An Breite anpassen", "Ajuster à la largeur", "Ajustar al ancho", "幅に合わせる", "适合宽度"]),
+ ("Ruby Overhang:", ["Ruby-Überhang:", "Débordement ruby:", "Desbordamiento de ruby:", "文字かけ処理:", "注音悬挂:"]),
+ ("1 Ruby Character", ["1 Ruby-Zeichen", "1 caractère ruby", "1 carácter ruby", "ルビ1文字分", "1个注音字符"]),
+ ("1/2 Ruby Character", ["1/2 Ruby-Zeichen", "1/2 caractère ruby", "1/2 carácter ruby", "ルビ半文字分", "1/2个注音字符"]),
+ ("1 Parent Character", ["1 Grundzeichen", "1 caractère parent", "1 carácter base", "親1文字分", "1个基础字符"]),
+ ("1/2 Parent Character", ["1/2 Grundzeichen", "1/2 caractère parent", "1/2 carácter base", "親半文字分", "1/2个基础字符"]),
+ ("Unlimited", ["Unbegrenzt", "Illimité", "Ilimitado", "無制限", "无限制"]),
+ (
+ "Parent Character Spacing:",
+ ["Abstand im Grundtext:", "Espacement du texte parent:", "Espaciado de la base:", "親文字間の調整:", "基础文字间距调整:"],
+ ),
+ ("No Adjustment", ["Keine Anpassung", "Aucun ajustement", "Sin ajuste", "調整しない", "不调整"]),
+ ("Both Sides", ["Beide Seiten", "Des deux côtés", "Ambos lados", "両サイド", "两侧"]),
+ ("1-2-1 Aki", ["1-2-1-Abstand", "Espacement 1-2-1", "Espaciado 1-2-1", "1-2-1アキ", "1-2-1 间距"]),
+ (
+ "Shrink Ruby Width Automatically",
+ [
+ "Ruby-Breite automatisch verringern",
+ "Réduire automatiquement la largeur ruby",
+ "Reducir automáticamente el ancho de ruby",
+ "ルビの文字幅を自動的に詰める",
+ "自动压缩注音宽度",
+ ],
+ ),
+ ("Minimum Scale:", ["Minimale Skalierung:", "Échelle minimale:", "Escala mínima:", "最小比率:", "最小比例:"]),
+ (
+ "Auto Align at Line Start/End",
+ [
+ "Am Zeilenanfang/-ende automatisch ausrichten",
+ "Alignement auto en début/fin de ligne",
+ "Alinear automáticamente al inicio/fin de línea",
+ "自動行頭/行末揃え",
+ "行首/行尾自动对齐",
+ ],
+ ),
+ ("Text Color", ["Textfarbe", "Couleur du texte", "Color del texto", "[自動]", "文字颜色"]),
+ (
+ "Distance from Parent:",
+ ["Abstand zum Grundtext:", "Distance au texte parent:", "Distancia a la base:", "親文字からの間隔:", "与基础文字的距离:"],
+ ),
+ ("Fisheye", ["Fischauge", "Œil de poisson", "Ojo de pez", "蛇の目", "蛇目"]),
+ ("Magnification:", ["Verkleinerung:", "Réduction:", "Reducción:", "縮小率:", "缩小率:"]),
+ ("Adjust Rotation", ["Drehung anpassen", "Ajuster la rotation", "Ajustar rotación", "ライン揃え", "调整旋转"]),
+ ("Adjust Tsume", ["Tsume anpassen", "Ajuster le tsume", "Ajustar tsume", "ツメの調整", "调整字距压缩"]),
+ (
+ "Rotate Roman Characters in Vertical Text",
+ [
+ "Lateinische Zeichen in vertikalem Text drehen",
+ "Faire pivoter les caractères latins en texte vertical",
+ "Girar caracteres latinos en texto vertical",
+ "縦組み中の欧文回転",
+ "直排中旋转罗马字符",
+ ],
+ ),
+ (
+ "Roman Word Break",
+ ["Lateinische Wörter beliebig trennen", "Coupure libre des mots latins", "Corte libre de palabras latinas", "欧文泣き別れ", "西文单词断开"],
+ ),
+ ("ICF Top", ["ICF oben", "Haut ICF", "Parte superior ICF", "平均字面の上", "平均字面上"]),
+ ("ICF Bottom", ["ICF unten", "Bas ICF", "Parte inferior ICF", "平均字面の下", "平均字面下"]),
+ ("Gyoudori:", ["Gyoudori:", "Gyoudori :", "Gyoudori:", "行取り:", "行取:"]),
+ (
+ "Use Paragraph Gyoudori",
+ ["Absatz-Gyoudori verwenden", "Utiliser le gyoudori de paragraphe", "Usar gyoudori de párrafo", "段落行取りを使用", "使用段落行取"],
+ ),
+ ("Up/Down Position:", ["Position oben/unten:", "Position haut/bas:", "Posición arriba/abajo:", "上下位置:", "上下位置:"]),
+ ("Left/Right Position:", ["Position links/rechts:", "Position gauche/droite:", "Posición izquierda/derecha:", "左右位置:", "左右位置:"]),
+ ("Kenten Type:", ["Kenten-Art:", "Type de kenten:", "Tipo de kenten:", "圏点種類:", "圈点类型:"]),
+ ("Sesame Dot", ["Sesampunkt", "Point sésame", "Punto de sésamo", "ゴマ", "芝麻点"]),
+ ("White Sesame Dot", ["Weißer Sesampunkt", "Point sésame blanc", "Punto de sésamo blanco", "白ゴマ", "空心芝麻点"]),
+ ("Bullseye", ["Zielscheibe", "Cible", "Diana", "蛇の目", "靶心"]),
+ ("Black Circle", ["Schwarzer Kreis", "Cercle noir", "Círculo negro", "黒丸", "实心圆"]),
+ ("Small Black Circle", ["Kleiner schwarzer Kreis", "Petit cercle noir", "Círculo negro pequeño", "小さい黒丸", "小实心圆"]),
+ ("Double Circle", ["Doppelkreis", "Double cercle", "Círculo doble", "二重丸", "双圆"]),
+ ("Black Triangle", ["Schwarzes Dreieck", "Triangle noir", "Triángulo negro", "黒三角", "实心三角"]),
+ ("White Triangle", ["Weißes Dreieck", "Triangle blanc", "Triángulo blanco", "白三角", "空心三角"]),
+ ("White Circle", ["Weißer Kreis", "Cercle blanc", "Círculo blanco", "白丸", "空心圆"]),
+ ("Small White Circle", ["Kleiner weißer Kreis", "Petit cercle blanc", "Círculo blanco pequeño", "小さい白丸", "小空心圆"]),
+ ("Character:", ["Zeichen:", "Caractère:", "Carácter:", "文字:", "字符:"]),
+ ("Kinsoku Set:", ["Kinsoku-Satz:", "Jeu kinsoku:", "Conjunto kinsoku:", "禁則処理セット:", "避头尾集:"]),
+ ("Default Rules", ["Standardregeln", "Règles par défaut", "Reglas predeterminadas", "既定の規則", "默认规则"]),
+ ("Hard Kinsoku", ["Hartes Kinsoku", "Kinsoku strict", "Kinsoku estricto", "強い禁則", "严格避头尾"]),
+ ("Soft Kinsoku", ["Weiches Kinsoku", "Kinsoku souple", "Kinsoku flexible", "弱い禁則", "宽松避头尾"]),
+ (
+ "Simplified Chinese Kinsoku",
+ ["Kinsoku für vereinfachtes Chinesisch", "Kinsoku chinois simplifié", "Kinsoku de chino simplificado", "簡体中国語禁則", "简体中文避头尾"],
+ ),
+ (
+ "Traditional Chinese Kinsoku",
+ ["Kinsoku für traditionelles Chinesisch", "Kinsoku chinois traditionnel", "Kinsoku de chino tradicional", "繁体中国語禁則", "繁体中文避头尾"],
+ ),
+ ("Korean Kinsoku", ["Koreanisches Kinsoku", "Kinsoku coréen", "Kinsoku coreano", "韓国語禁則", "韩文避头尾"]),
+ ("Kinsoku Type:", ["Kinsoku-Methode:", "Type de kinsoku:", "Tipo de kinsoku:", "禁則調整方式:", "避头尾调整方式:"]),
+ ("Push In First", ["Zuerst einziehen", "Rentrer d'abord", "Primero hacia dentro", "追い込み優先", "先推入"]),
+ ("Push Out First", ["Zuerst hinausschieben", "Repousser d'abord", "Primero hacia fuera", "追い出し優先", "先推出"]),
+ ("Push Out Only", ["Nur hinausschieben", "Repousser uniquement", "Solo hacia fuera", "追い出しのみ", "仅推出"]),
+ (
+ "Prioritize Adjustment Amount",
+ ["Anpassungsbetrag bevorzugen", "Priorité à la valeur d'ajustement", "Priorizar la cantidad de ajuste", "調整量を優先", "优先调整量"],
+ ),
+ ("Hanging Type:", ["Hängende Interpunktion:", "Ponctuation suspendue:", "Puntuación colgante:", "ぶら下がり方法:", "悬挂方式:"]),
+ ("Force", ["Erzwingen", "Forcer", "Forzar", "強制", "强制"]),
+ ("Bunri-Kinshi", ["Bunri-Kinshi", "Bunri-Kinshi", "Bunri-Kinshi", "分離禁止処理", "分离禁止"]),
+ ("Mojikumi Set:", ["Mojikumi-Satz:", "Jeu mojikumi:", "Conjunto mojikumi:", "文字組み:", "标点挤压集:"]),
+ ("Leading Model:", ["Zeilenabstandsmodell:", "Modèle d'interlignage:", "Modelo de interlineado:", "行送りの基準位置:", "行距基准位置:"]),
+ (
+ "Em Box Top/Right",
+ ["Geviert oben/rechts", "Haut/droite du cadratin", "Parte superior/derecha del cuadratín", "仮想ボディの上/右", "全角字框上/右"],
+ ),
+ ("Em Box Center", ["Geviert Mitte", "Centre du cadratin", "Centro del cuadratín", "仮想ボディの中央", "全角字框居中"]),
+ (
+ "Em Box Bottom/Left",
+ ["Geviert unten/links", "Bas/gauche du cadratin", "Parte inferior/izquierda del cuadratín", "仮想ボディの下/左", "全角字框下/左"],
+ ),
+ (
+ "Em Box Center (Down)",
+ ["Geviert Mitte (unten)", "Centre du cadratin (bas)", "Centro del cuadratín (abajo)", "仮想ボディの中央(下)", "全角字框居中(下)"],
+ ),
+ ("Roman Baseline", ["Lateinische Grundlinie", "Ligne de base romaine", "Línea de base romana", "欧文ベースライン", "罗马字基线"]),
+ ("Rensuuji", ["Rensuuji", "Rensuuji", "Rensuuji", "連数字処理", "连数字处理"]),
+ (
+ "Absorb Ideographic Space at Line End",
+ [
+ "Ideografisches Leerzeichen am Zeilenende absorbieren",
+ "Absorber l'espace idéographique en fin de ligne",
+ "Absorber el espacio ideográfico al final de línea",
+ "全角スペースを行末吸収",
+ "行尾吸收全角空格",
+ ],
+ ),
+ ("Grid Alignment:", ["Am Raster ausrichten:", "Alignement sur la grille:", "Alineación con cuadrícula:", "グリッド揃え:", "网格对齐:"]),
+ (
+ "Align Only First Line to Grid",
+ [
+ "Nur erste Zeile am Raster ausrichten",
+ "Aligner uniquement la première ligne sur la grille",
+ "Alinear solo la primera línea con la cuadrícula",
+ "1 行目のみグリッドに揃える",
+ "仅首行对齐网格",
+ ],
+ ),
+ ("Warichu Size:", ["Warichu-Größe:", "Taille warichu:", "Tamaño de warichu:", "割注サイズ:", "割注大小:"]),
+ ("Line Spacing:", ["Zeilenabstand:", "Interligne:", "Interlineado:", "行の間隔:", "行间距:"]),
+ ("Line Break Options", ["Umbruchoptionen", "Options de saut de ligne", "Opciones de salto de línea", "改行オプション", "换行选项"]),
+ (
+ "Characters Before Break:",
+ ["Zeichen vor dem Umbruch:", "Caractères avant le saut:", "Caracteres antes del salto:", "1 行目の最小文字数:", "换行前最少字符数:"],
+ ),
+ (
+ "Characters After Break:",
+ ["Zeichen nach dem Umbruch:", "Caractères après le saut:", "Caracteres después del salto:", "最終行の最小文字数:", "换行后最少字符数:"],
+ ),
+ ("Font", ["Schriftart", "Police", "Fuente", "フォント", "字体"]),
+ ("Size", ["Schriftgrad", "Corps", "Tamaño", "サイズ", "大小"]),
+ ("Character", ["Zeichen", "Caractère", "Carácter", "文字", "字符"]),
+ ("Paragraph", ["Absatz", "Paragraphe", "Párrafo", "段落", "段落"]),
+ ("Tabs", ["Tabulatoren", "Tabulations", "Tabulaciones", "タブ", "制表符"]),
+ (
+ "Left-aligned tab",
+ ["Linksbündiger Tabulator", "Tabulation alignée à gauche", "Tabulación alineada a la izquierda", "左揃えタブ", "左对齐制表符"],
+ ),
+ ("Centered tab", ["Zentrierter Tabulator", "Tabulation centrée", "Tabulación centrada", "中央揃えタブ", "居中对齐制表符"]),
+ (
+ "Right-aligned tab",
+ ["Rechtsbündiger Tabulator", "Tabulation alignée à droite", "Tabulación alineada a la derecha", "右揃えタブ", "右对齐制表符"],
+ ),
+ (
+ "Tab aligned on a character",
+ [
+ "Am Zeichen ausgerichteter Tabulator",
+ "Tabulation alignée sur un caractère",
+ "Tabulación alineada en un carácter",
+ "文字揃えタブ",
+ "按字符对齐制表符",
+ ],
+ ),
+ ("X:", ["X:", "X :", "X:", "X:", "X:"]),
+ ("Leader:", ["Füllzeichen:", "Points de suite :", "Carácter de relleno:", "リーダー:", "前导符:"]),
+ ("Align On:", ["Ausrichten an:", "Aligner sur :", "Alinear en:", "揃える文字:", "对齐位置:"]),
+ (
+ "Position panel above text frame",
+ [
+ "Bedienfeld über dem Textrahmen platzieren",
+ "Placer le panneau au-dessus du bloc de texte",
+ "Colocar el panel sobre el marco de texto",
+ "パネルをテキストフレームの上に配置",
+ "将面板置于文本框上方",
+ ],
+ ),
+ ("Clear All", ["Alle löschen", "Tout effacer", "Borrar todo", "すべてを消去", "全部清除"]),
+ ("Delete Tab", ["Tabulator löschen", "Supprimer la tabulation", "Eliminar tabulación", "タブを削除", "删除制表符"]),
+ ("Repeat Tab", ["Tabulator wiederholen", "Répéter la tabulation", "Repetir tabulación", "タブを繰り返し", "重复制表符"]),
+ ("Reset Indents", ["Einzüge zurücksetzen", "Réinitialiser les retraits", "Restablecer sangrías", "インデントをリセット", "重置缩进"]),
+ ("Glyphs", ["Glyphen", "Glyphes", "Glifos", "字形", "字形"]),
+ ("Story", ["Textabschnitt", "Article", "Artículo", "ストーリー", "文章"]),
+ ("Character Styles", ["Zeichenformate", "Styles de caractère", "Estilos de carácter", "文字スタイル", "字符样式"]),
+ ("Paragraph Styles", ["Absatzformate", "Styles de paragraphe", "Estilos de párrafo", "段落スタイル", "段落样式"]),
+ ("Create Outlines", ["In Pfade umwandeln", "Vectoriser", "Crear contornos", "アウトラインを作成", "创建轮廓"]),
+ (
+ "Show Hidden Characters",
+ ["Verborgene Zeichen einblenden", "Afficher les caractères masqués", "Mostrar caracteres ocultos", "制御文字を表示", "显示隐藏字符"],
+ ),
+ // Object.
+ ("Transform", ["Transformieren", "Transformation", "Transformar", "変形", "变换"]),
+ ("Arrange", ["Anordnen", "Disposition", "Organizar", "重ね順", "排列"]),
+ ("Group", ["Gruppieren", "Associer", "Agrupar", "グループ", "编组"]),
+ ("Ungroup", ["Gruppierung aufheben", "Dissocier", "Desagrupar", "グループ解除", "取消编组"]),
+ ("Lock", ["Sperren", "Verrouiller", "Bloquear", "ロック", "锁定"]),
+ ("Hide", ["Ausblenden", "Masquer", "Ocultar", "隠す", "隐藏"]),
+ ("Effects", ["Effekte", "Effets", "Efectos", "効果", "效果"]),
+ ("Fitting", ["Anpassen", "Ajustement", "Encaje", "オブジェクトサイズの調整", "适合"]),
+ (
+ "Text Frame Options…",
+ ["Textrahmenoptionen …", "Options de bloc de texte…", "Opciones de marco de texto…", "テキストフレーム設定…", "文本框架选项…"],
+ ),
+ // Table.
+ ("Insert Table…", ["Tabelle einfügen …", "Insérer un tableau…", "Insertar tabla…", "表を挿入…", "插入表…"]),
+ ("Merge Cells", ["Zellen verbinden", "Fusionner les cellules", "Combinar celdas", "セルを結合", "合并单元格"]),
+ ("Unmerge Cells", ["Zellverbindung aufheben", "Annuler la fusion des cellules", "Separar celdas", "セルの結合解除", "取消合并单元格"]),
+ ("Insert", ["Einfügen", "Insérer", "Insertar", "挿入", "插入"]),
+ ("Delete", ["Löschen", "Supprimer", "Eliminar", "削除", "删除"]),
+ // View.
+ ("Zoom In", ["Einzoomen", "Zoom avant", "Acercar", "ズームイン", "放大"]),
+ ("Zoom Out", ["Auszoomen", "Zoom arrière", "Alejar", "ズームアウト", "缩小"]),
+ (
+ "Fit Page in Window",
+ ["Seite in Fenster einpassen", "Ajuster la page à la fenêtre", "Encajar página en ventana", "ページ全体", "使页面适合窗口"],
+ ),
+ (
+ "Fit Spread in Window",
+ ["Druckbogen in Fenster einpassen", "Ajuster la planche à la fenêtre", "Encajar pliego en ventana", "スプレッド全体", "使跨页适合窗口"],
+ ),
+ ("Actual Size", ["Originalgröße", "Taille réelle", "Tamaño real", "100%", "实际大小"]),
+ ("Screen Mode", ["Bildschirmmodus", "Mode de l'écran", "Modo de pantalla", "スクリーンモード", "屏幕模式"]),
+ ("Grids & Guides", ["Raster und Hilfslinien", "Grilles et repères", "Cuadrículas y guías", "グリッドとガイド", "网格和参考线"]),
+ ("Show Rulers", ["Lineale einblenden", "Afficher les règles", "Mostrar reglas", "定規を表示", "显示标尺"]),
+ ("Snap to Guides", ["An Hilfslinien ausrichten", "Magnétisme des repères", "Ajustar a las guías", "ガイドにスナップ", "靠齐参考线"]),
+ (
+ "Snap to Document Grid",
+ [
+ "Am Dokumentraster ausrichten",
+ "Magnétisme de la grille du document",
+ "Ajustar a la cuadrícula del documento",
+ "ドキュメントグリッドにスナップ",
+ "靠齐文档网格",
+ ],
+ ),
+ ("Smart Guides", ["Smarte Hilfslinien", "Repères commentés", "Guías inteligentes", "スマートガイド", "智能参考线"]),
+ (
+ "Align to Object Edges",
+ [
+ "An Objektkanten ausrichten",
+ "Aligner sur les bords des objets",
+ "Alinear a los bordes del objeto",
+ "オブジェクトの端に揃える",
+ "对齐对象边缘",
+ ],
+ ),
+ (
+ "Align to Object Centers",
+ [
+ "An Objektmitten ausrichten",
+ "Aligner sur les centres des objets",
+ "Alinear a los centros del objeto",
+ "オブジェクトの中心に揃える",
+ "对齐对象中心",
+ ],
+ ),
+ ("Smart Dimensions", ["Smarte Maße", "Dimensions commentées", "Dimensiones inteligentes", "スマートサイズ", "智能尺寸"]),
+ ("Smart Spacing", ["Smarte Abstände", "Espacement commenté", "Espaciado inteligente", "スマート間隔", "智能间距"]),
+ ("Snap to Zone", ["Fangzone", "Zone de magnétisme", "Zona de ajuste", "スナップゾーン", "靠齐区域"]),
+ // Window and panels.
+ ("Properties", ["Eigenschaften", "Propriétés", "Propiedades", "プロパティ", "属性"]),
+ ("Layers", ["Ebenen", "Calques", "Capas", "レイヤー", "图层"]),
+ ("Links", ["Verknüpfungen", "Liens", "Vínculos", "リンク", "链接"]),
+ ("Swatches", ["Farbfelder", "Nuancier", "Muestras", "スウォッチ", "色板"]),
+ ("Color", ["Farbe", "Couleur", "Color", "カラー", "颜色"]),
+ ("Stroke", ["Kontur", "Contour", "Trazo", "線", "描边"]),
+ ("Gradient", ["Verlauf", "Dégradé", "Degradado", "グラデーション", "渐变"]),
+ ("Align", ["Ausrichten", "Alignement", "Alinear", "整列", "对齐"]),
+ ("Pathfinder", ["Pathfinder", "Pathfinder", "Buscatrazos", "パスファインダー", "路径查找器"]),
+ ("Info", ["Info", "Informations", "Información", "情報", "信息"]),
+ ("Library", ["Bibliothek", "Bibliothèque", "Biblioteca", "ライブラリ", "库"]),
+ ("Book", ["Buch", "Livre", "Libro", "ブック", "书籍"]),
+ ("Index", ["Index", "Index", "Índice", "索引", "索引"]),
+ ("Hyperlinks", ["Hyperlinks", "Hyperliens", "Hipervínculos", "ハイパーリンク", "超链接"]),
+ ("Bookmarks", ["Lesezeichen", "Signets", "Marcadores", "ブックマーク", "书签"]),
+ ("Articles", ["Artikel", "Articles", "Artículos", "アーティクル", "文章"]),
+ ("Tags", ["Tags", "Balises", "Etiquetas", "タグ", "标签"]),
+ ("Media", ["Medien", "Multimédia", "Medios", "メディア", "媒体"]),
+ ("Object States", ["Objektstatus", "États d'objet", "Estados de objeto", "オブジェクトステート", "对象状态"]),
+ ("Buttons and Forms", ["Schaltflächen und Formulare", "Boutons et formulaires", "Botones y formularios", "ボタンとフォーム", "按钮和表单"]),
+ ("Liquid Layout", ["Flüssiges Layout", "Mise en page liquide", "Maquetación líquida", "リキッドレイアウト", "自适应版面"]),
+ ("Workspace", ["Arbeitsbereich", "Espace de travail", "Espacio de trabajo", "ワークスペース", "工作区"]),
+ ("Editorial", ["Redaktion", "Éditorial", "Editorial", "エディトリアル", "编辑"]),
+ ("Object & Layout", ["Objekt und Layout", "Objet et mise en page", "Objeto y diseño", "オブジェクト&レイアウト", "对象和版面"]),
+ ("Styles", ["Formate", "Styles", "Estilos", "スタイル", "样式"]),
+ ("Essentials Classic", ["Essentials Classic", "Les indispensables (classique)", "Essentials Classic", "Essentials Classic", "基本功能(经典)"]),
+ ("Split Window", ["Fenster teilen", "Fractionner la fenêtre", "Dividir ventana", "ウィンドウを分割", "拆分窗口"]),
+ ("New Window", ["Neues Fenster", "Nouvelle fenêtre", "Nueva ventana", "新規ウィンドウ", "新建窗口"]),
+ (
+ "Show All Menu Items",
+ [
+ "Alle Menüelemente anzeigen",
+ "Afficher toutes les commandes",
+ "Mostrar todos los elementos de menú",
+ "すべてのメニュー項目を表示",
+ "显示所有菜单项",
+ ],
+ ),
+ ("Accept All", ["Accept All", "Tout accepter", "Accept All", "Accept All", "全部接受"]),
+ ("Add", ["Add", "Ajouter", "Add", "Add", "添加"]),
+ ("Add Document…", ["Add Document…", "Ajouter un document…", "Add Document…", "Add Document…", "添加文档…"]),
+ (
+ "Add to Previous Spread",
+ ["Add to Previous Spread", "Ajouter à la planche précédente", "Add to Previous Spread", "Add to Previous Spread", "添加到上一个跨页"],
+ ),
+ ("Align From:", ["Align From:", "Aligner depuis :", "Align From:", "Align From:", "对齐自:"]),
+ (
+ "Align to baseline grid",
+ ["Align to baseline grid", "Aligner sur la grille de ligne de base", "Align to baseline grid", "Align to baseline grid", "对齐基线网格"],
+ ),
+ ("Alignment:", ["Alignment:", "Alignement :", "Alignment:", "Alignment:", "对齐:"]),
+ (
+ "All Spots to Process",
+ ["All Spots to Process", "Tous les tons directs en quadrichromie", "All Spots to Process", "All Spots to Process", "所有专色转四色"],
+ ),
+ (
+ "Allow Spread to Shuffle",
+ [
+ "Allow Spread to Shuffle",
+ "Autoriser la réorganisation des pages de la planche",
+ "Allow Spread to Shuffle",
+ "Allow Spread to Shuffle",
+ "允许跨页无序",
+ ],
+ ),
+ (
+ "Alternating Row Fills",
+ ["Alternating Row Fills", "Fonds de ligne en alternance", "Alternating Row Fills", "Alternating Row Fills", "交替行填色"],
+ ),
+ ("Appearance", ["Appearance", "Apparence", "Appearance", "Appearance", "外观"]),
+ ("Apply Gradient", ["Apply Gradient", "Appliquer le dégradé", "Apply Gradient", "Apply Gradient", "应用渐变"]),
+ ("Apply Parent", ["Apply Parent", "Appliquer le gabarit", "Apply Parent", "Apply Parent", "应用主页"]),
+ ("Apply Style:", ["Apply Style:", "Appliquer le style :", "Apply Style:", "Apply Style:", "应用样式:"]),
+ (
+ "Apply to All Spreads",
+ ["Apply to All Spreads", "Appliquer à toutes les planches", "Apply to All Spreads", "Apply to All Spreads", "应用到所有跨页"],
+ ),
+ ("Apply to Stroke", ["Apply to Stroke", "Appliquer au contour", "Apply to Stroke", "Apply to Stroke", "应用到描边"]),
+ ("Art", ["Art", "Illustration", "Art", "Art", "画板"]),
+ ("Based On:", ["Based On:", "Basé sur :", "Based On:", "Based On:", "基于:"]),
+ ("Bleed", ["Bleed", "Fond perdu", "Bleed", "Bleed", "出血"]),
+ ("Bleed Marks", ["Beschnittmarken", "Repères de fond perdu", "Marcas de sangrado", "塗り足しマーク", "出血标记"]),
+ ("Body Rows", ["Body Rows", "Lignes de corps", "Body Rows", "Body Rows", "表体行"]),
+ ("Bottom", ["Bottom", "Bas", "Bottom", "Bottom", "底部"]),
+ (
+ "Break Link to Style",
+ ["Break Link to Style", "Rompre le lien avec le style", "Break Link to Style", "Break Link to Style", "断开与样式的链接"],
+ ),
+ ("Redefine Style", ["Format neu definieren", "Redéfinir le style", "Redefinir estilo", "スタイルを再定義", "重新定义样式"]),
+ ("Bullets and Numbering", ["Bullets and Numbering", "Puces et numérotation", "Bullets and Numbering", "Bullets and Numbering", "项目符号和编号"]),
+ ("Business Card", ["Business Card", "Carte de visite", "Business Card", "Business Card", "名片"]),
+ ("CMYK", ["CMYK", "CMJN", "CMYK", "CMYK", "CMYK"]),
+ ("Cancel", ["Cancel", "Annuler", "Cancel", "Cancel", "取消"]),
+ (
+ "Can't Open the File",
+ [
+ "Datei kann nicht geöffnet werden",
+ "Impossible d'ouvrir le fichier",
+ "No se puede abrir el archivo",
+ "ファイルを開けません",
+ "无法打开文件",
+ ],
+ ),
+ (
+ "Can't Place the File",
+ [
+ "Datei kann nicht platziert werden",
+ "Impossible d'importer le fichier",
+ "No se puede colocar el archivo",
+ "ファイルを配置できません",
+ "无法置入文件",
+ ],
+ ),
+ ("Center Content", ["Center Content", "Centrer le contenu", "Center Content", "Center Content", "内容居中"]),
+ ("Change All", ["Change All", "Tout remplacer", "Change All", "Change All", "全部更改"]),
+ ("Change to:", ["Change to:", "Remplacer par :", "Change to:", "Change to:", "更改为:"]),
+ ("Character Style:", ["Character Style:", "Style de caractère :", "Character Style:", "Character Style:", "字符样式:"]),
+ ("Checked by default", ["Checked by default", "Cochée par défaut", "Checked by default", "Checked by default", "默认选中"]),
+ ("Choices", ["Choices", "Choix", "Choices", "Choices", "选项"]),
+ ("Choose Image…", ["Choose Image…", "Choisir une image…", "Choose Image…", "Choose Image…", "选择图像…"]),
+ ("Class:", ["Class:", "Classe :", "Class:", "Class:", "类别:"]),
+ ("Color Picker", ["Color Picker", "Sélecteur de couleurs", "Color Picker", "Color Picker", "拾色器"]),
+ ("Color Settings", ["Color Settings", "Réglages des couleurs", "Color Settings", "Color Settings", "颜色设置"]),
+ ("Color:", ["Color:", "Couleur :", "Color:", "Color:", "颜色:"]),
+ ("Columns", ["Columns", "Colonnes", "Columns", "Columns", "栏"]),
+ ("Composer:", ["Composer:", "Compositeur :", "Composer:", "Composer:", "排版器:"]),
+ ("Copies:", ["Copies:", "Copies :", "Copies:", "Copies:", "份数:"]),
+ ("Count", ["Count", "Compter", "Count", "Count", "数量"]),
+ ("Create", ["Create", "Créer", "Create", "Create", "创建"]),
+ ("Create Table", ["Create Table", "Créer un tableau", "Create Table", "Create Table", "创建表"]),
+ ("Create Table…", ["Create Table…", "Créer un tableau…", "Create Table…", "Create Table…", "创建表…"]),
+ ("Crop", ["Crop", "Recadrage", "Crop", "Crop", "裁剪"]),
+ ("Crop Marks", ["Schnittmarken", "Traits de coupe", "Marcas de recorte", "トンボ", "裁切标记"]),
+ ("Crop to:", ["Crop to:", "Recadrer selon :", "Crop to:", "Crop to:", "裁剪到:"]),
+ ("Cursor Key:", ["Cursor Key:", "Touche fléchée :", "Cursor Key:", "Cursor Key:", "光标键:"]),
+ ("Default", ["Default", "Par défaut", "Default", "Default", "默认"]),
+ ("Default View:", ["Default View:", "Affichage par défaut :", "Default View:", "Default View:", "默认视图:"]),
+ ("Delete Column", ["Delete Column", "Supprimer la colonne", "Delete Column", "Delete Column", "删除列"]),
+ ("Delete Condition", ["Delete Condition", "Supprimer la condition", "Delete Condition", "Delete Condition", "删除条件"]),
+ ("Delete Layer", ["Delete Layer", "Supprimer le calque", "Delete Layer", "Delete Layer", "删除图层"]),
+ ("Delete Page", ["Delete Page", "Supprimer la page", "Delete Page", "Delete Page", "删除页面"]),
+ ("Delete Row", ["Delete Row", "Supprimer la ligne", "Delete Row", "Delete Row", "删除行"]),
+ ("Delete Swatch", ["Delete Swatch", "Supprimer la nuance", "Delete Swatch", "Delete Swatch", "删除色板"]),
+ (
+ "Delete Unused Layers",
+ ["Delete Unused Layers", "Supprimer les calques inutilisés", "Delete Unused Layers", "Delete Unused Layers", "删除未使用的图层"],
+ ),
+ ("Desired", ["Desired", "Optimal", "Desired", "Desired", "最佳"]),
+ ("Dialog", ["Dialog", "Boîte de dialogue", "Dialog", "Dialog", "对话框"]),
+ ("Document", ["Document", "Document", "Document", "Document", "文档"]),
+ ("Document Setup", ["Document Setup", "Format de document", "Document Setup", "Document Setup", "文档设置"]),
+ ("Drop Shadow", ["Drop Shadow", "Ombre portée", "Drop Shadow", "Drop Shadow", "投影"]),
+ ("Duplicate Spread", ["Duplicate Spread", "Dupliquer la planche", "Duplicate Spread", "Duplicate Spread", "复制跨页"]),
+ (
+ "Duplicate Spread at End of Document",
+ [
+ "Druckbogen am Dokumentende duplizieren",
+ "Dupliquer la planche à la fin du document",
+ "Duplicar pliego al final del documento",
+ "ドキュメントの最後にスプレッドを複製",
+ "在文档末尾复制跨页",
+ ],
+ ),
+ ("Delete Spread", ["Druckbogen löschen", "Supprimer la planche", "Eliminar pliego", "スプレッドを削除", "删除跨页"]),
+ ("Parent Pages", ["Übergeordnete Seiten", "Gabarits", "Páginas principales", "親ページ", "父页面"]),
+ (
+ "Apply Parent to Pages",
+ [
+ "Übergeordnete Seite auf Seiten anwenden",
+ "Appliquer le gabarit aux pages",
+ "Aplicar principal a páginas",
+ "親ページを適用",
+ "将父页面应用于页面",
+ ],
+ ),
+ ("Email", ["Email", "E-mail", "Email", "Email", "电子邮件"]),
+ ("Embed", ["Embed", "Incorporer", "Embed", "Embed", "嵌入"]),
+ ("Export PDF", ["PDF exportieren", "Exporter en PDF", "Exportar PDF", "PDF を書き出し", "导出PDF"]),
+ ("Export XML…", ["Export XML…", "Exporter en XML…", "Export XML…", "Export XML…", "导出XML…"]),
+ ("Fast", ["Fast", "Rapide", "Fast", "Fast", "快速"]),
+ (
+ "Fill Frame Proportionally",
+ [
+ "Fill Frame Proportionally",
+ "Remplir le bloc proportionnellement",
+ "Fill Frame Proportionally",
+ "Fill Frame Proportionally",
+ "按比例填充框架",
+ ],
+ ),
+ ("Find All", ["Find All", "Tout rechercher", "Find All", "Find All", "查找全部"]),
+ ("Find Next", ["Find Next", "Rechercher suivant", "Find Next", "Find Next", "查找下一个"]),
+ ("Find what:", ["Find what:", "Rechercher :", "Find what:", "Find what:", "查找内容:"]),
+ ("Find/Change", ["Find/Change", "Rechercher/Remplacer", "Find/Change", "Find/Change", "查找/更改"]),
+ ("Find/Replace Font", ["Find/Replace Font", "Rechercher/Remplacer une police", "Find/Replace Font", "Find/Replace Font", "查找/替换字体"]),
+ (
+ "Fit Content Proportionally",
+ [
+ "Fit Content Proportionally",
+ "Ajuster le contenu proportionnellement",
+ "Fit Content Proportionally",
+ "Fit Content Proportionally",
+ "按比例适合内容",
+ ],
+ ),
+ ("Fit Content to Frame", ["Fit Content to Frame", "Ajuster le contenu au bloc", "Fit Content to Frame", "Fit Content to Frame", "内容适合框架"]),
+ ("Fitting:", ["Fitting:", "Ajustement :", "Fitting:", "Fitting:", "适合:"]),
+ (
+ "Flattener preset",
+ ["Voreinstellung für Transparenzreduzierung", "Préréglage d'aplatissement", "Preajuste de acoplado", "透明分割プリセット", "拼合器预设"],
+ ),
+ ("Font Family:", ["Font Family:", "Famille de polices :", "Font Family:", "Font Family:", "字体系列:"]),
+ ("Font Size:", ["Font Size:", "Corps :", "Font Size:", "Font Size:", "字体大小:"]),
+ ("Font Style:", ["Font Style:", "Style de police :", "Font Style:", "Font Style:", "字体样式:"]),
+ ("Footer Rows", ["Footer Rows", "Lignes de pied de tableau", "Footer Rows", "Footer Rows", "表尾行"]),
+ ("Footnote Options", ["Footnote Options", "Options des notes de bas de page", "Footnote Options", "Footnote Options", "脚注选项"]),
+ ("Form Field", ["Form Field", "Champ de formulaire", "Form Field", "Form Field", "表单字段"]),
+ ("Format:", ["Format:", "Format :", "Format:", "Format:", "格式:"]),
+ ("Frame Fitting", ["Frame Fitting", "Ajustement au bloc", "Frame Fitting", "Frame Fitting", "框架适合"]),
+ (
+ "Frame Fitting Options",
+ ["Frame Fitting Options", "Options d'ajustement au bloc", "Frame Fitting Options", "Frame Fitting Options", "框架适合选项"],
+ ),
+ ("Generate QR Code", ["Generate QR Code", "Générer un code QR", "Generate QR Code", "Generate QR Code", "生成二维码"]),
+ ("Go To", ["Go To", "Atteindre", "Go To", "Go To", "转到"]),
+ ("Go to Page", ["Go to Page", "Atteindre la page", "Go to Page", "Go to Page", "转到页面"]),
+ ("Gutter", ["Gutter", "Gouttière", "Gutter", "Gutter", "栏间距"]),
+ ("Header Rows", ["Header Rows", "Lignes d'en-tête", "Header Rows", "Header Rows", "表头行"]),
+ ("Height", ["Height", "Hauteur", "Height", "Height", "高度"]),
+ ("Height:", ["Height:", "Hauteur :", "Height:", "Height:", "高度:"]),
+ ("High Quality", ["High Quality", "Qualité supérieure", "High Quality", "High Quality", "高品质"]),
+ ("Desktop Printing", ["Bürodruck", "Impression bureautique", "Impresión de oficina", "オフィス印刷", "办公打印"]),
+ (
+ "Horizontal Gridline Every:",
+ [
+ "Horizontal Gridline Every:",
+ "Ligne de grille horizontale tous les :",
+ "Horizontal Gridline Every:",
+ "Horizontal Gridline Every:",
+ "水平网格线间隔:",
+ ],
+ ),
+ ("Horizontal Margins:", ["Horizontal Margins:", "Marges horizontales :", "Horizontal Margins:", "Horizontal Margins:", "水平边距:"]),
+ ("Hyphenate", ["Hyphenate", "Césure", "Hyphenate", "Hyphenate", "连字符"]),
+ ("Import Options", ["Import Options", "Options d'importation", "Import Options", "Import Options", "导入选项"]),
+ ("Import XML…", ["Import XML…", "Importer XML…", "Import XML…", "Import XML…", "导入XML…"]),
+ (
+ "Include document bleed",
+ [
+ "Dokumentbeschnitt einschließen",
+ "Inclure le fond perdu du document",
+ "Incluir sangrado del documento",
+ "ドキュメントの塗り足しを含める",
+ "包含文档出血",
+ ],
+ ),
+ ("Increment Every:", ["Increment Every:", "Ligne de grille tous les :", "Increment Every:", "Increment Every:", "递增步长:"]),
+ ("Ink Manager", ["Ink Manager", "Gestionnaire d'encres", "Ink Manager", "Ink Manager", "油墨管理器"]),
+ ("Insert Column", ["Insert Column", "Insérer une colonne", "Insert Column", "Insert Column", "插入列"]),
+ ("Insert Page After", ["Insert Page After", "Insérer une page après", "Insert Page After", "Insert Page After", "在后面插入页面"]),
+ ("Insert Row", ["Insert Row", "Insérer une ligne", "Insert Row", "Insert Row", "插入行"]),
+ ("Inset spacing", ["Inset spacing", "Espacement de retrait", "Inset spacing", "Inset spacing", "内边距"]),
+ ("Inside", ["Inside", "Intérieur", "Inside", "Inside", "内侧"]),
+ ("Intent:", ["Intent:", "Mode :", "Intent:", "Intent:", "意图:"]),
+ ("Keyboard Shortcuts", ["Keyboard Shortcuts", "Raccourcis clavier", "Keyboard Shortcuts", "Keyboard Shortcuts", "键盘快捷键"]),
+ ("Kind:", ["Kind:", "Type :", "Kind:", "Kind:", "类型:"]),
+ ("Lab", ["Lab", "Lab", "Lab", "Lab", "Lab"]),
+ ("Leading:", ["Leading:", "Interligne :", "Leading:", "Leading:", "行距:"]),
+ ("Left Indent:", ["Left Indent:", "Retrait à gauche :", "Left Indent:", "Left Indent:", "左缩进:"]),
+ ("Link To:", ["Link To:", "Lien vers :", "Link To:", "Link To:", "链接到:"]),
+ ("Load Profile…", ["Load Profile…", "Charger un profil…", "Load Profile…", "Load Profile…", "加载配置文件…"]),
+ ("Load Swatches…", ["Load Swatches…", "Charger des nuances…", "Load Swatches…", "Load Swatches…", "加载色板…"]),
+ (
+ "Load Paragraph Styles…",
+ ["Absatzformate laden…", "Charger les styles de paragraphe…", "Cargar estilos de párrafo…", "段落スタイルを読み込み…", "加载段落样式…"],
+ ),
+ (
+ "Load Character Styles…",
+ ["Zeichenformate laden…", "Charger les styles de caractère…", "Cargar estilos de carácter…", "文字スタイルを読み込み…", "加载字符样式…"],
+ ),
+ (
+ "Load All Text Styles…",
+ [
+ "Alle Textformate laden…",
+ "Charger tous les styles de texte…",
+ "Cargar todos los estilos de texto…",
+ "すべてのテキストスタイルを読み込み…",
+ "加载所有文本样式…",
+ ],
+ ),
+ ("Load Styles", ["Formate laden", "Charger les styles", "Cargar estilos", "スタイルを読み込み", "加载样式"]),
+ ("Restart Numbering", ["Nummerierung neu beginnen", "Recommencer la numérotation", "Reiniciar numeración", "番号の振り直し", "重新开始编号"]),
+ ("Continue Numbering", ["Nummerierung fortführen", "Poursuivre la numérotation", "Continuar numeración", "番号の継続", "继续编号"]),
+ ("Keep Options…", ["Umbruchoptionen …", "Options d'enchaînement…", "Opciones de separación…", "段落分離禁止オプション…", "保持选项…"]),
+ (
+ "Space Between Paragraphs Using Same Style",
+ [
+ "Abstand zwischen Absätzen mit gleichem Format",
+ "Espace entre les paragraphes de même style",
+ "Espacio entre párrafos con el mismo estilo",
+ "同じスタイルの段落間のスペース",
+ "使用相同样式的段落间距",
+ ],
+ ),
+ ("Ignore", ["Ignorieren", "Ignorer", "Ignorar", "無視", "忽略"]),
+ (
+ "Do Not Align to Baseline Grid",
+ [
+ "Nicht am Grundlinienraster ausrichten",
+ "Ne pas aligner sur la grille de ligne de base",
+ "No alinear con cuadrícula base",
+ "ベースライングリッドに揃えない",
+ "不对齐基线网格",
+ ],
+ ),
+ (
+ "Only Align First Line to Grid",
+ [
+ "Nur erste Zeile am Raster ausrichten",
+ "Aligner uniquement la première ligne sur la grille",
+ "Alinear solo primera línea con cuadrícula",
+ "最初の行のみグリッドに揃える",
+ "仅首行对齐网格",
+ ],
+ ),
+ (
+ "Balance Ragged Lines",
+ ["Unausgeglichene Zeilen ausgleichen", "Équilibrer les lignes irrégulières", "Equilibrar líneas desiguales", "行末を調整", "平衡未对齐的行"],
+ ),
+ (
+ "Drop Caps and Nested Styles…",
+ [
+ "Initialen und verschachtelte Formate …",
+ "Lettrines et styles imbriqués…",
+ "Capitulares y estilos anidados…",
+ "ドロップキャップと先頭文字スタイル…",
+ "首字下沉和嵌套样式…",
+ ],
+ ),
+ ("GREP Styles…", ["GREP-Stile …", "Styles GREP…", "Estilos GREP…", "正規表現スタイル…", "GREP 样式…"]),
+ (
+ "Restart/Continue Numbering",
+ [
+ "Nummerierung neu beginnen/fortführen",
+ "Recommencer/Poursuivre la numérotation",
+ "Reiniciar/Continuar numeración",
+ "番号の振り直し/継続",
+ "重新开始/继续编号",
+ ],
+ ),
+ (
+ "Convert Bullets and Numbering to Text",
+ [
+ "Aufzählungszeichen und Nummerierung in Text konvertieren",
+ "Convertir les puces et la numérotation en texte",
+ "Convertir viñetas y numeración en texto",
+ "箇条書きと段落番号をテキストに変換",
+ "将项目符号和编号转换为文本",
+ ],
+ ),
+ ("Hyphenation…", ["Silbentrennung …", "Césure…", "Separación por sílabas…", "ハイフネーション…", "连字…"]),
+ (
+ "Hyphenation Settings",
+ ["Silbentrennungseinstellungen", "Paramètres de césure", "Configuración de separación por sílabas", "ハイフネーション設定", "连字设置"],
+ ),
+ ("hyphens", ["Trennstriche", "tirets", "guiones", "ハイフン", "连字符"]),
+ ("Hyphenation Zone:", ["Silbentrennungsbereich:", "Zone de césure :", "Zona de separación:", "ハイフネーション領域 :", "连字区:"]),
+ ("Better Spacing", ["Bessere Abstände", "Meilleur espacement", "Mejor espaciado", "スペースを優先", "更好的间距"]),
+ ("Fewer Hyphens", ["Weniger Trennstriche", "Moins de tirets", "Menos guiones", "ハイフンを減らす", "更少的连字符"]),
+ (
+ "Hyphenate Capitalized Words",
+ [
+ "Großgeschriebene Wörter trennen",
+ "Césure des mots en capitales",
+ "Separar palabras en mayúscula",
+ "大文字で始まる単語をハイフネーション",
+ "连字大写的单词",
+ ],
+ ),
+ (
+ "Hyphenate Last Word",
+ ["Letztes Wort trennen", "Césure du dernier mot", "Separar última palabra", "最後の単語をハイフネーション", "连字最后一个单词"],
+ ),
+ (
+ "Hyphenate Across Column",
+ ["Über Spalten trennen", "Césure entre colonnes", "Separar entre columnas", "段をまたいでハイフネーション", "跨栏连字"],
+ ),
+ (
+ "Differs from this document",
+ ["Weicht von diesem Dokument ab", "Diffère de ce document", "Difiere de este documento", "このドキュメントと異なります", "与此文档不同"],
+ ),
+ (
+ "Redefine Document Style",
+ [
+ "Dokumentformat neu definieren",
+ "Redéfinir le style du document",
+ "Redefinir el estilo del documento",
+ "ドキュメントのスタイルを再定義",
+ "重新定义文档样式",
+ ],
+ ),
+ (
+ "Use Document Style Definition",
+ [
+ "Formatdefinition des Dokuments verwenden",
+ "Utiliser la définition de style du document",
+ "Usar la definición de estilo del documento",
+ "ドキュメントのスタイル定義を使用",
+ "使用文档样式定义",
+ ],
+ ),
+ ("Auto Rename", ["Automatisch umbenennen", "Renommer automatiquement", "Cambiar nombre automáticamente", "自動的に名前を変更", "自动重命名"]),
+ ("Load…", ["Load…", "Charger…", "Load…", "Load…", "加载…"]),
+ ("Make Compound", ["Make Compound", "Créer un tracé transparent", "Make Compound", "Make Compound", "建立复合路径"]),
+ ("Margins", ["Margins", "Marges", "Margins", "Margins", "边距"]),
+ ("Marks and Bleeds", ["Marken und Beschnitt", "Repères et fonds perdus", "Marcas y sangrado", "トンボと塗り足し", "标记和出血"]),
+ ("Maximum", ["Maximum", "Maximum", "Maximum", "Maximum", "最大"]),
+ ("Menu Customization", ["Menu Customization", "Personnalisation des menus", "Menu Customization", "Menu Customization", "菜单自定"]),
+ (
+ "Merge into Active Layer",
+ ["Merge into Active Layer", "Fusionner dans le calque actif", "Merge into Active Layer", "Merge into Active Layer", "合并到活动图层"],
+ ),
+ ("Min:", ["Min:", "Min. :", "Min:", "Min:", "最小:"]),
+ ("Minimum", ["Minimum", "Minimum", "Minimum", "Minimum", "最小"]),
+ (
+ "Minimum Space Before First Footnote:",
+ [
+ "Minimum Space Before First Footnote:",
+ "Espace minimal avant la première note de bas de page :",
+ "Minimum Space Before First Footnote:",
+ "Minimum Space Before First Footnote:",
+ "第一个脚注前最小间距:",
+ ],
+ ),
+ (
+ "Misspelled word → Correction (one per line):",
+ [
+ "Misspelled word → Correction (one per line):",
+ "Mot mal orthographié → correction (un par ligne) :",
+ "Misspelled word → Correction (one per line):",
+ "Misspelled word → Correction (one per line):",
+ "拼写错误的单词 → 更正(每行一个):",
+ ],
+ ),
+ ("Mobile", ["Mobile", "Mobile", "Mobile", "Mobile", "移动设备"]),
+ ("Move Selection Here", ["Move Selection Here", "Déplacer la sélection ici", "Move Selection Here", "Move Selection Here", "将所选内容移至此处"]),
+ (
+ "Select; drag to move the selection to another layer",
+ [
+ "Auswählen; ziehen, um die Auswahl auf eine andere Ebene zu verschieben",
+ "Sélectionner ; faire glisser pour déplacer la sélection vers un autre calque",
+ "Seleccionar; arrastre para mover la selección a otra capa",
+ "選択(ドラッグで選択範囲を別のレイヤーへ移動)",
+ "选择;拖动可将所选内容移至其他图层",
+ ],
+ ),
+ (
+ "Move to Color Group",
+ ["Move to Color Group", "Déplacer vers le groupe de couleurs", "Move to Color Group", "Move to Color Group", "移动到颜色组"],
+ ),
+ ("Move to Group", ["Move to Group", "Déplacer vers le groupe", "Move to Group", "Move to Group", "移动到组"]),
+ ("Multiline", ["Multiline", "Multiligne", "Multiline", "Multiline", "多行"]),
+ ("Name", ["Name", "Nom", "Name", "Name", "名称"]),
+ ("Name:", ["Name:", "Nom :", "Name:", "Name:", "名称:"]),
+ (
+ "New Bookmark for This Page",
+ [
+ "New Bookmark for This Page",
+ "Nouveau signet pour cette page",
+ "New Bookmark for This Page",
+ "New Bookmark for This Page",
+ "为此页面新建书签",
+ ],
+ ),
+ ("New Book…", ["New Book…", "Nouveau livre…", "New Book…", "New Book…", "新建书籍…"]),
+ ("New Color Group", ["New Color Group", "Nouveau groupe de couleurs", "New Color Group", "New Color Group", "新建颜色组"]),
+ (
+ "New Color Group with Swatch",
+ [
+ "New Color Group with Swatch",
+ "Nouveau groupe de couleurs avec la nuance",
+ "New Color Group with Swatch",
+ "New Color Group with Swatch",
+ "使用色板新建颜色组",
+ ],
+ ),
+ ("New Cross-Reference", ["New Cross-Reference", "Nouvelle référence croisée", "New Cross-Reference", "New Cross-Reference", "新建交叉引用"]),
+ ("New Document", ["New Document", "Nouveau document", "New Document", "New Document", "新建文档"]),
+ ("New GREP Style", ["New GREP Style", "Nouveau style GREP", "New GREP Style", "New GREP Style", "新建 GREP 样式"]),
+ ("New Library…", ["New Library…", "Nouvelle bibliothèque…", "New Library…", "New Library…", "新建库…"]),
+ ("New Line Style", ["New Line Style", "Nouveau style de ligne", "New Line Style", "New Line Style", "新建线型"]),
+ ("New Nested Style", ["New Nested Style", "Nouveau style imbriqué", "New Nested Style", "New Nested Style", "新建嵌套样式"]),
+ ("New Workspace", ["New Workspace", "Nouvel espace de travail", "New Workspace", "New Workspace", "新建工作区"]),
+ ("No spot inks", ["No spot inks", "Aucun ton direct", "No spot inks", "No spot inks", "无专色"]),
+ ("None", ["None", "Aucun", "None", "None", "无"]),
+ ("Number of Pages:", ["Number of Pages:", "Nombre de pages :", "Number of Pages:", "Number of Pages:", "页数:"]),
+ ("Number of Sides:", ["Number of Sides:", "Nombre de côtés :", "Number of Sides:", "Number of Sides:", "边数:"]),
+ ("Number of columns", ["Number of columns", "Nombre de colonnes", "Number of columns", "Number of columns", "栏数"]),
+ ("Object Layer Options", ["Object Layer Options", "Options de calque d'objet", "Object Layer Options", "Object Layer Options", "对象图层选项"]),
+ ("Offset:", ["Offset:", "Décalage :", "Offset:", "Offset:", "偏移:"]),
+ ("On Release", ["On Release", "Au relâchement", "On Release", "On Release", "释放时"]),
+ ("On Screen:", ["On Screen:", "À l'écran :", "On Screen:", "On Screen:", "屏幕显示:"]),
+ ("OpenType", ["OpenType", "OpenType", "OpenType", "OpenType", "OpenType"]),
+ ("Orientation:", ["Orientation:", "Orientation :", "Orientation:", "Orientation:", "方向:"]),
+ ("Outside", ["Outside", "Extérieur", "Outside", "Outside", "外侧"]),
+ ("Page Information", ["Seiteninformationen", "Informations sur la page", "Información de página", "ページ情報", "页面信息"]),
+ ("Page Range", ["Seitenbereich", "Plage de pages", "Intervalo de páginas", "ページ範囲", "页面范围"]),
+ ("Page Range:", ["Seitenbereich:", "Plage de pages :", "Intervalo de páginas:", "ページ範囲:", "页面范围:"]),
+ ("Pages:", ["Pages:", "Pages :", "Pages:", "Pages:", "页面:"]),
+ ("Paragraph Composer", ["Paragraph Composer", "Compositeur de paragraphe", "Paragraph Composer", "Paragraph Composer", "段落排版器"]),
+ (
+ "Paragraph Style Options",
+ ["Paragraph Style Options", "Options de style de paragraphe", "Paragraph Style Options", "Paragraph Style Options", "段落样式选项"],
+ ),
+ ("Paragraph Style:", ["Paragraph Style:", "Style de paragraphe :", "Paragraph Style:", "Paragraph Style:", "段落样式:"]),
+ ("PDF/A-2b", ["PDF/A-2b", "PDF/A-2b", "PDF/A-2b", "PDF/A-2b", "PDF/A-2b"]),
+ ("PDF/X-1a:2003", ["PDF/X-1a:2003", "PDF/X-1a:2003", "PDF/X-1a:2003", "PDF/X-1a:2003", "PDF/X-1a:2003"]),
+ ("PDF/X-4", ["PDF/X-4", "PDF/X-4", "PDF/X-4", "PDF/X-4", "PDF/X-4"]),
+ ("Place PDF", ["Place PDF", "Importer un PDF", "Place PDF", "Place PDF", "置入PDF"]),
+ ("Plain Text", ["Plain Text", "Texte brut", "Plain Text", "Plain Text", "纯文本"]),
+ ("Polygon Settings", ["Polygon Settings", "Paramètres du polygone", "Polygon Settings", "Polygon Settings", "多边形设置"]),
+ ("Position", ["Position", "Position", "Position", "Position", "位置"]),
+ ("Position:", ["Position:", "Position :", "Position:", "Position:", "位置:"]),
+ ("Poster", ["Poster", "Affiche", "Poster", "Poster", "海报"]),
+ ("Preferences", ["Preferences", "Préférences", "Preferences", "Preferences", "首选项"]),
+ ("Prefix:", ["Prefix:", "Préfixe :", "Prefix:", "Prefix:", "前缀:"]),
+ ("Preset", ["Preset", "Paramètre prédéfini", "Preset", "Preset", "预设"]),
+ ("Preset:", ["Voreinstellung:", "Paramètre prédéfini :", "Preajuste:", "プリセット:", "预设:"]),
+ ("Commercial Printing", ["Druckerei", "Impression commerciale", "Impresión comercial", "商業印刷", "商业印刷"]),
+ ("Print", ["Print", "Imprimer", "Print", "Print", "打印"]),
+ ("Printer:", ["Printer:", "Imprimante :", "Printer:", "Printer:", "打印机:"]),
+ (
+ "Printing / Exporting:",
+ ["Printing / Exporting:", "Impression / Exportation :", "Printing / Exporting:", "Printing / Exporting:", "打印/导出:"],
+ ),
+ ("Quick Actions", ["Quick Actions", "Actions rapides", "Quick Actions", "Quick Actions", "快速操作"]),
+ ("RGB", ["RGB", "RVB", "RGB", "RGB", "RGB"]),
+ ("Rectangle", ["Rectangle", "Rectangle", "Rectangle", "Rectangle", "矩形"]),
+ ("Reject All", ["Reject All", "Tout refuser", "Reject All", "Reject All", "全部拒绝"]),
+ ("Relative To:", ["Relative To:", "Relatif à :", "Relative To:", "Relative To:", "相对于:"]),
+ ("Release", ["Release", "Libérer", "Release", "Release", "释放"]),
+ ("Relink to Folder…", ["Relink to Folder…", "Rééditer le lien au dossier…", "Relink to Folder…", "Relink to Folder…", "重新链接到文件夹…"]),
+ ("Relink…", ["Relink…", "Rééditer le lien…", "Relink…", "Relink…", "重新链接…"]),
+ (
+ "Remove Conditions from Selection",
+ [
+ "Remove Conditions from Selection",
+ "Supprimer les conditions de la sélection",
+ "Remove Conditions from Selection",
+ "Remove Conditions from Selection",
+ "从选择中移除条件",
+ ],
+ ),
+ ("Repeat Header Rows", ["Repeat Header Rows", "Répéter les lignes d'en-tête", "Repeat Header Rows", "Repeat Header Rows", "重复表头行"]),
+ ("Required", ["Required", "Obligatoire", "Required", "Required", "必填"]),
+ (
+ "Reset All to Defaults",
+ ["Reset All to Defaults", "Rétablir toutes les valeurs par défaut", "Reset All to Defaults", "Reset All to Defaults", "全部恢复为默认值"],
+ ),
+ (
+ "Restart Numbering Every:",
+ [
+ "Restart Numbering Every:",
+ "Recommencer la numérotation à chaque :",
+ "Restart Numbering Every:",
+ "Restart Numbering Every:",
+ "重新编号起点:",
+ ],
+ ),
+ ("Reverse", ["Reverse", "Inverser", "Reverse", "Reverse", "反转"]),
+ (
+ "Save Swatches for Exchange…",
+ [
+ "Save Swatches for Exchange…",
+ "Enregistrer les nuances pour échange…",
+ "Save Swatches for Exchange…",
+ "Save Swatches for Exchange…",
+ "保存交换用色板…",
+ ],
+ ),
+ (
+ "Save recovery data every:",
+ [
+ "Save recovery data every:",
+ "Enregistrer les données de récupération toutes les :",
+ "Save recovery data every:",
+ "Save recovery data every:",
+ "保存恢复数据间隔:",
+ ],
+ ),
+ ("Search:", ["Search:", "Rechercher :", "Search:", "Search:", "搜索:"]),
+ ("Select an object.", ["Select an object.", "Sélectionnez un objet.", "Select an object.", "Select an object.", "选择一个对象。"]),
+ (
+ "Select text or a text frame.",
+ [
+ "Select text or a text frame.",
+ "Sélectionnez du texte ou un bloc de texte.",
+ "Select text or a text frame.",
+ "Select text or a text frame.",
+ "选择文本或文本框架。",
+ ],
+ ),
+ ("Separator:", ["Separator:", "Séparateur :", "Separator:", "Separator:", "分隔符:"]),
+ (
+ "Show Prefix/Suffix in:",
+ ["Show Prefix/Suffix in:", "Afficher le préfixe/suffixe dans :", "Show Prefix/Suffix in:", "Show Prefix/Suffix in:", "显示前缀/后缀位置:"],
+ ),
+ ("Show Tag Markers", ["Show Tag Markers", "Afficher les marqueurs de balise", "Show Tag Markers", "Show Tag Markers", "显示标签标志符"]),
+ ("Single-line", ["Single-line", "Ligne simple", "Single-line", "Single-line", "单行"]),
+ ("Single-line Composer", ["Single-line Composer", "Compositeur ligne simple", "Single-line Composer", "Single-line Composer", "单行排版器"]),
+ ("Size:", ["Size:", "Taille :", "Size:", "Size:", "大小:"]),
+ ("Screen and Email", ["Bildschirm und E-Mail", "Écran et e-mail", "Pantalla y correo", "画面とメール", "屏幕和电子邮件"]),
+ (
+ "Space Between Footnotes:",
+ ["Space Between Footnotes:", "Espace entre les notes de bas de page :", "Space Between Footnotes:", "Space Between Footnotes:", "脚注间距:"],
+ ),
+ ("Speed", ["Speed", "Vitesse", "Speed", "Speed", "速度"]),
+ ("Standard", ["Standard", "Norme", "Estándar", "標準", "标准"]),
+ ("Standard:", ["Standard:", "Norme :", "Estándar:", "標準:", "标准:"]),
+ ("Star Inset:", ["Star Inset:", "Renfoncement des branches :", "Star Inset:", "Star Inset:", "星形内边距:"]),
+ ("Start Page #:", ["Start Page #:", "N° de la première page :", "Start Page #:", "Start Page #:", "起始页码:"]),
+ ("Start at:", ["Start at:", "Commencer à :", "Start at:", "Start at:", "起始编号:"]),
+ ("Start:", ["Start:", "Début :", "Start:", "Start:", "开始:"]),
+ ("Style Name:", ["Style Name:", "Nom du style :", "Style Name:", "Style Name:", "样式名称:"]),
+ ("Style:", ["Style:", "Style :", "Style:", "Style:", "样式:"]),
+ ("Stylistic Sets", ["Stylistic Sets", "Jeux stylistiques", "Stylistic Sets", "Stylistic Sets", "样式集"]),
+ ("Subdivisions:", ["Subdivisions:", "Subdivisions :", "Subdivisions:", "Subdivisions:", "细分:"]),
+ ("Suffix:", ["Suffix:", "Suffixe :", "Suffix:", "Suffix:", "后缀:"]),
+ ("Synchronize", ["Synchronize", "Synchroniser", "Synchronize", "Synchronize", "同步"]),
+ ("Tag:", ["Tag:", "Balise :", "Tag:", "Tag:", "标签:"]),
+ ("Tagged PDF", ["Markiertes PDF", "PDF balisé", "PDF etiquetado", "タグ付き PDF", "带标签的 PDF"]),
+ ("Text Frame", ["Text Frame", "Bloc de texte", "Text Frame", "Text Frame", "文本框架"]),
+ ("Text Frame Options", ["Text Frame Options", "Options de bloc de texte", "Text Frame Options", "Text Frame Options", "文本框架选项"]),
+ ("Text Message", ["Text Message", "SMS", "Text Message", "Text Message", "短信"]),
+ ("Text Style", ["Text Style", "Style de texte", "Text Style", "Text Style", "文字样式"]),
+ ("Text Wrap", ["Text Wrap", "Habillage", "Text Wrap", "Text Wrap", "文本绕排"]),
+ (
+ "This PDF has no layers.",
+ ["This PDF has no layers.", "Ce PDF ne contient aucun calque.", "This PDF has no layers.", "This PDF has no layers.", "此 PDF 没有图层。"],
+ ),
+ ("To Text:", ["To Text:", "Au texte :", "To Text:", "To Text:", "文本转为:"]),
+ ("Top", ["Top", "Haut", "Top", "Top", "顶部"]),
+ (
+ "Track Changes in All Stories",
+ [
+ "Track Changes in All Stories",
+ "Suivre les modifications dans tous les articles",
+ "Track Changes in All Stories",
+ "Track Changes in All Stories",
+ "跟踪所有文章中的更改",
+ ],
+ ),
+ ("Trim", ["Trim", "Rognage", "Trim", "Trim", "裁切"]),
+ (
+ "Bounding Box (Visible Layers Only)",
+ [
+ "Begrenzungsrahmen (nur sichtbare Ebenen)",
+ "Cadre de sélection (calques visibles uniquement)",
+ "Cuadro delimitador (solo capas visibles)",
+ "バウンディングボックス(表示レイヤーのみ)",
+ "边界框(仅可见图层)",
+ ],
+ ),
+ (
+ "Bounding Box (All Layers)",
+ [
+ "Begrenzungsrahmen (alle Ebenen)",
+ "Cadre de sélection (tous les calques)",
+ "Cuadro delimitador (todas las capas)",
+ "バウンディングボックス(すべてのレイヤー)",
+ "边界框(所有图层)",
+ ],
+ ),
+ ("Type:", ["Type:", "Type :", "Type:", "Type:", "类型:"]),
+ ("Typical", ["Typical", "Standard", "Typical", "Typical", "典型"]),
+ ("UI Size:", ["UI Size:", "Taille de l'interface :", "UI Size:", "UI Size:", "UI 大小:"]),
+ ("Ungroup Color Group", ["Ungroup Color Group", "Dissocier le groupe de couleurs", "Ungroup Color Group", "Ungroup Color Group", "取消颜色组"]),
+ ("Unmerge", ["Unmerge", "Annuler la fusion", "Unmerge", "Unmerge", "取消合并"]),
+ ("Update", ["Update", "Mettre à jour", "Update", "Update", "更新"]),
+ ("Update Numbering", ["Update Numbering", "Mettre à jour la numérotation", "Update Numbering", "Update Numbering", "更新编号"]),
+ ("Use Global Light", ["Use Global Light", "Utiliser la lumière globale", "Use Global Light", "Use Global Light", "使用全局光"]),
+ ("User Dictionary", ["User Dictionary", "Dictionnaire utilisateur", "User Dictionary", "User Dictionary", "用户词典"]),
+ (
+ "Vertical Gridline Every:",
+ [
+ "Vertical Gridline Every:",
+ "Ligne de grille verticale tous les :",
+ "Vertical Gridline Every:",
+ "Vertical Gridline Every:",
+ "垂直网格线间隔:",
+ ],
+ ),
+ ("Vertical Margins:", ["Vertical Margins:", "Marges verticales :", "Vertical Margins:", "Vertical Margins:", "垂直边距:"]),
+ ("Vertical justification", ["Vertical justification", "Justification verticale", "Vertical justification", "Vertical justification", "垂直对齐"]),
+ ("View Threshold:", ["View Threshold:", "Seuil d'affichage :", "View Threshold:", "View Threshold:", "视图阈值:"]),
+ ("Web", ["Web", "Web", "Web", "Web", "Web"]),
+ ("Web Hyperlink", ["Web Hyperlink", "Hyperlien Web", "Web Hyperlink", "Web Hyperlink", "Web 超链接"]),
+ ("Weight:", ["Weight:", "Épaisseur :", "Weight:", "Weight:", "粗细:"]),
+ ("Width", ["Width", "Largeur", "Width", "Width", "宽度"]),
+ ("Width:", ["Width:", "Largeur :", "Width:", "Width:", "宽度:"]),
+ ("Words, one per line:", ["Words, one per line:", "Mots, un par ligne :", "Words, one per line:", "Words, one per line:", "单词,每行一个:"]),
+ ("Multiple Objects", ["Multiple Objects", "Plusieurs objets", "Multiple Objects", "Multiple Objects", "多个对象"]),
+ ("Ellipse", ["Ellipse", "Ellipse", "Ellipse", "Ellipse", "椭圆"]),
+ ("Polygon", ["Polygon", "Polygone", "Polygon", "Polygon", "多边形"]),
+ ("Characters", ["Characters", "Caractères", "Characters", "Characters", "字符"]),
+ ("Image", ["Image", "Image", "Image", "Image", "图像"]),
+ ("Line", ["Line", "Trait", "Line", "Line", "直线"]),
+ ("Path", ["Path", "Tracé", "Path", "Path", "路径"]),
+ ("No Selection", ["No Selection", "Aucune sélection", "No Selection", "No Selection", "未选择"]),
+ ("Adjust Layout", ["Adjust Layout", "Ajuster la mise en page", "Adjust Layout", "Adjust Layout", "调整版面"]),
+ ("Edit Page", ["Edit Page", "Modifier la page", "Edit Page", "Edit Page", "编辑页面"]),
+ ("Import File", ["Import File", "Importer un fichier", "Import File", "Import File", "导入文件"]),
+ ("Insert Page", ["Insert Page", "Insérer une page", "Insert Page", "Insert Page", "插入页面"]),
+ (
+ "Delete selected pages",
+ ["Ausgewählte Seiten löschen", "Supprimer les pages sélectionnées", "Eliminar páginas seleccionadas", "選択したページを削除", "删除选定页面"],
+ ),
+ ("Create new page", ["Neue Seite erstellen", "Créer une page", "Crear página nueva", "新規ページを作成", "新建页面"]),
+ ("Edit page size", ["Seitenformat bearbeiten", "Modifier le format de page", "Editar tamaño de página", "ページサイズを編集", "编辑页面大小"]),
+ (
+ "Custom Page Size…",
+ [
+ "Benutzerdefiniertes Seitenformat …",
+ "Format de page personnalisé…",
+ "Tamaño de página personalizado…",
+ "カスタムページサイズ…",
+ "自定页面大小…",
+ ],
+ ),
+ ("Hide Bar", ["Hide Bar", "Masquer la barre", "Hide Bar", "Hide Bar", "隐藏栏"]),
+ ("Properties Panel", ["Properties Panel", "Panneau Propriétés", "Properties Panel", "Properties Panel", "属性面板"]),
+ ("New Workspace…", ["New Workspace…", "Nouvel espace de travail…", "New Workspace…", "New Workspace…", "新建工作区…"]),
+ ("Float panel", ["Float panel", "Détacher le panneau", "Float panel", "Float panel", "浮动面板"]),
+ ("Dock panel", ["Dock panel", "Ancrer le panneau", "Dock panel", "Dock panel", "停靠面板"]),
+ (
+ "Fit frame height to text",
+ [
+ "Fit frame height to text",
+ "Ajuster la hauteur du bloc au texte",
+ "Fit frame height to text",
+ "Fit frame height to text",
+ "适合框架高度到文本",
+ ],
+ ),
+ ("More Options", ["More Options", "Plus d'options", "More Options", "More Options", "更多选项"]),
+ ("Flip Horizontal", ["Flip Horizontal", "Retourner horizontalement", "Flip Horizontal", "Flip Horizontal", "水平翻转"]),
+ (
+ "Rotate 90° Clockwise",
+ ["Rotate 90° Clockwise", "Rotation de 90° dans le sens horaire", "Rotate 90° Clockwise", "Rotate 90° Clockwise", "顺时针旋转90°"],
+ ),
+ ("Flip Vertical", ["Flip Vertical", "Retourner verticalement", "Flip Vertical", "Flip Vertical", "垂直翻转"]),
+ (
+ "Default Fill and Stroke (D)",
+ [
+ "Default Fill and Stroke (D)",
+ "Fond et contour par défaut (D)",
+ "Default Fill and Stroke (D)",
+ "Default Fill and Stroke (D)",
+ "默认填色和描边 (D)",
+ ],
+ ),
+ (
+ "Swap Fill and Stroke (Shift+X)",
+ [
+ "Swap Fill and Stroke (Shift+X)",
+ "Permuter fond et contour (Shift+X)",
+ "Swap Fill and Stroke (Shift+X)",
+ "Swap Fill and Stroke (Shift+X)",
+ "交换填色和描边 (Shift+X)",
+ ],
+ ),
+ ("Fill (X)", ["Fill (X)", "Fond (X)", "Fill (X)", "Fill (X)", "填色 (X)"]),
+ ("Stroke (X)", ["Stroke (X)", "Contour (X)", "Stroke (X)", "Stroke (X)", "描边 (X)"]),
+ ("Apply None (/)", ["Apply None (/)", "Appliquer Aucun (/)", "Apply None (/)", "Apply None (/)", "应用无 (/)"]),
+ (
+ "Default Fill and Stroke",
+ ["Default Fill and Stroke", "Fond et contour par défaut", "Default Fill and Stroke", "Default Fill and Stroke", "默认填色和描边"],
+ ),
+ ("Swap Fill and Stroke", ["Swap Fill and Stroke", "Permuter fond et contour", "Swap Fill and Stroke", "Swap Fill and Stroke", "交换填色和描边"]),
+ (
+ "Toggle Fill and Stroke",
+ ["Toggle Fill and Stroke", "Basculer fond/contour", "Toggle Fill and Stroke", "Toggle Fill and Stroke", "切换填色和描边"],
+ ),
+ ("Reverse the gradient", ["Reverse the gradient", "Inverser le dégradé", "Reverse the gradient", "Reverse the gradient", "反转渐变"]),
+ ("Style source", ["Style source", "Source du style", "Style source", "Style source", "样式源"]),
+ ("Open", ["Open", "Ouvrir", "Open", "Open", "打开"]),
+ ("All Caps", ["All Caps", "Tout en capitales", "All Caps", "All Caps", "全部大写"]),
+ ("Underline", ["Underline", "Souligné", "Underline", "Underline", "下划线"]),
+ ("Strikethrough", ["Strikethrough", "Barré", "Strikethrough", "Strikethrough", "删除线"]),
+ ("Superscript", ["Superscript", "Exposant", "Superscript", "Superscript", "上标"]),
+ (
+ "Pick a file in the folder holding the moved graphics",
+ [
+ "Pick a file in the folder holding the moved graphics",
+ "Choisissez un fichier dans le dossier qui contient les graphiques déplacés",
+ "Pick a file in the folder holding the moved graphics",
+ "Pick a file in the folder holding the moved graphics",
+ "在包含移动图形的文件夹中选择一个文件",
+ ],
+ ),
+ ("Show Favorites Only", ["Show Favorites Only", "Afficher uniquement les favoris", "Show Favorites Only", "Show Favorites Only", "仅显示收藏夹"]),
+ ("Select", ["Select", "Sélectionner", "Select", "Select", "选择"]),
+ (
+ "Hyperlink from the selected text or frames",
+ [
+ "Hyperlink from the selected text or frames",
+ "Hyperlien à partir du texte ou des blocs sélectionnés",
+ "Hyperlink from the selected text or frames",
+ "Hyperlink from the selected text or frames",
+ "从所选文本或框架建立超链接",
+ ],
+ ),
+ (
+ "Include when exporting",
+ ["Include when exporting", "Inclure à l'exportation", "Include when exporting", "Include when exporting", "导出时包含"],
+ ),
+ ("Add the selection", ["Add the selection", "Ajouter la sélection", "Add the selection", "Add the selection", "添加选择"]),
+ ("Tag the selection", ["Tag the selection", "Baliser la sélection", "Tag the selection", "Tag the selection", "标记选择"]),
+ ("Separated by commas", ["Separated by commas", "Séparés par des virgules", "Separated by commas", "Separated by commas", "用逗号分隔"]),
+ ("Show in the text", ["Show in the text", "Afficher dans le texte", "Show in the text", "Show in the text", "在文本中显示"]),
+ (
+ "Show / hide text with this condition",
+ [
+ "Show / hide text with this condition",
+ "Afficher / masquer le texte avec cette condition",
+ "Show / hide text with this condition",
+ "Show / hide text with this condition",
+ "使用此条件显示/隐藏文本",
+ ],
+ ),
+ (
+ "Spreads of up to 10 pages",
+ ["Spreads of up to 10 pages", "Planches de 10 pages maximum", "Spreads of up to 10 pages", "Spreads of up to 10 pages", "最多10页的跨页"],
+ ),
+ ("for", ["for", "pour", "por", "に対して", "行"]),
+ ("About DesignCraft", ["About DesignCraft", "À propos de DesignCraft", "About DesignCraft", "About DesignCraft", "关于 DesignCraft"]),
+ ("Quit DesignCraft", ["DesignCraft beenden", "Quitter DesignCraft", "Salir de DesignCraft", "DesignCraft を終了", "退出 DesignCraft"]),
+ ("Accept All Changes", ["Accept All Changes", "Accepter toutes les modifications", "Accept All Changes", "Accept All Changes", "接受所有更改"]),
+ ("Activate Document", ["Activate Document", "Activer le document", "Activate Document", "Activate Document", "激活文档"]),
+ ("Add Anchor Point", ["Add Anchor Point", "Ajouter un point d'ancrage", "Add Anchor Point", "Add Anchor Point", "添加锚点"]),
+ ("Add Document", ["Add Document", "Ajouter un document", "Add Document", "Add Document", "添加文档"]),
+ (
+ "Add Hyphenation Exception",
+ ["Add Hyphenation Exception", "Ajouter une exception de césure", "Add Hyphenation Exception", "Add Hyphenation Exception", "添加断字例外"],
+ ),
+ ("Add Item", ["Add Item", "Ajouter un élément", "Add Item", "Add Item", "添加项目"]),
+ ("Add Page to Spread", ["Add Page to Spread", "Ajouter une page à la planche", "Add Page to Spread", "Add Page to Spread", "添加页面至跨页"]),
+ ("Add to Swatches", ["Add to Swatches", "Ajouter au nuancier", "Add to Swatches", "Add to Swatches", "添加到色板"]),
+ (
+ "Allow Selected Spread to Shuffle",
+ [
+ "Allow Selected Spread to Shuffle",
+ "Autoriser la réorganisation des pages de la planche sélectionnée",
+ "Allow Selected Spread to Shuffle",
+ "Allow Selected Spread to Shuffle",
+ "允许所选跨页随机排布",
+ ],
+ ),
+ (
+ "Anchored Object Options…",
+ ["Anchored Object Options…", "Options d'objet ancré…", "Anchored Object Options…", "Anchored Object Options…", "锚定对象选项…"],
+ ),
+ ("Anchored Objects", ["Anchored Objects", "Objets ancrés", "Anchored Objects", "Anchored Objects", "锚定对象"]),
+ ("Appearance of Black", ["Appearance of Black", "Aspect du noir", "Appearance of Black", "Appearance of Black", "黑色的外观"]),
+ (
+ "Apply Attributes (Eyedropper)",
+ [
+ "Apply Attributes (Eyedropper)",
+ "Appliquer les attributs (Pipette)",
+ "Apply Attributes (Eyedropper)",
+ "Apply Attributes (Eyedropper)",
+ "应用属性 (吸管)",
+ ],
+ ),
+ ("Apply Cell Style", ["Apply Cell Style", "Appliquer le style de cellule", "Apply Cell Style", "Apply Cell Style", "应用单元格样式"]),
+ ("Apply Color", ["Apply Color", "Appliquer la couleur", "Apply Color", "Apply Color", "应用颜色"]),
+ ("Repeat", ["Wiederholen", "Répéter", "Repetir", "繰り返し", "重复"]),
+ ("Count:", ["Anzahl:", "Nombre :", "Recuento:", "繰り返し数:", "计数:"]),
+ ("Create as a grid", ["Als Raster erstellen", "Créer en tant que grille", "Crear como cuadrícula", "グリッドとして作成", "创建为网格"]),
+ ("Rows:", ["Zeilen:", "Rangées :", "Filas:", "行:", "行:"]),
+ ("Vertical:", ["Vertikal:", "Vertical :", "Vertical:", "垂直方向:", "垂直:"]),
+ ("Horizontal:", ["Horizontal:", "Horizontal :", "Horizontal:", "水平方向:", "水平:"]),
+ ("Invalid value", ["Ungültiger Wert", "Valeur non valide", "Valor no válido", "無効な値", "无效值"]),
+ ("Isolate Blending", ["Füllmethode isolieren", "Isoler le mode de fusion", "Aislar fusión", "描画モードを分離", "分离混合"]),
+ ("Knockout Group", ["Aussparungsgruppe", "Groupe de masquage", "Grupo de exclusión", "グループの抜き", "挖空组"]),
+ ("Object:", ["Objekt:", "Objet :", "Objeto:", "オブジェクト:", "对象:"]),
+ ("Group:", ["Gruppe:", "Groupe :", "Grupo:", "グループ:", "编组:"]),
+ (
+ "Sample Color (Eyedropper)",
+ ["Farbe aufnehmen (Pipette)", "Prélever la couleur (Pipette)", "Tomar color (Cuentagotas)", "カラーを抽出 (スポイト)", "取样颜色 (吸管)"],
+ ),
+ ("Apply Condition", ["Apply Condition", "Appliquer la condition", "Apply Condition", "Apply Condition", "应用条件"]),
+ (
+ "Apply Parent to Pages…",
+ ["Apply Parent to Pages…", "Appliquer le gabarit aux pages…", "Apply Parent to Pages…", "Apply Parent to Pages…", "将主页应用于页面…"],
+ ),
+ (
+ "ArtCraft App Page…",
+ ["ArtCraft App Page…", "Page de l'application ArtCraft…", "ArtCraft App Page…", "ArtCraft App Page…", "ArtCraft 应用页面…"],
+ ),
+ ("ArtCraft Website…", ["ArtCraft Website…", "Site web d'ArtCraft…", "ArtCraft Website…", "ArtCraft Website…", "ArtCraft 网站…"]),
+ ("Attributes", ["Attributes", "Attributs", "Attributes", "Attributes", "属性"]),
+ ("Bevel and Emboss", ["Bevel and Emboss", "Biseautage et estampage", "Bevel and Emboss", "Bevel and Emboss", "斜面和浮雕"]),
+ ("Buttons", ["Buttons", "Boutons", "Buttons", "Buttons", "按钮"]),
+ ("Cell Options", ["Cell Options", "Options de cellule", "Cell Options", "Cell Options", "单元格选项"]),
+ ("Cell Style Options…", ["Cell Style Options…", "Options de style de cellule…", "Cell Style Options…", "Cell Style Options…", "单元格样式选项…"]),
+ ("Change All (Object)", ["Change All (Object)", "Tout remplacer (objet)", "Change All (Object)", "Change All (Object)", "全部更改 (对象)"]),
+ ("Change Case", ["Change Case", "Modifier la casse", "Change Case", "Change Case", "更改大小写"]),
+ ("Changes", ["Changes", "Modifications", "Changes", "Changes", "更改"]),
+ ("Character Formatting", ["Character Formatting", "Mise en forme des caractères", "Character Formatting", "Character Formatting", "字符格式"]),
+ ("Clear Conveyor", ["Clear Conveyor", "Vider le convoyeur", "Clear Conveyor", "Clear Conveyor", "清除传送带"]),
+ ("Clear Transformations", ["Clear Transformations", "Effacer les transformations", "Clear Transformations", "Clear Transformations", "清除变换"]),
+ ("Clipping Path…", ["Clipping Path…", "Masque…", "Clipping Path…", "Clipping Path…", "剪切路径…"]),
+ ("Close Book", ["Close Book", "Fermer le livre", "Close Book", "Close Book", "关闭书籍"]),
+ ("Close Library", ["Close Library", "Fermer la bibliothèque", "Close Library", "Close Library", "关闭库"]),
+ ("Collect", ["Collect", "Collecter", "Collect", "Collect", "收集"]),
+ ("Color Settings…", ["Color Settings…", "Réglages des couleurs…", "Color Settings…", "Color Settings…", "颜色设置…"]),
+ (
+ "Community & Project Links",
+ ["Community & Project Links", "Communauté et liens du projet", "Community & Project Links", "Community & Project Links", "社区与项目链接"],
+ ),
+ ("Compress images", ["Bilder komprimieren", "Compresser les images", "Comprimir imágenes", "画像を圧縮", "压缩图像"]),
+ ("Compression", ["Komprimierung", "Compression", "Compresión", "圧縮", "压缩"]),
+ ("Conditions", ["Conditions", "Conditions", "Conditions", "Conditions", "条件"]),
+ ("Container", ["Container", "Conteneur", "Container", "Container", "容器"]),
+ ("Content", ["Content", "Contenu", "Content", "Content", "内容"]),
+ ("Contextual Task Bar", ["Contextual Task Bar", "Barre des tâches contextuelle", "Contextual Task Bar", "Contextual Task Bar", "上下文任务栏"]),
+ ("Control", ["Control", "Contrôle", "Control", "Control", "控制"]),
+ (
+ "Convert Cell to Graphic Cell",
+ [
+ "Convert Cell to Graphic Cell",
+ "Convertir la cellule en cellule graphique",
+ "Convert Cell to Graphic Cell",
+ "Convert Cell to Graphic Cell",
+ "将单元格转换为图形单元格",
+ ],
+ ),
+ (
+ "Convert Cell to Graphic Cell…",
+ [
+ "Convert Cell to Graphic Cell…",
+ "Convertir la cellule en cellule graphique…",
+ "Convert Cell to Graphic Cell…",
+ "Convert Cell to Graphic Cell…",
+ "将单元格转换为图形单元格…",
+ ],
+ ),
+ (
+ "Convert Cell to Text Cell",
+ [
+ "Convert Cell to Text Cell",
+ "Convertir la cellule en cellule de texte",
+ "Convert Cell to Text Cell",
+ "Convert Cell to Text Cell",
+ "将单元格转换为文本单元格",
+ ],
+ ),
+ ("Convert Color", ["Convert Color", "Convertir la couleur", "Convert Color", "Convert Color", "转换颜色"]),
+ (
+ "Convert Direction Point",
+ ["Convert Direction Point", "Convertir le point directeur", "Convert Direction Point", "Convert Direction Point", "转换方向点"],
+ ),
+ (
+ "Convert Note to Text",
+ ["Convert Note to Text", "Convertir la note en texte", "Convert Note to Text", "Convert Note to Text", "将注释转换为文本"],
+ ),
+ (
+ "Convert Selection to Multi-State Object",
+ [
+ "Convert Selection to Multi-State Object",
+ "Convertir la sélection en objet à états multiples",
+ "Convert Selection to Multi-State Object",
+ "Convert Selection to Multi-State Object",
+ "将选区转换为多状态对象",
+ ],
+ ),
+ ("Convert Shape", ["Convert Shape", "Convertir la forme", "Convert Shape", "Convert Shape", "转换形状"]),
+ (
+ "Convert Table to Text",
+ ["Convert Table to Text", "Convertir le tableau en texte", "Convert Table to Text", "Convert Table to Text", "将表格转换为文本"],
+ ),
+ (
+ "Convert Text to Table",
+ ["Convert Text to Table", "Convertir le texte en tableau", "Convert Text to Table", "Convert Text to Table", "将文本转换为表格"],
+ ),
+ ("Convert to Button", ["Convert to Button", "Convertir en bouton", "Convert to Button", "Convert to Button", "转换为按钮"]),
+ (
+ "Convert to Form Field",
+ ["Convert to Form Field", "Convertir en champ de formulaire", "Convert to Form Field", "Convert to Form Field", "转换为表单域"],
+ ),
+ ("Convert to Note", ["Convert to Note", "Convertir en note", "Convert to Note", "Convert to Note", "转换为注释"]),
+ ("Conveyor", ["Conveyor", "Convoyeur", "Conveyor", "Conveyor", "传送带"]),
+ ("Copy Link(s) To…", ["Copy Link(s) To…", "Copier les liens vers…", "Copy Link(s) To…", "Copy Link(s) To…", "复制链接至…"]),
+ ("Corner Options…", ["Corner Options…", "Options d'arrondi…", "Corner Options…", "Corner Options…", "角选项…"]),
+ (
+ "Create Alternate Layout…",
+ ["Create Alternate Layout…", "Créer une variante de mise en page…", "Create Alternate Layout…", "Create Alternate Layout…", "创建替代版面…"],
+ ),
+ ("Create Frame", ["Create Frame", "Créer un bloc", "Create Frame", "Create Frame", "创建框架"]),
+ (
+ "Create Merged Document…",
+ [
+ "Zusammengeführtes Dokument erstellen …",
+ "Créer un document fusionné…",
+ "Crear documento combinado…",
+ "結合ドキュメントを作成…",
+ "创建合并文档…",
+ ],
+ ),
+ (
+ "Cross-Reference Formats",
+ ["Cross-Reference Formats", "Formats de référence croisée", "Cross-Reference Formats", "Cross-Reference Formats", "交叉引用格式"],
+ ),
+ ("Cross-References", ["Cross-References", "Références croisées", "Cross-References", "Cross-References", "交叉引用"]),
+ ("Data Merge Fields", ["Data Merge Fields", "Champs de fusion des données", "Data Merge Fields", "Data Merge Fields", "数据合并字段"]),
+ (
+ "Define Cross-Reference Format…",
+ [
+ "Define Cross-Reference Format…",
+ "Définir un format de référence croisée…",
+ "Define Cross-Reference Format…",
+ "Define Cross-Reference Format…",
+ "定义交叉引用格式…",
+ ],
+ ),
+ ("Define Lists…", ["Define Lists…", "Définir des listes…", "Define Lists…", "Define Lists…", "定义列表…"]),
+ ("Apply Bullets", ["Aufzählungszeichen anwenden", "Appliquer des puces", "Aplicar viñetas", "箇条書きを適用", "应用项目符号"]),
+ ("Apply Numbers", ["Nummerierung anwenden", "Appliquer la numérotation", "Aplicar números", "段落番号を適用", "应用编号"]),
+ (
+ "Define Text Variable…",
+ ["Define Text Variable…", "Définir une variable de texte…", "Define Text Variable…", "Define Text Variable…", "定义文本变量…"],
+ ),
+ (
+ "Delete All Guides on Spread",
+ [
+ "Delete All Guides on Spread",
+ "Supprimer tous les repères de la planche",
+ "Delete All Guides on Spread",
+ "Delete All Guides on Spread",
+ "删除跨页上的所有参考线",
+ ],
+ ),
+ ("Delete Anchor Point", ["Delete Anchor Point", "Supprimer le point d'ancrage", "Delete Anchor Point", "Delete Anchor Point", "删除锚点"]),
+ ("Delete Item", ["Delete Item", "Supprimer l'élément", "Delete Item", "Delete Item", "删除项目"]),
+ (
+ "Delete Text Variable",
+ ["Delete Text Variable", "Supprimer la variable de texte", "Delete Text Variable", "Delete Text Variable", "删除文本变量"],
+ ),
+ ("Delete Workspace…", ["Delete Workspace…", "Supprimer l'espace de travail…", "Delete Workspace…", "Delete Workspace…", "删除工作区…"]),
+ (
+ "DesignCraft Website…",
+ ["DesignCraft Website…", "Site web de DesignCraft…", "DesignCraft Website…", "DesignCraft Website…", "DesignCraft 网站…"],
+ ),
+ (
+ "DesignCraft on GitHub…",
+ ["DesignCraft on GitHub…", "DesignCraft sur GitHub…", "DesignCraft on GitHub…", "DesignCraft on GitHub…", "DesignCraft 在 GitHub 上…"],
+ ),
+ (
+ "Detach All Objects from Parent",
+ [
+ "Detach All Objects from Parent",
+ "Détacher tous les objets du gabarit",
+ "Detach All Objects from Parent",
+ "Detach All Objects from Parent",
+ "从主页分离所有对象",
+ ],
+ ),
+ ("Directional Feather", ["Directional Feather", "Contour progressif directionnel", "Directional Feather", "Directional Feather", "定向羽化"]),
+ ("Distribute", ["Distribute", "Répartir", "Distribute", "Distribute", "分布"]),
+ ("Dock Panel", ["Dock Panel", "Ancrer le panneau", "Dock Panel", "Dock Panel", "停靠面板"]),
+ (
+ "Document Endnote Options…",
+ [
+ "Document Endnote Options…",
+ "Options de notes de fin de document…",
+ "Document Endnote Options…",
+ "Document Endnote Options…",
+ "文档尾注选项…",
+ ],
+ ),
+ (
+ "Document Footnote Options…",
+ [
+ "Document Footnote Options…",
+ "Options de notes de bas de page du document…",
+ "Document Footnote Options…",
+ "Document Footnote Options…",
+ "文档脚注选项…",
+ ],
+ ),
+ ("Document Preferences", ["Document Preferences", "Préférences du document", "Document Preferences", "Document Preferences", "文档首选项"]),
+ ("Document Presets", ["Document Presets", "Paramètres prédéfinis de document", "Document Presets", "Document Presets", "文档预设"]),
+ ("Document…", ["Document…", "Document…", "Document…", "Document…", "文档…"]),
+ ("Dynamic Spelling", ["Dynamic Spelling", "Orthographe dynamique", "Dynamic Spelling", "Dynamic Spelling", "动态拼写"]),
+ ("Edit Parents", ["Edit Parents", "Modifier les gabarits", "Edit Parents", "Edit Parents", "编辑主页"]),
+ ("Edit Story", ["Edit Story", "Modifier l'article", "Edit Story", "Edit Story", "编辑文章"]),
+ (
+ "Edit in Story Editor",
+ ["Edit in Story Editor", "Modifier en mode éditeur", "Edit in Story Editor", "Edit in Story Editor", "在文章编辑器中编辑"],
+ ),
+ ("Endnotes", ["Endnotes", "Notes de fin", "Endnotes", "Endnotes", "尾注"]),
+ ("Entire Pasteboard", ["Entire Pasteboard", "Table de montage entière", "Entire Pasteboard", "Entire Pasteboard", "完整粘贴板"]),
+ ("Erase", ["Erase", "Effacer", "Erase", "Erase", "擦除"]),
+ ("Export Book to PDF…", ["Export Book to PDF…", "Exporter le livre en PDF…", "Export Book to PDF…", "Export Book to PDF…", "将书籍导出为 PDF…"]),
+ (
+ "Export EPUB (Fixed Layout)…",
+ [
+ "Export EPUB (Fixed Layout)…",
+ "Exporter en EPUB (mise en page fixe)…",
+ "Export EPUB (Fixed Layout)…",
+ "Export EPUB (Fixed Layout)…",
+ "导出 EPUB (固定版面)…",
+ ],
+ ),
+ (
+ "Export EPUB (Reflowable)…",
+ [
+ "Export EPUB (Reflowable)…",
+ "Exporter en EPUB (redistribuable)…",
+ "Export EPUB (Reflowable)…",
+ "Export EPUB (Reflowable)…",
+ "导出 EPUB (可回流)…",
+ ],
+ ),
+ ("Export EPUB…", ["Export EPUB…", "Exporter en EPUB…", "Export EPUB…", "Export EPUB…", "导出 EPUB…"]),
+ ("Export HTML…", ["Export HTML…", "Exporter en HTML…", "Export HTML…", "Export HTML…", "导出 HTML…"]),
+ ("Export IDML…", ["Export IDML…", "Exporter en IDML…", "Export IDML…", "Export IDML…", "导出 IDML…"]),
+ (
+ "Export PDF (Interactive)…",
+ [
+ "Export PDF (Interactive)…",
+ "Exporter en PDF (interactif)…",
+ "Export PDF (Interactive)…",
+ "Export PDF (Interactive)…",
+ "导出 PDF (交互式)…",
+ ],
+ ),
+ ("Export Page as PNG…", ["Export Page as PNG…", "Exporter la page en PNG…", "Export Page as PNG…", "Export Page as PNG…", "将页面导出为 PNG…"]),
+ (
+ "Export Selection as Snippet",
+ [
+ "Export Selection as Snippet",
+ "Exporter la sélection en tant qu'extrait",
+ "Export Selection as Snippet",
+ "Export Selection as Snippet",
+ "将所选内容导出为片段",
+ ],
+ ),
+ ("Export Tagging", ["Export Tagging", "Balisage d'exportation", "Export Tagging", "Export Tagging", "导出标记"]),
+ ("Export Text…", ["Export Text…", "Exporter le texte…", "Export Text…", "Export Text…", "导出文本…"]),
+ (
+ "Extend Text Selection",
+ ["Extend Text Selection", "Étendre la sélection de texte", "Extend Text Selection", "Extend Text Selection", "扩展文本选区"],
+ ),
+ ("Fast Display", ["Fast Display", "Affichage rapide", "Fast Display", "Fast Display", "快速显示"]),
+ ("Find", ["Find", "Rechercher", "Find", "Find", "查找"]),
+ ("Find Object", ["Find Object", "Rechercher un objet", "Find Object", "Find Object", "查找对象"]),
+ (
+ "Find by Script Label",
+ ["Find by Script Label", "Rechercher par étiquette de script", "Find by Script Label", "Find by Script Label", "按脚本标签查找"],
+ ),
+ ("Find/Replace Font…", ["Find/Replace Font…", "Rechercher/Remplacer une police…", "Find/Replace Font…", "Find/Replace Font…", "查找/替换字体…"]),
+ ("First Object Above", ["First Object Above", "Premier objet au-dessus", "First Object Above", "First Object Above", "上方第一个对象"]),
+ (
+ "Fit Selection in Window",
+ [
+ "Fit Selection in Window",
+ "Ajuster la sélection à la fenêtre",
+ "Fit Selection in Window",
+ "Fit Selection in Window",
+ "窗口大小适应所选内容",
+ ],
+ ),
+ ("Flattener Preview", ["Flattener Preview", "Aperçu de l'aplatissement", "Flattener Preview", "Flattener Preview", "拼合器预览"]),
+ ("Float Panel", ["Bedienfeld lösen", "Détacher le panneau", "Hacer flotante el panel", "パネルをフローティング表示", "浮动面板"]),
+ ("Fonts in Document", ["Fonts in Document", "Polices du document", "Fonts in Document", "Fonts in Document", "文档中的字体"]),
+ ("Footnotes", ["Footnotes", "Notes de bas de page", "Footnotes", "Footnotes", "脚注"]),
+ ("Form Fields", ["Form Fields", "Champs de formulaire", "Form Fields", "Form Fields", "表单域"]),
+ (
+ "Frame Fitting Options…",
+ ["Frame Fitting Options…", "Options d'ajustement au bloc…", "Frame Fitting Options…", "Frame Fitting Options…", "框架适合选项…"],
+ ),
+ ("Generate Index…", ["Generate Index…", "Générer l'index…", "Generate Index…", "Generate Index…", "生成索引…"]),
+ ("Generate QR Code…", ["Generate QR Code…", "Générer un code QR…", "Generate QR Code…", "Generate QR Code…", "生成二维码…"]),
+ (
+ "Generate Static Caption",
+ ["Generate Static Caption", "Générer une légende statique", "Generate Static Caption", "Generate Static Caption", "生成静态题注"],
+ ),
+ ("Get Story", ["Get Story", "Obtenir l'article", "Get Story", "Get Story", "获取文章"]),
+ ("Get Table", ["Get Table", "Obtenir le tableau", "Get Table", "Get Table", "获取表格"]),
+ ("Global Light…", ["Global Light…", "Lumière globale…", "Global Light…", "Global Light…", "全局光…"]),
+ ("Go To Link", ["Go To Link", "Atteindre le lien", "Go To Link", "Go To Link", "转到链接"]),
+ ("Go To Source", ["Go To Source", "Atteindre la source", "Go To Source", "Go To Source", "转到源"]),
+ (
+ "Go to Footnote Reference",
+ [
+ "Go to Footnote Reference",
+ "Atteindre la référence de note de bas de page",
+ "Go to Footnote Reference",
+ "Go to Footnote Reference",
+ "转到脚注引用",
+ ],
+ ),
+ ("Go to Page…", ["Go to Page…", "Atteindre la page…", "Go to Page…", "Go to Page…", "转到页面…"]),
+ ("Gradient Feather", ["Gradient Feather", "Contour progressif dégradé", "Gradient Feather", "Gradient Feather", "渐变羽化"]),
+ ("Gridify", ["Gridify", "Mettre en grille", "Gridify", "Gridify", "网格化"]),
+ ("Group Transparency", ["Group Transparency", "Transparence du groupe", "Group Transparency", "Group Transparency", "编组透明度"]),
+ ("Guides", ["Guides", "Repères", "Guides", "Guides", "参考线"]),
+ ("Hide Menu Item", ["Hide Menu Item", "Masquer la commande de menu", "Hide Menu Item", "Hide Menu Item", "隐藏菜单项"]),
+ ("Hide/Lock Others", ["Hide/Lock Others", "Masquer/verrouiller les autres", "Hide/Lock Others", "Hide/Lock Others", "隐藏/锁定其他"]),
+ (
+ "High Quality Display",
+ ["High Quality Display", "Affichage de qualité supérieure", "High Quality Display", "High Quality Display", "高品质显示"],
+ ),
+ ("History", ["History", "Historique", "History", "History", "历史记录"]),
+ ("Hyphenation Exceptions", ["Hyphenation Exceptions", "Exceptions de césure", "Hyphenation Exceptions", "Hyphenation Exceptions", "断字例外"]),
+ (
+ "Import Options: Styles",
+ ["Import Options: Styles", "Options d'importation : styles", "Import Options: Styles", "Import Options: Styles", "导入选项: 样式"],
+ ),
+ (
+ "Index Page References",
+ ["Index Page References", "Références de page de l'index", "Index Page References", "Index Page References", "索引页引用"],
+ ),
+ ("Inner Glow", ["Inner Glow", "Lueur interne", "Inner Glow", "Inner Glow", "内发光"]),
+ ("Inner Shadow", ["Inner Shadow", "Ombre interne", "Inner Shadow", "Inner Shadow", "内阴影"]),
+ (
+ "Insert Anchored Object…",
+ ["Insert Anchored Object…", "Insérer un objet ancré…", "Insert Anchored Object…", "Insert Anchored Object…", "插入锚定对象…"],
+ ),
+ (
+ "Insert Cross-Reference…",
+ ["Insert Cross-Reference…", "Insérer une référence croisée…", "Insert Cross-Reference…", "Insert Cross-Reference…", "插入交叉引用…"],
+ ),
+ ("Insert Endnote", ["Insert Endnote", "Insérer une note de fin", "Insert Endnote", "Insert Endnote", "插入尾注"]),
+ ("Insert Footnote", ["Insert Footnote", "Insérer une note de bas de page", "Insert Footnote", "Insert Footnote", "插入脚注"]),
+ (
+ "Insert Math Expression…",
+ ["Insert Math Expression…", "Insérer une expression mathématique…", "Insert Math Expression…", "Insert Math Expression…", "插入数学公式…"],
+ ),
+ ("Insert Pages…", ["Insert Pages…", "Insérer des pages…", "Insert Pages…", "Insert Pages…", "插入页面…"]),
+ ("Insert Variable", ["Insert Variable", "Insérer une variable", "Insert Variable", "Insert Variable", "插入变量"]),
+ (
+ "Convert Variable to Text",
+ [
+ "Variable in Text konvertieren",
+ "Convertir la variable en texte",
+ "Convertir variable en texto",
+ "変数をテキストに変換",
+ "将变量转换为文本",
+ ],
+ ),
+ ("Inspect Document", ["Inspect Document", "Inspecter le document", "Inspect Document", "Inspect Document", "检查文档"]),
+ (
+ "Interface Color Theme",
+ ["Interface Color Theme", "Thème de couleur de l'interface", "Interface Color Theme", "Interface Color Theme", "界面颜色主题"],
+ ),
+ (
+ "Join the ArtCraft Discord…",
+ [
+ "Join the ArtCraft Discord…",
+ "Rejoindre le Discord d'ArtCraft…",
+ "Join the ArtCraft Discord…",
+ "Join the ArtCraft Discord…",
+ "加入 ArtCraft Discord…",
+ ],
+ ),
+ ("Last Object Below", ["Last Object Below", "Dernier objet en dessous", "Last Object Below", "Last Object Below", "下方最后一个对象"]),
+ ("Library Contents", ["Library Contents", "Contenu de la bibliothèque", "Library Contents", "Library Contents", "库内容"]),
+ ("Library Items", ["Library Items", "Éléments de la bibliothèque", "Library Items", "Library Items", "库项目"]),
+ ("Linked Stories", ["Linked Stories", "Articles liés", "Linked Stories", "Linked Stories", "链接的文章"]),
+ ("Liquid Page Rule", ["Liquid Page Rule", "Règle de page liquide", "Liquid Page Rule", "Liquid Page Rule", "自适应页面规则"]),
+ ("List Documents", ["List Documents", "Lister les documents", "List Documents", "List Documents", "列出文档"]),
+ ("List Styles", ["List Styles", "Lister les styles", "List Styles", "List Styles", "列表样式"]),
+ ("List Tools", ["List Tools", "Lister les outils", "List Tools", "List Tools", "列出工具"]),
+ ("Load Place Cursor", ["Load Place Cursor", "Charger le curseur d'importation", "Load Place Cursor", "Load Place Cursor", "加载放置光标"]),
+ ("Make Compound Path", ["Make Compound Path", "Créer un tracé transparent", "Make Compound Path", "Make Compound Path", "建立复合路径"]),
+ ("Map Styles to Tags", ["Map Styles to Tags", "Associer les styles aux balises", "Map Styles to Tags", "Map Styles to Tags", "将样式映射到标签"]),
+ ("Math Expression SVG", ["Math Expression SVG", "SVG d'expression mathématique", "Math Expression SVG", "Math Expression SVG", "数学公式 SVG"]),
+ ("Media Options", ["Media Options", "Options multimédia", "Media Options", "Media Options", "媒体选项"]),
+ ("Menus…", ["Menus…", "Menus…", "Menus…", "Menus…", "菜单…"]),
+ ("Merge Layers", ["Merge Layers", "Fusionner les calques", "Merge Layers", "Merge Layers", "合并图层"]),
+ ("Move Caret", ["Move Caret", "Déplacer le curseur", "Move Caret", "Move Caret", "移动插入点"]),
+ ("Move Gap", ["Move Gap", "Déplacer l'espace", "Move Gap", "Move Gap", "移动间隙"]),
+ ("Move Row", ["Move Row", "Déplacer la ligne", "Move Row", "Move Row", "移动行"]),
+ ("New Book", ["New Book", "Nouveau livre", "New Book", "New Book", "新建书籍"]),
+ ("New Cell Style…", ["New Cell Style…", "Nouveau style de cellule…", "New Cell Style…", "New Cell Style…", "新建单元格样式…"]),
+ ("New Color Swatch…", ["New Color Swatch…", "Nouvelle nuance de couleur…", "New Color Swatch…", "New Color Swatch…", "新建颜色色板…"]),
+ ("New Condition…", ["New Condition…", "Nouvelle condition…", "New Condition…", "New Condition…", "新建条件…"]),
+ ("New Guide", ["New Guide", "Nouveau repère", "New Guide", "New Guide", "新建参考线"]),
+ (
+ "New Hyperlink Destination…",
+ [
+ "New Hyperlink Destination…",
+ "Nouvelle destination d'hyperlien…",
+ "New Hyperlink Destination…",
+ "New Hyperlink Destination…",
+ "新建超链接目标…",
+ ],
+ ),
+ ("New Hyperlink…", ["New Hyperlink…", "Nouvel hyperlien…", "New Hyperlink…", "New Hyperlink…", "新建超链接…"]),
+ ("New Library", ["New Library", "Nouvelle bibliothèque", "New Library", "New Library", "新建库"]),
+ ("New Page Reference…", ["New Page Reference…", "Nouvelle référence de page…", "New Page Reference…", "New Page Reference…", "新建页面引用…"]),
+ (
+ "New Paragraph Style…",
+ ["New Paragraph Style…", "Nouveau style de paragraphe…", "New Paragraph Style…", "New Paragraph Style…", "新建段落样式…"],
+ ),
+ ("New Stroke Style…", ["New Stroke Style…", "Nouveau style de contour…", "New Stroke Style…", "New Stroke Style…", "新建描边样式…"]),
+ ("New Table Style…", ["New Table Style…", "Nouveau style de tableau…", "New Table Style…", "New Table Style…", "新建表样式…"]),
+ ("Next Cell", ["Next Cell", "Cellule suivante", "Next Cell", "Next Cell", "下一个单元格"]),
+ ("Next Document", ["Next Document", "Document suivant", "Next Document", "Next Document", "下一个文档"]),
+ ("Next Note", ["Next Note", "Note suivante", "Next Note", "Next Note", "下一个注释"]),
+ ("Next Object Above", ["Next Object Above", "Objet suivant au-dessus", "Next Object Above", "Next Object Above", "上方下一个对象"]),
+ ("Next Object Below", ["Next Object Below", "Objet suivant en dessous", "Next Object Below", "Next Object Below", "下方下一个对象"]),
+ (
+ "Next Object in Group",
+ ["Next Object in Group", "Objet suivant dans le groupe", "Next Object in Group", "Next Object in Group", "组中的下一个对象"],
+ ),
+ ("Notes", ["Notes", "Notes", "Notes", "Notes", "注释"]),
+ (
+ "Object Export Options",
+ ["Object Export Options", "Options d'exportation de l'objet", "Object Export Options", "Object Export Options", "对象导出选项"],
+ ),
+ (
+ "Object Export Options…",
+ ["Object Export Options…", "Options d'exportation de l'objet…", "Object Export Options…", "Object Export Options…", "对象导出选项…"],
+ ),
+ (
+ "Object Layer Options…",
+ ["Object Layer Options…", "Options de calque d'objet…", "Object Layer Options…", "Object Layer Options…", "对象图层选项…"],
+ ),
+ ("Object Layers", ["Object Layers", "Calques d'objet", "Object Layers", "Object Layers", "对象图层"]),
+ (
+ "Object Liquid Settings",
+ [
+ "Object Liquid Settings",
+ "Réglages de mise en page liquide de l'objet",
+ "Object Liquid Settings",
+ "Object Liquid Settings",
+ "对象自适应设置",
+ ],
+ ),
+ ("Open Book", ["Open Book", "Ouvrir le livre", "Open Book", "Open Book", "打开书籍"]),
+ ("Open Bytes", ["Open Bytes", "Ouvrir les octets", "Open Bytes", "Open Bytes", "打开字节"]),
+ ("Open IDML", ["Open IDML", "Ouvrir un fichier IDML", "Open IDML", "Open IDML", "打开 IDML"]),
+ ("Open Library", ["Open Library", "Ouvrir la bibliothèque", "Open Library", "Open Library", "打开库"]),
+ ("Outer Glow", ["Outer Glow", "Lueur externe", "Outer Glow", "Outer Glow", "外发光"]),
+ ("Overprint Preview", ["Overprint Preview", "Aperçu de la surimpression", "Overprint Preview", "Overprint Preview", "叠印预览"]),
+ (
+ "Override All Parent Page Items",
+ [
+ "Override All Parent Page Items",
+ "Remplacer tous les éléments du gabarit",
+ "Override All Parent Page Items",
+ "Override All Parent Page Items",
+ "覆盖所有主页项目",
+ ],
+ ),
+ ("Page Size", ["Page Size", "Format de page", "Page Size", "Page Size", "页面大小"]),
+ ("Page Transition", ["Page Transition", "Transition de page", "Page Transition", "Page Transition", "页面过渡"]),
+ ("Page Transitions", ["Page Transitions", "Transitions de page", "Page Transitions", "Page Transitions", "页面过渡"]),
+ ("Paragraph Formatting", ["Paragraph Formatting", "Mise en forme des paragraphes", "Paragraph Formatting", "Paragraph Formatting", "段落格式"]),
+ (
+ "Paragraph Style Options…",
+ ["Paragraph Style Options…", "Options de style de paragraphe…", "Paragraph Style Options…", "Paragraph Style Options…", "段落样式选项…"],
+ ),
+ ("Paste Into", ["Paste Into", "Coller dedans", "Paste Into", "Paste Into", "贴入内部"]),
+ (
+ "Paste without Formatting",
+ ["Paste without Formatting", "Coller sans mise en forme", "Paste without Formatting", "Paste without Formatting", "粘贴时不包含格式"],
+ ),
+ ("Place", ["Place", "Importer", "Place", "Place", "置入"]),
+ ("Place Caret", ["Place Caret", "Placer le curseur", "Place Caret", "Place Caret", "放置光标"]),
+ ("Place Item", ["Place Item", "Importer l'élément", "Place Item", "Place Item", "置入项目"]),
+ ("Place Snippet", ["Place Snippet", "Importer un extrait", "Place Snippet", "Place Snippet", "置入片段"]),
+ ("Place and Link", ["Place and Link", "Importer et lier", "Place and Link", "Place and Link", "置入并链接"]),
+ (
+ "Place with Import Options…",
+ [
+ "Place with Import Options…",
+ "Importer avec les options d'importation…",
+ "Place with Import Options…",
+ "Place with Import Options…",
+ "连同导入选项置入…",
+ ],
+ ),
+ ("Polygon Settings…", ["Polygon Settings…", "Paramètres du polygone…", "Polygon Settings…", "Polygon Settings…", "多边形设置…"]),
+ ("Preflight Document", ["Preflight Document", "Contrôle en amont du document", "Preflight Document", "Preflight Document", "预检文档"]),
+ ("Previous Cell", ["Previous Cell", "Cellule précédente", "Previous Cell", "Previous Cell", "上一个单元格"]),
+ ("Previous Document", ["Previous Document", "Document précédent", "Previous Document", "Previous Document", "上一个文档"]),
+ ("Previous Note", ["Previous Note", "Note précédente", "Previous Note", "Previous Note", "上一个注释"]),
+ (
+ "Previous Object in Group",
+ ["Previous Object in Group", "Objet précédent du groupe", "Previous Object in Group", "Previous Object in Group", "组中的上一个对象"],
+ ),
+ ("Primary Text Frame", ["Primary Text Frame", "Bloc de texte principal", "Primary Text Frame", "Primary Text Frame", "主文本框架"]),
+ ("Print Booklet…", ["Print Booklet…", "Imprimer le cahier…", "Print Booklet…", "Print Booklet…", "打印小册子…"]),
+ ("Printers", ["Printers", "Imprimantes", "Printers", "Printers", "打印机"]),
+ ("Proof Colors", ["Proof Colors", "Couleurs d'épreuve", "Proof Colors", "Proof Colors", "校样颜色"]),
+ ("Proof Setup", ["Proof Setup", "Format d'épreuve", "Proof Setup", "Proof Setup", "校样设置"]),
+ ("Quick Apply…", ["Quick Apply…", "Application rapide…", "Quick Apply…", "Quick Apply…", "快速应用…"]),
+ ("Recover Documents", ["Recover Documents", "Récupérer des documents", "Recover Documents", "Recover Documents", "恢复文档"]),
+ ("Recovery Data", ["Recovery Data", "Données de récupération", "Recovery Data", "Recovery Data", "恢复数据"]),
+ ("Reject All Changes", ["Reject All Changes", "Refuser toutes les modifications", "Reject All Changes", "Reject All Changes", "拒绝所有更改"]),
+ (
+ "Release Compound Path",
+ ["Release Compound Path", "Libérer le tracé transparent", "Release Compound Path", "Release Compound Path", "释放复合路径"],
+ ),
+ (
+ "Remove All Local Overrides",
+ [
+ "Remove All Local Overrides",
+ "Supprimer tous les remplacements locaux",
+ "Remove All Local Overrides",
+ "Remove All Local Overrides",
+ "移除所有本地覆盖",
+ ],
+ ),
+ ("Remove Document", ["Remove Document", "Retirer le document", "Remove Document", "Remove Document", "移除文档"]),
+ ("Report an Issue…", ["Report an Issue…", "Signaler un problème…", "Report an Issue…", "Report an Issue…", "报告问题…"]),
+ ("Reset Shortcuts", ["Reset Shortcuts", "Réinitialiser les raccourcis", "Reset Shortcuts", "Reset Shortcuts", "重置快捷键"]),
+ ("Reset Workspace", ["Reset Workspace", "Réinitialiser l'espace de travail", "Reset Workspace", "Reset Workspace", "重置工作区"]),
+ ("Resize", ["Resize", "Redimensionner", "Resize", "Resize", "调整大小"]),
+ ("Rotate Spread", ["Rotate Spread", "Faire pivoter la planche", "Rotate Spread", "Rotate Spread", "旋转跨页"]),
+ ("Run Script", ["Run Script", "Exécuter le script", "Run Script", "Run Script", "运行脚本"]),
+ ("Sample Document", ["Sample Document", "Document d'exemple", "Sample Document", "Sample Document", "示例文档"]),
+ ("Satin", ["Satin", "Satin", "Satin", "Satin", "光泽"]),
+ (
+ "Save Recovery Data",
+ ["Save Recovery Data", "Enregistrer les données de récupération", "Save Recovery Data", "Save Recovery Data", "保存恢复数据"],
+ ),
+ ("Script Label", ["Script Label", "Étiquette de script", "Script Label", "Script Label", "脚本标签"]),
+ ("Select All on Layer", ["Select All on Layer", "Tout sélectionner sur le calque", "Select All on Layer", "Select All on Layer", "全选当前图层"]),
+ ("Select Cells", ["Select Cells", "Sélectionner les cellules", "Select Cells", "Select Cells", "选择单元格"]),
+ ("Select Column", ["Select Column", "Sélectionner la colonne", "Select Column", "Select Column", "选择列"]),
+ ("Select Frame", ["Select Frame", "Sélectionner le bloc", "Select Frame", "Select Frame", "选择框架"]),
+ ("Select Row", ["Select Row", "Sélectionner la ligne", "Select Row", "Select Row", "选择行"]),
+ ("Select Table", ["Select Table", "Sélectionner le tableau", "Select Table", "Select Table", "选择表格"]),
+ ("Select Text", ["Select Text", "Sélectionner le texte", "Select Text", "Select Text", "选择文本"]),
+ ("Select Tool", ["Select Tool", "Sélectionner un outil", "Select Tool", "Select Tool", "选择工具"]),
+ ("Select Word", ["Select Word", "Sélectionner le mot", "Select Word", "Select Word", "选择单词"]),
+ ("Selection Attributes", ["Selection Attributes", "Attributs de la sélection", "Selection Attributes", "Selection Attributes", "选择属性"]),
+ ("Separations Preview", ["Separations Preview", "Aperçu des séparations", "Separations Preview", "Separations Preview", "分色预览"]),
+ ("Serialize", ["Serialize", "Sérialiser", "Serialize", "Serialize", "序列化"]),
+ ("Set Active Layer", ["Set Active Layer", "Définir le calque actif", "Set Active Layer", "Set Active Layer", "设置活动图层"]),
+ ("Set Shortcut", ["Set Shortcut", "Définir le raccourci", "Set Shortcut", "Set Shortcut", "设置快捷键"]),
+ (
+ "Set Visibility / Lock",
+ ["Set Visibility / Lock", "Définir visibilité / verrouillage", "Set Visibility / Lock", "Set Visibility / Lock", "设置可见性/锁定"],
+ ),
+ ("Show Panel", ["Show Panel", "Afficher le panneau", "Show Panel", "Show Panel", "显示面板"]),
+ (
+ "Show/Hide Baseline Grid",
+ [
+ "Show/Hide Baseline Grid",
+ "Afficher/Masquer la grille de ligne de base",
+ "Show/Hide Baseline Grid",
+ "Show/Hide Baseline Grid",
+ "显示/隐藏基线网格",
+ ],
+ ),
+ (
+ "Show/Hide Depth Ruler",
+ [
+ "Show/Hide Depth Ruler",
+ "Afficher/Masquer la règle de profondeur",
+ "Mostrar/ocultar regla de profundidad",
+ "Show/Hide Depth Ruler",
+ "显示/隐藏深度标尺",
+ ],
+ ),
+ (
+ "Show/Hide Document Grid",
+ [
+ "Show/Hide Document Grid",
+ "Afficher/Masquer la grille du document",
+ "Show/Hide Document Grid",
+ "Show/Hide Document Grid",
+ "显示/隐藏文档网格",
+ ],
+ ),
+ (
+ "Show/Hide Frame Edges",
+ ["Show/Hide Frame Edges", "Afficher/Masquer les contours de bloc", "Show/Hide Frame Edges", "Show/Hide Frame Edges", "显示/隐藏框架边缘"],
+ ),
+ ("Show/Hide Guides", ["Show/Hide Guides", "Afficher/Masquer les repères", "Show/Hide Guides", "Show/Hide Guides", "显示/隐藏参考线"]),
+ (
+ "Show/Hide Hidden Characters",
+ [
+ "Show/Hide Hidden Characters",
+ "Afficher/Masquer les caractères masqués",
+ "Show/Hide Hidden Characters",
+ "Show/Hide Hidden Characters",
+ "显示/隐藏隐藏字符",
+ ],
+ ),
+ ("Show/Hide Panels", ["Show/Hide Panels", "Afficher/Masquer les panneaux", "Show/Hide Panels", "Show/Hide Panels", "显示/隐藏面板"]),
+ (
+ "Show/Hide Panels Except Tools",
+ [
+ "Show/Hide Panels Except Tools",
+ "Afficher/Masquer les panneaux sauf Outils",
+ "Show/Hide Panels Except Tools",
+ "Show/Hide Panels Except Tools",
+ "显示/隐藏面板(工具除外)",
+ ],
+ ),
+ ("Show/Hide Rulers", ["Show/Hide Rulers", "Afficher/Masquer les règles", "Show/Hide Rulers", "Show/Hide Rulers", "显示/隐藏标尺"]),
+ (
+ "Show/Hide Tagged Frames",
+ [
+ "Show/Hide Tagged Frames",
+ "Afficher/Masquer les blocs balisés",
+ "Show/Hide Tagged Frames",
+ "Show/Hide Tagged Frames",
+ "显示/隐藏标记的框架",
+ ],
+ ),
+ (
+ "Show/Hide Text Threads",
+ ["Show/Hide Text Threads", "Afficher/Masquer le chaînage du texte", "Show/Hide Text Threads", "Show/Hide Text Threads", "显示/隐藏文本串接"],
+ ),
+ ("Smooth", ["Smooth", "Lisse", "Smooth", "Smooth", "平滑"]),
+ ("Sort", ["Sort", "Trier", "Sort", "Sort", "排序"]),
+ (
+ "Split Cell Horizontally",
+ ["Split Cell Horizontally", "Scinder la cellule horizontalement", "Split Cell Horizontally", "Split Cell Horizontally", "水平拆分单元格"],
+ ),
+ (
+ "Split Cell Vertically",
+ ["Split Cell Vertically", "Scinder la cellule verticalement", "Split Cell Vertically", "Split Cell Vertically", "垂直拆分单元格"],
+ ),
+ ("Split Note", ["Split Note", "Scinder la note", "Split Note", "Split Note", "拆分注释"]),
+ ("Split Path", ["Split Path", "Fractionner le tracé", "Split Path", "Split Path", "拆分路径"]),
+ ("Step and Repeat…", ["Step and Repeat…", "Exécuter et répéter…", "Step and Repeat…", "Step and Repeat…", "步进和重复…"]),
+ ("Stroke Styles", ["Stroke Styles", "Styles de contour", "Stroke Styles", "Stroke Styles", "描边样式"]),
+ ("Structure", ["Structure", "Structure", "Structure", "Structure", "结构"]),
+ ("Style Source", ["Style Source", "Source du style", "Style Source", "Style Source", "样式源"]),
+ ("Synchronize Book", ["Synchronize Book", "Synchroniser le livre", "Synchronize Book", "Synchronize Book", "同步书籍"]),
+ ("Table Options", ["Table Options", "Options de tableau", "Table Options", "Table Options", "表选项"]),
+ ("Table Panel", ["Table Panel", "Panneau Tableau", "Table Panel", "Table Panel", "表格面板"]),
+ ("Table Style Options…", ["Table Style Options…", "Options de style de tableau…", "Table Style Options…", "Table Style Options…", "表样式选项…"]),
+ (
+ "Table of Contents Entries",
+ ["Table of Contents Entries", "Entrées de la table des matières", "Table of Contents Entries", "Table of Contents Entries", "目录条目"],
+ ),
+ ("Table of Contents…", ["Table of Contents…", "Table des matières…", "Table of Contents…", "Table of Contents…", "目录…"]),
+ ("Text Anchors", ["Text Anchors", "Ancres de texte", "Text Anchors", "Text Anchors", "文本锚点"]),
+ ("Text Variables", ["Text Variables", "Variables de texte", "Text Variables", "Text Variables", "文本变量"]),
+ ("Toggle Normal/Preview", ["Toggle Normal/Preview", "Basculer Normal/Aperçu", "Toggle Normal/Preview", "Toggle Normal/Preview", "切换正常/预览"]),
+ (
+ "Toggle Presentation",
+ [
+ "Präsentation ein/aus",
+ "Activer/désactiver la présentation",
+ "Activar/desactivar presentación",
+ "プレゼンテーションを切り替え",
+ "切换演示模式",
+ ],
+ ),
+ ("Toggle Selection", ["Toggle Selection", "Basculer la sélection", "Toggle Selection", "Toggle Selection", "切换选择"]),
+ ("Tools: Double Column", ["Tools: Double Column", "Outils : double colonne", "Tools: Double Column", "Tools: Double Column", "工具: 双列"]),
+ ("Transform Again", ["Transform Again", "Répéter la transformation", "Transform Again", "Transform Again", "再次变换"]),
+ ("Transform Panel", ["Transform Panel", "Panneau Transformation", "Transform Panel", "Transform Panel", "变换面板"]),
+ ("Transform Values", ["Transform Values", "Valeurs de transformation", "Transform Values", "Transform Values", "变换值"]),
+ (
+ "Transparency Blend Space",
+ ["Transparency Blend Space", "Espace de fusion de la transparence", "Transparency Blend Space", "Transparency Blend Space", "透明度混合空间"],
+ ),
+ (
+ "Transparency Flattener Presets",
+ [
+ "Transparency Flattener Presets",
+ "Préréglages d'aplatissement de la transparence",
+ "Transparency Flattener Presets",
+ "Transparency Flattener Presets",
+ "透明度拼合器预设",
+ ],
+ ),
+ ("Type on a Path", ["Type on a Path", "Texte curviligne", "Type on a Path", "Type on a Path", "路径文字"]),
+ (
+ "Type on a Path Options…",
+ ["Type on a Path Options…", "Options de texte curviligne…", "Type on a Path Options…", "Type on a Path Options…", "路径文字选项…"],
+ ),
+ ("Typical Display", ["Typical Display", "Affichage standard", "Typical Display", "Typical Display", "典型显示"]),
+ ("UI Scaling", ["UI Scaling", "Mise à l'échelle de l'interface", "UI Scaling", "UI Scaling", "UI 缩放"]),
+ ("Update Link", ["Update Link", "Mettre à jour le lien", "Update Link", "Update Link", "更新链接"]),
+ (
+ "User Dictionary Words",
+ ["User Dictionary Words", "Mots du dictionnaire utilisateur", "User Dictionary Words", "User Dictionary Words", "用户词典单词"],
+ ),
+ ("User Dictionary…", ["User Dictionary…", "Dictionnaire utilisateur…", "User Dictionary…", "User Dictionary…", "用户词典…"]),
+ ("Zoom To", ["Zoom To", "Zoom sur", "Zoom To", "Zoom To", "缩放至"]),
+ ("⇧", ["⇧", "⇧", "⇧", "⇧", "⇧"]),
+ ("⌃", ["⌃", "⌃", "⌃", "⌃", "⌃"]),
+ ("⌘", ["⌘", "⌘", "⌘", "⌘", "⌘"]),
+ ("⌥", ["⌥", "⌥", "⌥", "⌥", "⌥"]),
+ ("Accept Change", ["Accept Change", "Accepter la modification", "Accept Change", "Accept Change", "接受更改"]),
+ ("Add Anchor", ["Add Anchor", "Ajouter un point d'ancrage", "Add Anchor", "Add Anchor", "添加锚点"]),
+ (
+ "Add Selection to Article",
+ ["Add Selection to Article", "Ajouter la sélection à l'article", "Add Selection to Article", "Add Selection to Article", "将选择添加到文章"],
+ ),
+ ("Add Unnamed Colors", ["Add Unnamed Colors", "Ajouter les couleurs sans nom", "Add Unnamed Colors", "Add Unnamed Colors", "添加未命名颜色"]),
+ ("Add to Dictionary", ["Add to Dictionary", "Ajouter au dictionnaire", "Add to Dictionary", "Add to Dictionary", "添加到字典"]),
+ ("Align Center", ["Align Center", "Aligner au centre", "Align Center", "Align Center", "居中对齐"]),
+ ("Align Left", ["Align Left", "Aligner à gauche", "Align Left", "Align Left", "左对齐"]),
+ ("Align Right", ["Align Right", "Aligner à droite", "Align Right", "Align Right", "右对齐"]),
+ (
+ "Apply Character Style",
+ ["Apply Character Style", "Appliquer le style de caractère", "Apply Character Style", "Apply Character Style", "应用字符样式"],
+ ),
+ ("Apply Object Style", ["Apply Object Style", "Appliquer le style d'objet", "Apply Object Style", "Apply Object Style", "应用对象样式"]),
+ (
+ "Apply Paragraph Style",
+ ["Apply Paragraph Style", "Appliquer le style de paragraphe", "Apply Paragraph Style", "Apply Paragraph Style", "应用段落样式"],
+ ),
+ ("Apply Table Style", ["Apply Table Style", "Appliquer le style de tableau", "Apply Table Style", "Apply Table Style", "应用表样式"]),
+ ("Article Options", ["Article Options", "Options d'article", "Article Options", "Article Options", "文章选项"]),
+ ("Basic Feather", ["Basic Feather", "Contour progressif simple", "Basic Feather", "Basic Feather", "基本羽化"]),
+ ("Bold", ["Bold", "Gras", "Bold", "Bold", "加粗"]),
+ ("Bring Forward", ["Bring Forward", "En avant", "Bring Forward", "Bring Forward", "向前移动"]),
+ ("Bring to Front", ["Bring to Front", "Premier plan", "Bring to Front", "Bring to Front", "置于顶层"]),
+ ("Change", ["Change", "Remplacer", "Change", "Change", "更改"]),
+ (
+ "Character Style Options…",
+ ["Character Style Options…", "Options de style de caractère…", "Character Style Options…", "Character Style Options…", "字符样式选项…"],
+ ),
+ ("Close Path", ["Close Path", "Fermer le tracé", "Close Path", "Close Path", "闭合路径"]),
+ ("Color Group Options", ["Color Group Options", "Options du groupe de couleurs", "Color Group Options", "Color Group Options", "颜色组选项"]),
+ ("Column Width", ["Column Width", "Largeur de colonne", "Column Width", "Column Width", "列宽"]),
+ ("Balance Columns", ["Spalten ausgleichen", "Équilibrer les colonnes", "Equilibrar columnas", "段の高さを揃える", "平衡栏高"]),
+ ("Column Rules", ["Spaltenlinien", "Filets de colonne", "Filetes de columna", "段間罫線", "栏间线"]),
+ ("Insert Column Rule", ["Spaltenlinie einfügen", "Insérer un filet de colonne", "Insertar filete de columna", "段間罫線を挿入", "插入栏间线"]),
+ ("Tint %", ["Farbton %", "Teinte %", "Matiz %", "濃淡 %", "色调 %"]),
+ ("Top Inset", ["Oberer Einzug", "Retrait supérieur", "Sangría superior", "上インセット", "顶部内边距"]),
+ ("Bottom Inset", ["Unterer Einzug", "Retrait inférieur", "Sangría inferior", "下インセット", "底部内边距"]),
+ ("Horizontal Offset", ["Horizontaler Versatz", "Décalage horizontal", "Desplazamiento horizontal", "水平オフセット", "水平偏移"]),
+ ("Condition Options…", ["Condition Options…", "Options de condition…", "Condition Options…", "Condition Options…", "条件选项…"]),
+ (
+ "Convert to Liquid Guide",
+ ["Convert to Liquid Guide", "Convertir en repère liquide", "Convert to Liquid Guide", "Convert to Liquid Guide", "转换为自适应参考线"],
+ ),
+ ("Convert to Object", ["Convert to Object", "Convertir en objet", "Convert to Object", "Convert to Object", "转换为对象"]),
+ ("Create Line", ["Create Line", "Créer un trait", "Create Line", "Create Line", "创建线条"]),
+ ("Create Path", ["Create Path", "Créer un tracé", "Create Path", "Create Path", "创建路径"]),
+ ("Decrease Point Size", ["Decrease Point Size", "Diminuer le corps", "Decrease Point Size", "Decrease Point Size", "减小字号"]),
+ ("Delete Article", ["Delete Article", "Supprimer l'article", "Delete Article", "Delete Article", "删除文章"]),
+ ("Delete Bookmark", ["Delete Bookmark", "Supprimer le signet", "Delete Bookmark", "Delete Bookmark", "删除书签"]),
+ ("Delete Endnote", ["Delete Endnote", "Supprimer la note de fin", "Delete Endnote", "Delete Endnote", "删除尾注"]),
+ ("Delete Footnote", ["Delete Footnote", "Supprimer la note de bas de page", "Delete Footnote", "Delete Footnote", "删除脚注"]),
+ ("Delete Guide", ["Delete Guide", "Supprimer le repère", "Delete Guide", "Delete Guide", "删除参考线"]),
+ ("Delete Hyperlink", ["Delete Hyperlink", "Supprimer l'hyperlien", "Delete Hyperlink", "Delete Hyperlink", "删除超链接"]),
+ ("Delete List", ["Delete List", "Supprimer la liste", "Delete List", "Delete List", "删除列表"]),
+ ("Delete Note", ["Delete Note", "Supprimer la note", "Delete Note", "Delete Note", "删除注释"]),
+ ("Delete Pages", ["Delete Pages", "Supprimer les pages", "Delete Pages", "Delete Pages", "删除页面"]),
+ (
+ "Delete Paragraph Style",
+ ["Delete Paragraph Style", "Supprimer le style de paragraphe", "Delete Paragraph Style", "Delete Paragraph Style", "删除段落样式"],
+ ),
+ ("Delete Stroke Style", ["Delete Stroke Style", "Supprimer le style de contour", "Delete Stroke Style", "Delete Stroke Style", "删除描边样式"]),
+ ("Delete Table", ["Delete Table", "Supprimer le tableau", "Delete Table", "Delete Table", "删除表格"]),
+ ("Delete Tag", ["Delete Tag", "Supprimer la balise", "Delete Tag", "Delete Tag", "删除标记"]),
+ ("Delete Text", ["Delete Text", "Supprimer le texte", "Delete Text", "Delete Text", "删除文本"]),
+ (
+ "Distribute Columns Evenly",
+ ["Distribute Columns Evenly", "Répartir les colonnes uniformément", "Distribute Columns Evenly", "Distribute Columns Evenly", "均匀分布列"],
+ ),
+ ("Edit Endnote", ["Edit Endnote", "Modifier la note de fin", "Edit Endnote", "Edit Endnote", "编辑尾注"]),
+ ("Edit Note", ["Edit Note", "Modifier la note", "Edit Note", "Edit Note", "编辑注释"]),
+ ("Embed Link", ["Embed Link", "Incorporer le lien", "Embed Link", "Embed Link", "嵌入链接"]),
+ ("Fill", ["Fill", "Fond", "Fill", "Fill", "填色"]),
+ (
+ "Fill with Placeholder Text",
+ [
+ "Fill with Placeholder Text",
+ "Remplir avec le texte de substitution",
+ "Fill with Placeholder Text",
+ "Fill with Placeholder Text",
+ "用占位符文本填充",
+ ],
+ ),
+ ("Flip", ["Flip", "Retourner", "Flip", "Flip", "翻转"]),
+ ("Hyperlink Options…", ["Hyperlink Options…", "Options d'hyperlien…", "Hyperlink Options…", "Hyperlink Options…", "超链接选项…"]),
+ ("Increase Point Size", ["Increase Point Size", "Augmenter le corps", "Increase Point Size", "Increase Point Size", "增大字号"]),
+ ("Insert Column Left", ["Insert Column Left", "Insérer une colonne à gauche", "Insert Column Left", "Insert Column Left", "在左侧插入列"]),
+ ("Insert Column Right", ["Insert Column Right", "Insérer une colonne à droite", "Insert Column Right", "Insert Column Right", "在右侧插入列"]),
+ ("Insert Row Above", ["Insert Row Above", "Insérer une ligne au-dessus", "Insert Row Above", "Insert Row Above", "在上方插入行"]),
+ ("Insert Row Below", ["Insert Row Below", "Insérer une ligne en dessous", "Insert Row Below", "Insert Row Below", "在下方插入行"]),
+ ("Italic", ["Italic", "Italique", "Italic", "Italic", "斜体"]),
+ ("Justify Left", ["Justify Left", "Justifier à gauche", "Justify Left", "Justify Left", "左对齐齐行"]),
+ ("Layer Options…", ["Layer Options…", "Options de calque…", "Layer Options…", "Layer Options…", "图层选项…"]),
+ ("Move", ["Move", "Déplacer", "Move", "Move", "移动"]),
+ ("Move Anchors", ["Move Anchors", "Déplacer les points d'ancrage", "Move Anchors", "Move Anchors", "移动锚点"]),
+ ("Move Column", ["Move Column", "Déplacer la colonne", "Move Column", "Move Column", "移动列"]),
+ ("Move Guide", ["Move Guide", "Déplacer le repère", "Move Guide", "Move Guide", "移动参考线"]),
+ ("Move Layer", ["Move Layer", "Déplacer le calque", "Move Layer", "Move Layer", "移动图层"]),
+ ("Move Pages…", ["Move Pages…", "Déplacer des pages…", "Move Pages…", "Move Pages…", "移动页面…"]),
+ ("Move to Layer", ["Move to Layer", "Déplacer vers le calque", "Move to Layer", "Move to Layer", "移动到图层"]),
+ ("New Article", ["New Article", "Nouvel article", "New Article", "New Article", "新建文章"]),
+ ("New Bookmark", ["New Bookmark", "Nouveau signet", "New Bookmark", "New Bookmark", "新建书签"]),
+ (
+ "New Character Style…",
+ ["New Character Style…", "Nouveau style de caractère…", "New Character Style…", "New Character Style…", "新建字符样式…"],
+ ),
+ ("New Layer…", ["New Layer…", "Nouveau calque…", "New Layer…", "New Layer…", "新建图层…"]),
+ ("New Note", ["New Note", "Nouvelle note", "New Note", "New Note", "新建注释"]),
+ ("New Object Style…", ["New Object Style…", "Nouveau style d'objet…", "New Object Style…", "New Object Style…", "新建对象样式…"]),
+ ("New Parent…", ["New Parent…", "Nouveau gabarit…", "New Parent…", "New Parent…", "新建主页…"]),
+ ("New Tag", ["New Tag", "Nouvelle balise", "New Tag", "New Tag", "新建标记"]),
+ ("Opacity", ["Opacity", "Opacité", "Opacity", "Opacity", "不透明度"]),
+ ("Paste in Place", ["Paste in Place", "Coller sur place", "Paste in Place", "Paste in Place", "原位粘贴"]),
+ (
+ "Place Loaded Graphic",
+ ["Place Loaded Graphic", "Importer le graphique chargé", "Place Loaded Graphic", "Place Loaded Graphic", "置入已加载的图形"],
+ ),
+ ("Reject Change", ["Reject Change", "Refuser la modification", "Reject Change", "Reject Change", "拒绝更改"]),
+ (
+ "Release State to Objects",
+ ["Release State to Objects", "Libérer l'état en objets", "Release State to Objects", "Release State to Objects", "将状态释放为对象"],
+ ),
+ (
+ "Remove Hyphenation Exception",
+ [
+ "Remove Hyphenation Exception",
+ "Supprimer l'exception de césure",
+ "Remove Hyphenation Exception",
+ "Remove Hyphenation Exception",
+ "移除断字例外",
+ ],
+ ),
+ ("Remove from Article", ["Remove from Article", "Retirer de l'article", "Remove from Article", "Remove from Article", "从文章中移除"]),
+ ("Rename", ["Rename", "Renommer", "Rename", "Rename", "重命名"]),
+ ("Rename Bookmark", ["Rename Bookmark", "Renommer le signet", "Rename Bookmark", "Rename Bookmark", "重命名书签"]),
+ ("Rotate", ["Rotate", "Rotation", "Rotate", "Rotate", "旋转"]),
+ ("Row Height", ["Row Height", "Hauteur de ligne", "Row Height", "Row Height", "行高"]),
+ ("Scale", ["Scale", "Échelle", "Scale", "Scale", "缩放"]),
+ ("Send Backward", ["Send Backward", "En arrière", "Send Backward", "Send Backward", "向后移动"]),
+ ("Send to Back", ["Send to Back", "Arrière-plan", "Send to Back", "Send to Back", "置于底层"]),
+ (
+ "Set Cross-Reference Format",
+ [
+ "Set Cross-Reference Format",
+ "Définir le format de référence croisée",
+ "Set Cross-Reference Format",
+ "Set Cross-Reference Format",
+ "设置交叉引用格式",
+ ],
+ ),
+ (
+ "Set Footnote Text",
+ ["Set Footnote Text", "Définir le texte de la note de bas de page", "Set Footnote Text", "Set Footnote Text", "设置脚注文本"],
+ ),
+ ("Set Story Text", ["Set Story Text", "Définir le texte de l'article", "Set Story Text", "Set Story Text", "设置文章文本"]),
+ ("Shear", ["Shear", "Déformation", "Shear", "Shear", "切变"]),
+ ("Show All on Spread", ["Show All on Spread", "Tout afficher sur la planche", "Show All on Spread", "Show All on Spread", "在跨页上全部显示"]),
+ ("Show State", ["Show State", "Afficher l'état", "Show State", "Show State", "显示状态"]),
+ ("State Options", ["State Options", "Options d'état", "State Options", "State Options", "状态选项"]),
+ ("Tag Frame", ["Tag Frame", "Baliser le bloc", "Tag Frame", "Tag Frame", "标记框架"]),
+ ("Tag Text", ["Tag Text", "Baliser le texte", "Tag Text", "Tag Text", "标记文本"]),
+ ("Track Changes", ["Track Changes", "Suivi des modifications", "Track Changes", "Track Changes", "修订"]),
+ ("Unlink", ["Unlink", "Délier", "Unlink", "Unlink", "取消链接"]),
+ (
+ "Unlock All on Spread",
+ ["Unlock All on Spread", "Tout déverrouiller sur la planche", "Unlock All on Spread", "Unlock All on Spread", "解锁跨页上的所有内容"],
+ ),
+ ("Update Index", ["Update Index", "Mettre à jour l'index", "Update Index", "Update Index", "更新索引"]),
+ (
+ "Update Table of Contents",
+ ["Update Table of Contents", "Mettre à jour la table des matières", "Update Table of Contents", "Update Table of Contents", "更新目录"],
+ ),
+ (
+ "Bulleted and Numbered Lists",
+ [
+ "Bulleted and Numbered Lists",
+ "Listes à puces et numérotées",
+ "Bulleted and Numbered Lists",
+ "Bulleted and Numbered Lists",
+ "项目符号和编号列表",
+ ],
+ ),
+ (
+ "Insert Special Character",
+ ["Insert Special Character", "Insérer un caractère spécial", "Insert Special Character", "Insert Special Character", "插入特殊字符"],
+ ),
+ ("Insert White Space", ["Insert White Space", "Insérer un espace", "Insert White Space", "Insert White Space", "插入空格"]),
+ (
+ "Insert Break Character",
+ ["Insert Break Character", "Insérer un caractère de saut", "Insert Break Character", "Insert Break Character", "插入分隔符"],
+ ),
+ (
+ "Hyperlinks Cross-References",
+ [
+ "Hyperlinks Cross-References",
+ "Hyperliens et références croisées",
+ "Hyperlinks Cross-References",
+ "Hyperlinks Cross-References",
+ "超链接交叉引用",
+ ],
+ ),
+ (
+ "Document Footnote Options...",
+ [
+ "Document Footnote Options...",
+ "Options de notes de bas de page du document...",
+ "Document Footnote Options...",
+ "Document Footnote Options...",
+ "文档脚注选项…",
+ ],
+ ),
+ (" Close ", [" Close ", " Fermer ", " Close ", " Close ", " 关闭 "]),
+ (" New file ", [" New file ", " Nouveau fichier ", " New file ", " New file ", " 新建文件 "]),
+ (" OK ", [" OK ", " OK ", " OK ", " OK ", " 确定 "]),
+ (" Open ", [" Open ", " Ouvrir ", " Open ", " Open ", " 打开 "]),
+ (
+ " Open sample magazine ",
+ [" Open sample magazine ", " Ouvrir un magazine d'exemple ", " Open sample magazine ", " Open sample magazine ", " 打开示例杂志 "],
+ ),
+ ("(Top Level)", ["(Top Level)", "(Niveau supérieur)", "(Top Level)", "(Top Level)", "(顶层)"]),
+ ("(import)", ["(import)", "(importation)", "(import)", "(import)", "(导入)"]),
+ ("Anchored Object", ["Anchored Object", "Objet ancré", "Anchored Object", "Anchored Object", "锚定对象"]),
+ (
+ "Apply Attributes (Eyedropper",
+ [
+ "Apply Attributes (Eyedropper",
+ "Appliquer les attributs (Pipette",
+ "Apply Attributes (Eyedropper",
+ "Apply Attributes (Eyedropper",
+ "应用属性 (吸管",
+ ],
+ ),
+ ("Baseline Grid", ["Baseline Grid", "Grille de ligne de base", "Baseline Grid", "Baseline Grid", "基线网格"]),
+ ("Bleed and Slug", ["Bleed and Slug", "Fond perdu et ligne-bloc", "Bleed and Slug", "Bleed and Slug", "出血和辅助信息区"]),
+ (
+ "Buttons act in interactive PDF export.",
+ [
+ "Buttons act in interactive PDF export.",
+ "Les boutons sont actifs dans l'export PDF interactif.",
+ "Buttons act in interactive PDF export.",
+ "Buttons act in interactive PDF export.",
+ "按钮在交互式 PDF 导出中起作用。",
+ ],
+ ),
+ ("Captions", ["Captions", "Légendes", "Captions", "Captions", "题注"]),
+ ("Change All (Object", ["Change All (Object", "Tout remplacer (objet", "Change All (Object", "Change All (Object", "全部更改 (对象"]),
+ ("Character Settings", ["Character Settings", "Réglages des caractères", "Character Settings", "Character Settings", "字符设置"]),
+ ("Choose a link.", ["Choose a link.", "Choisissez un lien.", "Choose a link.", "Choose a link.", "选择一个链接。"]),
+ ("Clipping Path", ["Clipping Path", "Masque", "Clipping Path", "Clipping Path", "剪切路径"]),
+ (
+ "Collect objects with the Content Collector (B); place them with the Content Placer.",
+ [
+ "Collect objects with the Content Collector (B); place them with the Content Placer.",
+ "Collectez des objets avec l'outil Collecteur de contenu (B) ; placez-les avec l'outil Placeur de contenu.",
+ "Collect objects with the Content Collector (B); place them with the Content Placer.",
+ "Collect objects with the Content Collector (B); place them with the Content Placer.",
+ "使用内容收集器 (B) 收集对象;使用内容放置器放置它们。",
+ ],
+ ),
+ ("Content Fitting", ["Content Fitting", "Ajustement du contenu", "Content Fitting", "Content Fitting", "内容适合"]),
+ ("Convert Cell Type", ["Convert Cell Type", "Convertir le type de cellule", "Convert Cell Type", "Convert Cell Type", "转换单元格类型"]),
+ ("Copy Link(s", ["Copy Link(s", "Copier lien(s", "Copy Link(s", "Copy Link(s", "复制链接("]),
+ (
+ "Create Alternate Layout",
+ ["Create Alternate Layout", "Créer une variante de mise en page", "Create Alternate Layout", "Create Alternate Layout", "创建替代版面"],
+ ),
+ ("Crop Amount", ["Crop Amount", "Valeur de recadrage", "Crop Amount", "Crop Amount", "裁剪量"]),
+ (
+ "Cross-Reference Format",
+ ["Cross-Reference Format", "Format de référence croisée", "Cross-Reference Format", "Cross-Reference Format", "交叉引用格式"],
+ ),
+ ("Delete Workspace", ["Delete Workspace", "Supprimer l'espace de travail", "Delete Workspace", "Delete Workspace", "删除工作区"]),
+ ("DesignCraft", ["DesignCraft", "DesignCraft", "DesignCraft", "DesignCraft", "DesignCraft"]),
+ ("Display Performance", ["Display Performance", "Performances d'affichage", "Display Performance", "Display Performance", "显示性能"]),
+ ("Document Grid", ["Document Grid", "Grille du document", "Document Grid", "Document Grid", "文档网格"]),
+ (
+ "Document Recovery Data",
+ ["Document Recovery Data", "Données de récupération du document", "Document Recovery Data", "Document Recovery Data", "文档恢复数据"],
+ ),
+ ("EPUB and HTML", ["EPUB and HTML", "EPUB et HTML", "EPUB and HTML", "EPUB and HTML", "EPUB 和 HTML"]),
+ ("Export", ["Export", "Exporter", "Export", "Export", "导出"]),
+ (
+ "Export EPUB (Fixed Layout",
+ [
+ "Export EPUB (Fixed Layout",
+ "Exporter en EPUB (mise en page fixe",
+ "Export EPUB (Fixed Layout",
+ "Export EPUB (Fixed Layout",
+ "导出 EPUB (固定版面",
+ ],
+ ),
+ (
+ "Export EPUB (Reflowable",
+ ["Export EPUB (Reflowable", "Exporter en EPUB (redistribuable", "Export EPUB (Reflowable", "Export EPUB (Reflowable", "导出 EPUB (可回流"],
+ ),
+ ("Facing Pages", ["Facing Pages", "Pages en vis-à-vis", "Facing Pages", "Facing Pages", "对页"]),
+ ("GREP Styles", ["GREP Styles", "Styles GREP", "GREP Styles", "GREP Styles", "GREP 样式"]),
+ (
+ "Get help, share your layouts and shape what we build next.",
+ [
+ "Get help, share your layouts and shape what we build next.",
+ "Obtenez de l'aide, partagez vos mises en page et influencez ce que nous construirons ensuite.",
+ "Get help, share your layouts and shape what we build next.",
+ "Get help, share your layouts and shape what we build next.",
+ "获取帮助,分享您的布局,共同塑造我们的未来。",
+ ],
+ ),
+ ("Highlight", ["Highlight", "Surlignage", "Highlight", "Highlight", "高亮显示"]),
+ (
+ "Hyperlinks & Cross-References",
+ [
+ "Hyperlinks & Cross-References",
+ "Hyperliens et références croisées",
+ "Hyperlinks & Cross-References",
+ "Hyperlinks & Cross-References",
+ "超链接和交叉引用",
+ ],
+ ),
+ ("Hyphens and Dashes", ["Hyphens and Dashes", "Traits d'union et tirets", "Hyphens and Dashes", "Hyphens and Dashes", "连字符和破折号"]),
+ ("Interactive", ["Interactive", "Interactif", "Interactive", "Interactive", "交互式"]),
+ ("Invert", ["Invert", "Inverser", "Invert", "Invert", "反相"]),
+ (
+ "Join the ArtCraft community",
+ [
+ "Join the ArtCraft community",
+ "Rejoindre la communauté ArtCraft",
+ "Join the ArtCraft community",
+ "Join the ArtCraft community",
+ "加入 ArtCraft 社区",
+ ],
+ ),
+ ("Keyboard Increments", ["Keyboard Increments", "Incréments au clavier", "Keyboard Increments", "Keyboard Increments", "键盘增量"]),
+ ("Liquid guides", ["Liquid guides", "Repères liquides", "Liquid guides", "Liquid guides", "自适应参考线"]),
+ ("Markers", ["Markers", "Marqueurs", "Markers", "Markers", "标记"]),
+ ("More ArtCraft apps", ["More ArtCraft apps", "Autres applications ArtCraft", "More ArtCraft apps", "More ArtCraft apps", "更多 ArtCraft 应用"]),
+ ("Nested Line Styles", ["Nested Line Styles", "Styles de ligne imbriqués", "Nested Line Styles", "Nested Line Styles", "嵌套行样式"]),
+ ("Nested Styles", ["Nested Styles", "Styles imbriqués", "Nested Styles", "Nested Styles", "嵌套样式"]),
+ (
+ "No articles: exports follow page order.",
+ [
+ "No articles: exports follow page order.",
+ "Aucun article : les exports suivent l'ordre des pages.",
+ "No articles: exports follow page order.",
+ "No articles: exports follow page order.",
+ "没有文章:导出遵循页面顺序。",
+ ],
+ ),
+ ("No book open.", ["No book open.", "Aucun livre ouvert.", "No book open.", "No book open.", "没有打开的书籍。"]),
+ (
+ "No bookmarks. They become the PDF outline.",
+ [
+ "No bookmarks. They become the PDF outline.",
+ "Aucun signet. Ils forment le plan du PDF.",
+ "No bookmarks. They become the PDF outline.",
+ "No bookmarks. They become the PDF outline.",
+ "没有书签。它们将成为 PDF 大纲。",
+ ],
+ ),
+ ("No changes.", ["No changes.", "Aucune modification.", "No changes.", "No changes.", "没有更改。"]),
+ (
+ "No conditions. Create one, then select text and click it to apply.",
+ [
+ "No conditions. Create one, then select text and click it to apply.",
+ "Aucune condition. Créez-en une, puis sélectionnez du texte et cliquez dessus pour l'appliquer.",
+ "No conditions. Create one, then select text and click it to apply.",
+ "No conditions. Create one, then select text and click it to apply.",
+ "没有条件。创建一个条件,然后选择文本并单击以应用。",
+ ],
+ ),
+ ("No document open", ["No document open", "Aucun document ouvert", "No document open", "No document open", "未打开任何文档"]),
+ ("No document.", ["No document.", "Aucun document.", "No document.", "No document.", "没有文档。"]),
+ (
+ "No hyperlinks. Select text or a frame, type a URL and click New.",
+ [
+ "No hyperlinks. Select text or a frame, type a URL and click New.",
+ "Aucun hyperlien. Sélectionnez du texte ou un bloc, saisissez une URL et cliquez sur Nouveau.",
+ "No hyperlinks. Select text or a frame, type a URL and click New.",
+ "No hyperlinks. Select text or a frame, type a URL and click New.",
+ "没有超链接。选择文本或框架,键入 URL,然后单击新建。",
+ ],
+ ),
+ ("No library open.", ["No library open.", "Aucune bibliothèque ouverte.", "No library open.", "No library open.", "没有打开的库。"]),
+ (
+ "No notes in this document.",
+ [
+ "No notes in this document.",
+ "Aucune note dans ce document.",
+ "No notes in this document.",
+ "No notes in this document.",
+ "本文档中没有注释。",
+ ],
+ ),
+ ("No placed graphics.", ["No placed graphics.", "Aucun graphique importé.", "No placed graphics.", "No placed graphics.", "没有置入的图形。"]),
+ (
+ "No scripts. Add one below.",
+ [
+ "No scripts. Add one below.",
+ "Aucun script. Ajoutez-en un ci-dessous.",
+ "No scripts. Add one below.",
+ "No scripts. Add one below.",
+ "没有脚本。在下方添加一个。",
+ ],
+ ),
+ (
+ "No text anchors in this document.",
+ [
+ "No text anchors in this document.",
+ "Aucune ancre de texte dans ce document.",
+ "No text anchors in this document.",
+ "No text anchors in this document.",
+ "本文档中没有文本锚点。",
+ ],
+ ),
+ (
+ "OK changes all: text and paragraph/character styles.",
+ [
+ "OK changes all: text and paragraph/character styles.",
+ "OK modifie tout : texte et styles de paragraphe/caractère.",
+ "OK changes all: text and paragraph/character styles.",
+ "OK changes all: text and paragraph/character styles.",
+ "确定将更改所有:文本和段落/字符样式。",
+ ],
+ ),
+ ("OVERSET", ["OVERSET", "EN EXCÈS", "OVERSET", "OVERSET", "溢流"]),
+ (
+ "Open source. No telemetry.",
+ [
+ "Open source. No telemetry.",
+ "Open source. Aucune télémétrie.",
+ "Open source. No telemetry.",
+ "Open source. No telemetry.",
+ "开源。无遥测。",
+ ],
+ ),
+ ("Options", ["Options", "Options", "Options", "Options", "选项"]),
+ (
+ "Options for Black on RGB and Grayscale Devices",
+ [
+ "Options for Black on RGB and Grayscale Devices",
+ "Options du noir sur les périphériques RVB et en niveaux de gris",
+ "Options for Black on RGB and Grayscale Devices",
+ "Options for Black on RGB and Grayscale Devices",
+ "RGB 和灰度设备上的黑色选项",
+ ],
+ ),
+ ("Other", ["Other", "Autre", "Other", "Other", "其他"]),
+ ("Output", ["Output", "Sortie", "Output", "Output", "输出"]),
+ ("Page Numbering", ["Page Numbering", "Numérotation des pages", "Page Numbering", "Page Numbering", "页码编排"]),
+ (
+ "Page layout for print and screen — fast, open and scriptable.",
+ [
+ "Page layout for print and screen — fast, open and scriptable.",
+ "Mise en page pour l'impression et l'écran : rapide, ouverte, scriptable.",
+ "Page layout for print and screen — fast, open and scriptable.",
+ "Page layout for print and screen — fast, open and scriptable.",
+ "用于打印和屏幕的页面布局——快速、开放且可编写脚本。",
+ ],
+ ),
+ ("Page · PPI", ["Page · PPI", "Page · PPP", "Page · PPI", "Page · PPI", "页面 · PPI"]),
+ (
+ "Part of the ArtCraft suite of open creative tools.",
+ [
+ "Part of the ArtCraft suite of open creative tools.",
+ "Fait partie de la suite ArtCraft d'outils créatifs ouverts.",
+ "Part of the ArtCraft suite of open creative tools.",
+ "Part of the ArtCraft suite of open creative tools.",
+ "ArtCraft 开源创意工具套件的一部分。",
+ ],
+ ),
+ ("Pasteboard Options", ["Pasteboard Options", "Options de la table de montage", "Pasteboard Options", "Pasteboard Options", "粘贴板选项"]),
+ ("Paths", ["Paths", "Tracés", "Paths", "Paths", "路径"]),
+ (
+ "Place the insertion point in a table, or create one.",
+ [
+ "Place the insertion point in a table, or create one.",
+ "Placez le point d'insertion dans un tableau ou créez-en un.",
+ "Place the insertion point in a table, or create one.",
+ "Place the insertion point in a table, or create one.",
+ "将插入点置于表格中,或创建一个表格。",
+ ],
+ ),
+ (
+ "Plays in EPUB export; print and PDF show the poster.",
+ [
+ "Plays in EPUB export; print and PDF show the poster.",
+ "Lu dans l'export EPUB ; l'impression et le PDF montrent l'affiche.",
+ "Plays in EPUB export; print and PDF show the poster.",
+ "Plays in EPUB export; print and PDF show the poster.",
+ "在 EPUB 导出中播放;打印和 PDF 显示海报。",
+ ],
+ ),
+ ("Quotation Marks", ["Quotation Marks", "Guillemets", "Quotation Marks", "Quotation Marks", "引号"]),
+ ("Recently Used", ["Recently Used", "Récemment utilisés", "Recently Used", "Recently Used", "最近使用"]),
+ ("Replace With", ["Replace With", "Remplacer par", "Replace With", "Replace With", "替换为"]),
+ (
+ "Right-click: stroke, groups",
+ [
+ "Right-click: stroke, groups",
+ "Clic droit : contour, groupes",
+ "Right-click: stroke, groups",
+ "Right-click: stroke, groups",
+ "右键单击:描边、组",
+ ],
+ ),
+ ("Ruler Units", ["Ruler Units", "Unités des règles", "Ruler Units", "Ruler Units", "标尺单位"]),
+ ("Origin:", ["Ursprung:", "Origine :", "Origen:", "原点:", "原点:"]),
+ ("Spine", ["Bund", "Dos", "Lomo", "ノド", "书脊"]),
+ ("Lock Zero Point", ["Nullpunkt fixieren", "Verrouiller le point zéro", "Bloquear punto cero", "ゼロ点をロック", "锁定零点"]),
+ ("Unlock Zero Point", ["Nullpunkt lösen", "Déverrouiller le point zéro", "Desbloquear punto cero", "ゼロ点のロックを解除", "解锁零点"]),
+ (
+ "Saves which bars show and where the panels are.",
+ [
+ "Saves which bars show and where the panels are.",
+ "Enregistre les barres affichées et l'emplacement des panneaux.",
+ "Saves which bars show and where the panels are.",
+ "Saves which bars show and where the panels are.",
+ "保存显示哪些栏以及面板所在的位置。",
+ ],
+ ),
+ (
+ "Select a placed video or sound (File › Place a .mp4, .mov, .mp3, .wav …).",
+ [
+ "Select a placed video or sound (File › Place a .mp4, .mov, .mp3, .wav …).",
+ "Sélectionnez une vidéo ou un son importé (Fichier › Importer un .mp4, .mov, .mp3, .wav …).",
+ "Select a placed video or sound (File › Place a .mp4, .mov, .mp3, .wav …).",
+ "Select a placed video or sound (File › Place a .mp4, .mov, .mp3, .wav …).",
+ "选择已置入的视频或声音 (文件 › 置入 .mp4, .mov, .mp3, .wav …)。",
+ ],
+ ),
+ (
+ "Select an object or text to color its fill or stroke.",
+ [
+ "Select an object or text to color its fill or stroke.",
+ "Sélectionnez un objet ou du texte pour colorer son fond ou son contour.",
+ "Select an object or text to color its fill or stroke.",
+ "Select an object or text to color its fill or stroke.",
+ "选择一个对象或文本以设置其填色或描边颜色。",
+ ],
+ ),
+ (
+ "Select an object to give its fill a gradient.",
+ [
+ "Select an object to give its fill a gradient.",
+ "Sélectionnez un objet pour appliquer un dégradé à son fond.",
+ "Select an object to give its fill a gradient.",
+ "Select an object to give its fill a gradient.",
+ "选择一个对象以为其填色应用渐变。",
+ ],
+ ),
+ (
+ "Select an object to make it a button.",
+ [
+ "Select an object to make it a button.",
+ "Sélectionnez un objet pour en faire un bouton.",
+ "Select an object to make it a button.",
+ "Select an object to make it a button.",
+ "选择一个对象使其成为按钮。",
+ ],
+ ),
+ (
+ "Select two or more objects (or a group) to make a multi-state object.",
+ [
+ "Select two or more objects (or a group) to make a multi-state object.",
+ "Sélectionnez au moins deux objets (ou un groupe) pour créer un objet à états multiples.",
+ "Select two or more objects (or a group) to make a multi-state object.",
+ "Select two or more objects (or a group) to make a multi-state object.",
+ "选择两个或多个对象 (或一个组) 以制作多状态对象。",
+ ],
+ ),
+ ("Show", ["Show", "Afficher", "Show", "Show", "显示"]),
+ ("Smart Text Reflow", ["Smart Text Reflow", "Redistribution intelligente du texte", "Smart Text Reflow", "Smart Text Reflow", "智能文本重排"]),
+ ("Spelling", ["Spelling", "Orthographe", "Spelling", "Spelling", "拼写"]),
+ ("Start a new document", ["Start a new document", "Créer un nouveau document", "Start a new document", "Start a new document", "开始新文档"]),
+ ("Status", ["Status", "État", "Status", "Status", "状态"]),
+ ("Style Mapping", ["Style Mapping", "Association de styles", "Style Mapping", "Style Mapping", "样式映射"]),
+ ("Style Name Conflicts", ["Style Name Conflicts", "Conflits de noms de style", "Style Name Conflicts", "Style Name Conflicts", "样式名称冲突"]),
+ ("Symbols", ["Symbols", "Symboles", "Symbols", "Symbols", "符号"]),
+ ("System default", ["System default", "Valeur par défaut du système", "System default", "System default", "系统默认"]),
+ ("Table Dimensions", ["Table Dimensions", "Dimensions du tableau", "Table Dimensions", "Table Dimensions", "表格尺寸"]),
+ (
+ "Text Display Options",
+ ["Text Display Options", "Options d'affichage du texte", "Text Display Options", "Text Display Options", "文本显示选项"],
+ ),
+ (
+ "The fill isn't a gradient.",
+ ["The fill isn't a gradient.", "Le fond n'est pas un dégradé.", "The fill isn't a gradient.", "The fill isn't a gradient.", "填色不是渐变。"],
+ ),
+ (
+ "The library is empty. Select objects and Add Selection.",
+ [
+ "The library is empty. Select objects and Add Selection.",
+ "La bibliothèque est vide. Sélectionnez des objets et utilisez Ajouter la sélection.",
+ "The library is empty. Select objects and Add Selection.",
+ "The library is empty. Select objects and Add Selection.",
+ "库为空。选择对象并添加所选内容。",
+ ],
+ ),
+ (
+ "Transitions play in interactive PDF (full-screen mode).",
+ [
+ "Transitions play in interactive PDF (full-screen mode).",
+ "Les transitions sont lues dans le PDF interactif (mode plein écran).",
+ "Transitions play in interactive PDF (full-screen mode).",
+ "Transitions play in interactive PDF (full-screen mode).",
+ "在交互式 PDF (全屏模式) 中播放过渡。",
+ ],
+ ),
+ ("Type & Tables", ["Type & Tables", "Texte et tableaux", "Type & Tables", "Type & Tables", "文字和表格"]),
+ ("Type Options", ["Type Options", "Options de texte", "Type Options", "Type Options", "文字选项"]),
+ (
+ "Type a word with ~ at each allowed break (ex~am~ple); without ~ the word is never hyphenated.",
+ [
+ "Type a word with ~ at each allowed break (ex~am~ple); without ~ the word is never hyphenated.",
+ "Saisissez un mot avec ~ à chaque coupure autorisée (ex~em~ple) ; sans ~, le mot n'est jamais coupé.",
+ "Type a word with ~ at each allowed break (ex~am~ple); without ~ the word is never hyphenated.",
+ "Type a word with ~ at each allowed break (ex~am~ple); without ~ the word is never hyphenated.",
+ "在每个允许的断字处用 ~ 键入一个单词 (例如 ex~am~ple);如果没有 ~,该单词将永远不会断字。",
+ ],
+ ),
+ (
+ "User Dictionary (this document)",
+ [
+ "User Dictionary (this document)",
+ "Dictionnaire utilisateur (ce document)",
+ "User Dictionary (this document)",
+ "User Dictionary (this document)",
+ "用户词典 (本文档)",
+ ],
+ ),
+ ("Utilities", ["Utilities", "Utilitaires", "Utilities", "Utilities", "实用程序"]),
+ ("Variable Font", ["Variable Font", "Police variable", "Variable Font", "Variable Font", "可变字体"]),
+ (
+ "Welcome to DesignCraft",
+ ["Welcome to DesignCraft", "Bienvenue dans DesignCraft", "Welcome to DesignCraft", "Welcome to DesignCraft", "欢迎使用 DesignCraft"],
+ ),
+ ("When Scaling", ["When Scaling", "Lors du redimensionnement", "When Scaling", "When Scaling", "缩放时"]),
+ ("[Basic] (working) ▾", ["[Basic] (working) ▾", "[De base] (de travail) ▾", "[Basic] (working) ▾", "[Basic] (working) ▾", "[基本] (工作区) ▾"]),
+ ("[Black] Overprint", ["[Black] Overprint", "Surimpression de [Noir]", "[Black] Overprint", "[Black] Overprint", "[黑] 叠印"]),
+ ("[No Group]", ["[No Group]", "[Aucun groupe]", "[No Group]", "[No Group]", "[无组]"]),
+ ("[None]", ["[None]", "[Aucun]", "[None]", "[None]", "[无]"]),
+ (
+ "[None] — choose a colour on the ramp.",
+ [
+ "[None] — choose a colour on the ramp.",
+ "[Aucun] : choisissez une couleur sur le spectre.",
+ "[None] — choose a colour on the ramp.",
+ "[None] — choose a colour on the ramp.",
+ "[无] — 在色带上选择一种颜色。",
+ ],
+ ),
+ (
+ "discord.gg/artcraft — help, feedback and show-and-tell",
+ [
+ "discord.gg/artcraft — help, feedback and show-and-tell",
+ "discord.gg/artcraft : aide, retours et présentation de vos créations",
+ "discord.gg/artcraft — help, feedback and show-and-tell",
+ "discord.gg/artcraft — help, feedback and show-and-tell",
+ "discord.gg/artcraft — 帮助、反馈和展示",
+ ],
+ ),
+ (
+ "⌥-click clears overrides",
+ ["⌥-click clears overrides", "⌥-clic efface les remplacements", "⌥-click clears overrides", "⌥-click clears overrides", "⌥-单击清除覆盖"],
+ ),
+ (
+ "Alt-click clears overrides",
+ [
+ "Alt-Klick entfernt Abweichungen",
+ "Alt-clic efface les remplacements",
+ "Alt-clic borra las modificaciones",
+ "Alt を押しながらクリックするとオーバーライドを消去します",
+ "Alt-单击清除覆盖",
+ ],
+ ),
+ (
+ "Apply \"{name}\", Clear Overrides",
+ [
+ "„{name}“ anwenden, Abweichungen löschen",
+ "Appliquer « {name} », effacer les remplacements",
+ "Aplicar \"{name}\", borrar modificaciones",
+ "\"{name}\" を適用、オーバーライドを消去",
+ "应用\"{name}\",清除覆盖",
+ ],
+ ),
+ ("⚠ out of date", ["⚠ out of date", "⚠ obsolète", "⚠ out of date", "⚠ out of date", "⚠ 已过期"]),
+ ("General", ["General", "Général", "General", "General", "常规"]),
+ (
+ "Basic Character Formats",
+ ["Basic Character Formats", "Formats de caractère de base", "Basic Character Formats", "Basic Character Formats", "基本字符格式"],
+ ),
+ ("Indents and Spacing", ["Indents and Spacing", "Retraits et espacement", "Indents and Spacing", "Indents and Spacing", "缩进和间距"]),
+ ("Hyphenation", ["Hyphenation", "Césure", "Hyphenation", "Hyphenation", "断字"]),
+ ("Justification", ["Blocksatzeinstellungen", "Justification", "Justificación", "両端揃え", "两端对齐"]),
+ (
+ "Drop Caps and Nested Styles",
+ [
+ "Drop Caps and Nested Styles",
+ "Lettrines et styles imbriqués",
+ "Drop Caps and Nested Styles",
+ "Drop Caps and Nested Styles",
+ "首字下沉和嵌套样式",
+ ],
+ ),
+ ("GREP Style", ["GREP Style", "Style GREP", "GREP Style", "GREP Style", "GREP 样式"]),
+ ("Character Color", ["Character Color", "Couleur du caractère", "Character Color", "Character Color", "字符颜色"]),
+ (
+ "Numbering and Formatting",
+ ["Numbering and Formatting", "Numérotation et mise en forme", "Numbering and Formatting", "Numbering and Formatting", "编号和格式"],
+ ),
+ ("Spacing Options", ["Spacing Options", "Options d'espacement", "Spacing Options", "Spacing Options", "间距选项"]),
+ ("First Baseline", ["First Baseline", "Première ligne de base", "First Baseline", "First Baseline", "首行基线"]),
+ ("Rule Above", ["Rule Above", "Filet au-dessus", "Rule Above", "Rule Above", "上方横线"]),
+ ("Numbering", ["Numbering", "Numérotation", "Numbering", "Numbering", "编号"]),
+ (
+ "Footnote Reference Number in Text",
+ [
+ "Footnote Reference Number in Text",
+ "Numéro de référence de note de bas de page dans le texte",
+ "Footnote Reference Number in Text",
+ "Footnote Reference Number in Text",
+ "正文中的脚注引用编号",
+ ],
+ ),
+ (
+ "Footnote Formatting",
+ ["Footnote Formatting", "Mise en forme des notes de bas de page", "Footnote Formatting", "Footnote Formatting", "脚注格式"],
+ ),
+ (
+ "Span Footnotes Across Columns",
+ [
+ "Span Footnotes Across Columns",
+ "Étendre les notes de bas de page sur toutes les colonnes",
+ "Span Footnotes Across Columns",
+ "Span Footnotes Across Columns",
+ "跨栏分布脚注",
+ ],
+ ),
+ ("Rule On", ["Rule On", "Filet activé", "Rule On", "Rule On", "启用横线"]),
+ ("Ascent", ["Ascent", "Ascendante", "Ascent", "Ascent", "上升高度"]),
+ ("Cap Height", ["Cap Height", "Hauteur de capitale", "Cap Height", "Cap Height", "大写字母高度"]),
+ ("Leading", ["Leading", "Interligne", "Leading", "Leading", "行距"]),
+ ("x Height", ["x Height", "Hauteur d'x", "x Height", "x Height", "x 字高"]),
+ ("Em Box Height", ["Em Box Height", "Hauteur du cadratin", "Em Box Height", "Em Box Height", "全角字框高度"]),
+ ("Fixed", ["Fixed", "Fixe", "Fixed", "Fixed", "固定"]),
+ ("Never (continuous)", ["Never (continuous)", "Jamais (continu)", "Never (continuous)", "Never (continuous)", "从不(连续编号)"]),
+ ("Page", ["Page", "Page", "Page", "Page", "页面"]),
+ ("Spread", ["Spread", "Planche", "Spread", "Spread", "跨页"]),
+ ("Section", ["Section", "Section", "Section", "Section", "章节"]),
+ ("Footnote Reference", ["Footnote Reference", "Référence de note de bas de page", "Footnote Reference", "Footnote Reference", "脚注引用"]),
+ ("Footnote Text", ["Footnote Text", "Texte de la note de bas de page", "Footnote Text", "Footnote Text", "脚注文本"]),
+ ("Both", ["Both", "Les deux", "Both", "Both", "两者"]),
+ ("Apply Superscript", ["Apply Superscript", "Appliquer l'exposant", "Apply Superscript", "Apply Superscript", "应用上标"]),
+ ("Apply Subscript", ["Apply Subscript", "Appliquer l'indice", "Apply Subscript", "Apply Subscript", "应用下标"]),
+ ("Apply Normal", ["Apply Normal", "Appliquer Normal", "Apply Normal", "Apply Normal", "应用正常位置"]),
+ ("OpenType Superscript", ["OpenType Superscript", "Exposant OpenType", "OpenType Superscript", "OpenType Superscript", "OpenType 上标"]),
+ ("through", ["through", "sur", "through", "through", "直到(包含)"]),
+ ("up to", ["up to", "jusqu'à", "up to", "up to", "直到(不包含)"]),
+ ("line", ["line", "ligne", "line", "line", "行"]),
+ ("lines", ["lines", "lignes", "lines", "lines", "行"]),
+ ("sentences", ["sentences", "phrases", "sentences", "sentences", "句子"]),
+ ("words", ["words", "mots", "words", "words", "单词"]),
+ ("characters", ["characters", "caractères", "characters", "characters", "字符"]),
+ ("letters", ["letters", "lettres", "letters", "letters", "字母"]),
+ ("digits", ["digits", "chiffres", "digits", "digits", "数字"]),
+ ("tab", ["tab", "tabulation", "tab", "tab", "制表符"]),
+ ("forcedLineBreak", ["forcedLineBreak", "saut de ligne forcé", "forcedLineBreak", "forcedLineBreak", "强制换行符"]),
+ ("emSpace", ["emSpace", "espace cadratin", "emSpace", "emSpace", "全角空格"]),
+ ("enSpace", ["enSpace", "espace demi-cadratin", "enSpace", "enSpace", "半角空格"]),
+ ("dropcap", ["Initiale", "lettrine", "capitular", "ドロップキャップ", "首字下沉"]),
+ ("Drop Caps", ["Initialen", "Lettrines", "Capitulares", "ドロップキャップ", "首字下沉"]),
+ ("Lines:", ["Zeilen:", "Lignes :", "Líneas:", "行数:", "行数:"]),
+ ("Characters:", ["Zeichen:", "Caractères :", "Caracteres:", "文字数:", "字符数:"]),
+ ("Drop Lines", ["Initialzeilen", "Lignes lettrine", "Líneas capitular", "ドロップ行数", "下沉行数"]),
+ ("Drop Chars", ["Initialzeichen", "Car. lettrine", "Car. capitular", "ドロップ文字数", "下沉字符数"]),
+ ("Align Left Edge", ["Linke Kante ausrichten", "Aligner le bord gauche", "Alinear borde izquierdo", "左端揃え", "左边缘对齐"]),
+ (
+ "Scale for Descenders",
+ [
+ "Für Unterlängen skalieren",
+ "Mise à l'échelle pour les jambages",
+ "Escalar para trazos descendentes",
+ "ディセンダーに合わせて拡大・縮小",
+ "为下伸部分缩放",
+ ],
+ ),
+ ("chars", ["chars", "caractères saisis", "chars", "chars", "指定字符"]),
+ ("[Automatic]", ["[Automatic]", "[Automatique]", "[Automatic]", "[Automatic]", "[自动]"]),
+ ("Tracking:", ["Tracking:", "Approche :", "Tracking:", "Tracking:", "字距调整:"]),
+ ("Right Indent:", ["Right Indent:", "Retrait à droite :", "Right Indent:", "Right Indent:", "右缩进:"]),
+ ("First Line Indent:", ["First Line Indent:", "Retrait de première ligne :", "First Line Indent:", "First Line Indent:", "首行缩进:"]),
+ ("Space Before:", ["Space Before:", "Espace avant :", "Space Before:", "Space Before:", "段前间距:"]),
+ ("Space After:", ["Space After:", "Espace après :", "Space After:", "Space After:", "段后间距:"]),
+ ("Words with at Least:", ["Words with at Least:", "Mots d'au moins :", "Words with at Least:", "Words with at Least:", "单词最少字符数:"]),
+ ("After First:", ["After First:", "Après les premières :", "After First:", "After First:", "连字符前最少字符数:"]),
+ ("Before Last:", ["Before Last:", "Avant les dernières :", "Before Last:", "Before Last:", "连字符后最少字符数:"]),
+ ("Hyphen Limit:", ["Hyphen Limit:", "Limite de césure :", "Hyphen Limit:", "Hyphen Limit:", "连字符限制:"]),
+ ("Word Spacing:", ["Word Spacing:", "Espacement des mots :", "Word Spacing:", "Word Spacing:", "单词间距:"]),
+ ("Letter Spacing:", ["Letter Spacing:", "Espacement des lettres :", "Letter Spacing:", "Letter Spacing:", "字母间距:"]),
+ ("Glyph Scaling:", ["Glyph Scaling:", "Échelle des glyphes :", "Glyph Scaling:", "Glyph Scaling:", "字形缩放比例:"]),
+ ("Insert Kashidas:", ["Insert Kashidas:", "Insérer des kashidas :", "Insert Kashidas:", "Insert Kashidas:", "插入延长线:"]),
+ (
+ "In justified Arabic text",
+ [
+ "In justified Arabic text",
+ "Dans le texte arabe justifié",
+ "In justified Arabic text",
+ "In justified Arabic text",
+ "在两端对齐的阿拉伯语文本中",
+ ],
+ ),
+ ("Korean Line Breaks:", ["Korean Line Breaks:", "Retours à la ligne en coréen :", "Korean Line Breaks:", "Korean Line Breaks:", "韩文换行:"]),
+ (
+ "Between syllables (not only at spaces)",
+ [
+ "Between syllables (not only at spaces)",
+ "Entre les syllabes (pas seulement aux espaces)",
+ "Between syllables (not only at spaces)",
+ "Between syllables (not only at spaces)",
+ "在音节之间(不仅在空格处)",
+ ],
+ ),
+ ("Binding:", ["Binding:", "Reliure :", "Binding:", "Binding:", "装订方向:"]),
+ ("Ruby:", ["Ruby:", "Ruby :", "Ruby:", "Ruby:", "旁注:"]),
+ (
+ "Set over the selected text; empty removes it.",
+ [
+ "Set over the selected text; empty removes it.",
+ "Composé au-dessus du texte sélectionné ; vide, il est supprimé.",
+ "Set over the selected text; empty removes it.",
+ "Set over the selected text; empty removes it.",
+ "在所选文本上方添加注音;留空可移除。",
+ ],
+ ),
+ ("[Basic Paragraph]", ["[Basic Paragraph]", "[Paragraphe standard]", "[Basic Paragraph]", "[Basic Paragraph]", "[基本段落]"]),
+ ("[No Paragraph Style]", ["[No Paragraph Style]", "[Aucun style de paragraphe]", "[No Paragraph Style]", "[No Paragraph Style]", "[无段落样式]"]),
+ ("Align left", ["Align left", "Aligner à gauche", "Align left", "Align left", "左对齐"]),
+ ("Align center", ["Align center", "Aligner au centre", "Align center", "Align center", "居中对齐"]),
+ ("Align right", ["Align right", "Aligner à droite", "Align right", "Align right", "右对齐"]),
+ (
+ "Justify with last line aligned left",
+ [
+ "Justify with last line aligned left",
+ "Justifier avec dernière ligne alignée à gauche",
+ "Justify with last line aligned left",
+ "Justify with last line aligned left",
+ "两端对齐,末行左对齐",
+ ],
+ ),
+ (
+ "Justify with last line aligned center",
+ [
+ "Justify with last line aligned center",
+ "Justifier avec dernière ligne centrée",
+ "Justify with last line aligned center",
+ "Justify with last line aligned center",
+ "两端对齐,末行居中",
+ ],
+ ),
+ (
+ "Justify with last line aligned right",
+ [
+ "Justify with last line aligned right",
+ "Justifier avec dernière ligne alignée à droite",
+ "Justify with last line aligned right",
+ "Justify with last line aligned right",
+ "两端对齐,末行右对齐",
+ ],
+ ),
+ ("Justify all lines", ["Justify all lines", "Justifier toutes les lignes", "Justify all lines", "Justify all lines", "所有行两端对齐"]),
+ ("Align towards spine", ["Align towards spine", "Aligner vers le dos", "Align towards spine", "Align towards spine", "朝向书脊对齐"]),
+ (
+ "Align away from spine",
+ ["Align away from spine", "Aligner à l'opposé du dos", "Align away from spine", "Align away from spine", "背向书脊对齐"],
+ ),
+ (
+ "Create New Style from Selection",
+ [
+ "Create New Style from Selection",
+ "Créer un style à partir de la sélection",
+ "Create New Style from Selection",
+ "Create New Style from Selection",
+ "从所选内容创建新样式",
+ ],
+ ),
+ ("No text selected", ["No text selected", "Aucun texte sélectionné", "No text selected", "No text selected", "未选择文本"]),
+ ("Search", ["Suchen", "Rechercher", "Buscar", "Search", "搜索"]),
+ ("Essentials", ["Essentials", "Les indispensables", "Essentials", "Essentials", "基本功能"]),
+ ("Advanced", ["Advanced", "Avancé", "Advanced", "Advanced", "高级"]),
+ ("Digital Publishing", ["Digital Publishing", "Publication numérique", "Digital Publishing", "Digital Publishing", "数字出版"]),
+ ("Interactive for PDF", ["Interactive for PDF", "PDF interactif", "Interactive for PDF", "Interactive for PDF", "PDF 交互"]),
+ ("Printing and Proofing", ["Printing and Proofing", "Impression et épreuvage", "Printing and Proofing", "Printing and Proofing", "打印和校样"]),
+ ("Typography", ["Typography", "Typographie", "Typography", "Typography", "文字排版"]),
+ ("Rulers & Grids", ["Rulers & Grids", "Règles et grilles", "Rulers & Grids", "Rulers & Grids", "标尺和网格"]),
+ ("No errors", ["No errors", "Aucune erreur", "No errors", "No errors", "无错误"]),
+ ("error", ["error", "erreur", "error", "error", "个错误"]),
+ ("errors", ["errors", "erreurs", "errors", "errors", "个错误"]),
+ ("Reset", ["Reset", "Réinitialiser", "Reset", "Reset", "重置"]),
+ ("Right to Left", ["Right to Left", "De droite à gauche", "Right to Left", "Right to Left", "从右向左"]),
+ ("Left to Right", ["Left to Right", "De gauche à droite", "Left to Right", "Left to Right", "从左向右"]),
+ ("Portrait", ["Portrait", "Portrait", "Portrait", "Portrait", "纵向"]),
+ ("Landscape", ["Landscape", "Paysage", "Landscape", "Landscape", "横向"]),
+ (
+ "Display All Blacks as Rich Black",
+ [
+ "Display All Blacks as Rich Black",
+ "Afficher tous les noirs en noir intense",
+ "Display All Blacks as Rich Black",
+ "Display All Blacks as Rich Black",
+ "所有黑色显示为浓黑",
+ ],
+ ),
+ (
+ "Display All Blacks Accurately",
+ [
+ "Display All Blacks Accurately",
+ "Afficher tous les noirs avec précision",
+ "Display All Blacks Accurately",
+ "Display All Blacks Accurately",
+ "准确显示所有黑色",
+ ],
+ ),
+ (
+ "Output All Blacks as Rich Black",
+ [
+ "Output All Blacks as Rich Black",
+ "Sortir tous les noirs en noir intense",
+ "Output All Blacks as Rich Black",
+ "Output All Blacks as Rich Black",
+ "所有黑色输出为浓黑",
+ ],
+ ),
+ (
+ "Output All Blacks Accurately",
+ [
+ "Output All Blacks Accurately",
+ "Sortir tous les noirs avec précision",
+ "Output All Blacks Accurately",
+ "Output All Blacks Accurately",
+ "准确输出所有黑色",
+ ],
+ ),
+ ("Top Margin", ["Top Margin", "Marge supérieure", "Top Margin", "Top Margin", "上边距"]),
+ ("Top of Page", ["Top of Page", "Haut de la page", "Top of Page", "Top of Page", "页面顶部"]),
+ (
+ "Paragraph Styles panel",
+ ["Paragraph Styles panel", "Panneau Styles de paragraphe", "Paragraph Styles panel", "Paragraph Styles panel", "段落样式面板"],
+ ),
+ (
+ "Character Styles panel",
+ ["Character Styles panel", "Panneau Styles de caractère", "Character Styles panel", "Character Styles panel", "字符样式面板"],
+ ),
+ ("Create new style", ["Create new style", "Créer un style", "Create new style", "Create new style", "创建新样式"]),
+ ("Clear overrides", ["Clear overrides", "Effacer les remplacements", "Clear overrides", "Clear overrides", "清除覆盖"]),
+ ("Apply", ["Apply", "Appliquer", "Apply", "Apply", "应用"]),
+ ("Accept", ["Accept", "Accepter", "Accept", "Accept", "接受"]),
+ ("Reject", ["Reject", "Refuser", "Reject", "Reject", "拒绝"]),
+ ("Add Selection", ["Add Selection", "Ajouter la sélection", "Add Selection", "Add Selection", "添加所选内容"]),
+ ("Align Stroke:", ["Align Stroke:", "Aligner le contour :", "Align Stroke:", "Align Stroke:", "描边对齐:"]),
+ ("Angle", ["Angle", "Angle", "Angle", "Angle", "角度"]),
+ ("Angle:", ["Angle:", "Angle :", "Angle:", "Angle:", "角度:"]),
+ ("Baseline", ["Baseline", "Ligne de base", "Baseline", "Baseline", "基线"]),
+ ("Cap:", ["Cap:", "Extrémité :", "Cap:", "Cap:", "端点:"]),
+ ("Cell Text", ["Cell Text", "Texte de la cellule", "Cell Text", "Cell Text", "单元格文本"]),
+ ("Cell Type", ["Cell Type", "Type de cellule", "Cell Type", "Cell Type", "单元格类型"]),
+ ("Composer", ["Composer", "Compositeur", "Composer", "Composer", "排版器"]),
+ ("Convert to Text", ["Convert to Text", "Convertir en texte", "Convert to Text", "Convert to Text", "转换为文本"]),
+ ("Create New Layer", ["Create New Layer", "Créer un calque", "Create New Layer", "Create New Layer", "创建新图层"]),
+ ("Delete DTD", ["Delete DTD", "Supprimer la DTD", "Delete DTD", "Delete DTD", "删除 DTD"]),
+ ("Digits", ["Digits", "Chiffres", "Digits", "Digits", "数字"]),
+ ("Direction", ["Direction", "Direction", "Direction", "Direction", "方向"]),
+ ("Distance", ["Distance", "Distance", "Distance", "Distance", "距离"]),
+ ("Distribute ↔", ["Distribute ↔", "Répartir ↔", "Distribute ↔", "Distribute ↔", "水平分布"]),
+ ("Distribute ↕", ["Distribute ↕", "Répartir ↕", "Distribute ↕", "Distribute ↕", "垂直分布"]),
+ ("Effects: Drop Shadow", ["Effects: Drop Shadow", "Effets : ombre portée", "Effects: Drop Shadow", "Effects: Drop Shadow", "效果:投影"]),
+ ("Favorites", ["Favorites", "Favoris", "Favorites", "Favorites", "收藏"]),
+ ("First Spread", ["First Spread", "Première planche", "First Spread", "First Spread", "第一个跨页"]),
+ ("Gap Color:", ["Gap Color:", "Couleur de l'espace :", "Gap Color:", "Gap Color:", "间隙颜色:"]),
+ ("Graphic…", ["Graphic…", "Graphique…", "Graphic…", "Graphic…", "图形…"]),
+ ("Home", ["Home", "Accueil", "Home", "Home", "主页"]),
+ ("Join:", ["Join:", "Sommet :", "Join:", "Join:", "连接:"]),
+ ("Language", ["Sprache", "Langue", "Idioma", "言語", "语言"]),
+ ("Last Spread", ["Last Spread", "Dernière planche", "Last Spread", "Last Spread", "最后一个跨页"]),
+ ("Load DTD…", ["Load DTD…", "Charger la DTD…", "Load DTD…", "Load DTD…", "载入 DTD…"]),
+ ("Location:", ["Location:", "Emplacement :", "Location:", "Location:", "位置:"]),
+ (
+ "Lock Column Guides",
+ ["Spaltenhilfslinien sperren", "Verrouiller les repères de colonne", "Bloquear guías de columna", "列ガイドをロック", "锁定栏参考线"],
+ ),
+ ("Lock Guides", ["Lock Guides", "Verrouiller les repères", "Lock Guides", "Lock Guides", "锁定参考线"]),
+ ("Miter Limit:", ["Miter Limit:", "Limite de pointe :", "Miter Limit:", "Miter Limit:", "斜接限制:"]),
+ (
+ "New Article from Selection",
+ [
+ "New Article from Selection",
+ "Nouvel article à partir de la sélection",
+ "New Article from Selection",
+ "New Article from Selection",
+ "从所选内容新建文章",
+ ],
+ ),
+ ("New Note at Cursor", ["New Note at Cursor", "Nouvelle note au curseur", "New Note at Cursor", "New Note at Cursor", "在光标处新建附注"]),
+ ("New Swatch", ["New Swatch", "Nouvelle nuance", "New Swatch", "New Swatch", "新建色板"]),
+ ("New condition name", ["New condition name", "Nom de la nouvelle condition", "New condition name", "New condition name", "新条件名称"]),
+ ("New group…", ["New group…", "Nouveau groupe…", "New group…", "New group…", "新建组…"]),
+ ("New tag", ["New tag", "Nouvelle balise", "New tag", "New tag", "新建标签"]),
+ ("Next Spread", ["Next Spread", "Planche suivante", "Next Spread", "Next Spread", "下一个跨页"]),
+ ("Note text", ["Note text", "Texte de la note", "Note text", "Note text", "附注文本"]),
+ ("Offset", ["Offset", "Décalage", "Offset", "Offset", "偏移"]),
+ ("Offsets", ["Offsets", "Décalages", "Offsets", "Offsets", "偏移量"]),
+ ("Paragraph alignment", ["Paragraph alignment", "Alignement du paragraphe", "Paragraph alignment", "Paragraph alignment", "段落对齐"]),
+ ("Previous Spread", ["Previous Spread", "Planche précédente", "Previous Spread", "Previous Spread", "上一个跨页"]),
+ ("Release to Objects", ["Release to Objects", "Libérer en objets", "Release to Objects", "Release to Objects", "释放为对象"]),
+ ("Remove", ["Remove", "Retirer", "Remove", "Remove", "移除"]),
+ (
+ "Rotate 90° Counterclockwise",
+ [
+ "Rotate 90° Counterclockwise",
+ "Rotation de 90° dans le sens antihoraire",
+ "Rotate 90° Counterclockwise",
+ "Rotate 90° Counterclockwise",
+ "逆时针旋转 90°",
+ ],
+ ),
+ ("Rotate 180°", ["180° drehen", "Rotation à 180°", "Girar 180°", "180°回転", "旋转 180°"]),
+ ("Rotation Angle", ["Rotation Angle", "Angle de rotation", "Rotation Angle", "Rotation Angle", "旋转角度"]),
+ ("Rows", ["Rows", "Lignes", "Rows", "Rows", "行数"]),
+ ("Run", ["Run", "Exécuter", "Run", "Run", "运行"]),
+ ("Scale X Percentage", ["Scale X Percentage", "Échelle X en pourcentage", "Scale X Percentage", "Scale X Percentage", "水平缩放百分比"]),
+ ("Scale Y Percentage", ["Scale Y Percentage", "Échelle Y en pourcentage", "Scale Y Percentage", "Scale Y Percentage", "垂直缩放百分比"]),
+ ("Search commands", ["Befehle suchen", "Rechercher des commandes", "Buscar comandos", "Search commands", "搜索命令"]),
+ (
+ "No matching commands",
+ ["Keine passenden Befehle", "Aucune commande correspondante", "Ningún comando coincide", "一致するコマンドはありません", "没有匹配的命令"],
+ ),
+ ("Search fonts", ["Search fonts", "Rechercher des polices", "Search fonts", "Search fonts", "搜索字体"]),
+ (
+ "Search styles and commands…",
+ [
+ "Search styles and commands…",
+ "Rechercher des styles et des commandes…",
+ "Search styles and commands…",
+ "Search styles and commands…",
+ "搜索样式和命令…",
+ ],
+ ),
+ (
+ "Search: character or U+code",
+ [
+ "Search: character or U+code",
+ "Rechercher : caractère ou code U+",
+ "Search: character or U+code",
+ "Search: character or U+code",
+ "搜索字符或 U+ 编码",
+ ],
+ ),
+ ("Share", ["Share", "Partager", "Share", "Share", "分享"]),
+ ("Shear X Angle", ["Shear X Angle", "Angle de déformation X", "Shear X Angle", "Shear X Angle", "水平倾斜角度"]),
+ ("Show Baseline Grid", ["Show Baseline Grid", "Afficher la grille de ligne de base", "Show Baseline Grid", "Show Baseline Grid", "显示基线网格"]),
+ ("Show Document Grid", ["Show Document Grid", "Afficher la grille du document", "Show Document Grid", "Show Document Grid", "显示文档网格"]),
+ ("Show Guides", ["Show Guides", "Afficher les repères", "Show Guides", "Show Guides", "显示参考线"]),
+ ("Stop Color:", ["Stop Color:", "Couleur d'arrêt :", "Stop Color:", "Stop Color:", "停止点颜色:"]),
+ ("Style", ["Style", "Style", "Style", "Style", "样式"]),
+ ("Styles panel", ["Styles panel", "Panneau Styles", "Styles panel", "Styles panel", "样式面板"]),
+ ("Text", ["Text", "Texte", "Text", "Text", "文本"]),
+ (
+ "The structure is valid.",
+ ["The structure is valid.", "La structure est valide.", "The structure is valid.", "The structure is valid.", "结构有效。"],
+ ),
+ ("Toggle double column", ["Toggle double column", "Basculer en double colonne", "Toggle double column", "Toggle double column", "切换双列布局"]),
+ ("Tracking", ["Tracking", "Approche", "Tracking", "Tracking", "字距调整"]),
+ ("Untag Selection", ["Untag Selection", "Retirer la balise de la sélection", "Untag Selection", "Untag Selection", "移除所选内容的标签"]),
+ ("Validate", ["Validate", "Valider", "Validate", "Validate", "验证"]),
+ ("Weight", ["Weight", "Épaisseur", "Weight", "Weight", "粗细"]),
+ ("Subtract", ["Subtract", "Soustraire", "Subtract", "Subtract", "减去"]),
+ ("Intersect", ["Intersect", "Intersection", "Intersect", "Intersect", "交集"]),
+ ("Exclude Overlap", ["Exclude Overlap", "Exclure le chevauchement", "Exclude Overlap", "Exclude Overlap", "排除重叠"]),
+ ("Minus Back", ["Minus Back", "Soustraire l'arrière", "Minus Back", "Minus Back", "减去后方对象"]),
+ ("Align left edges", ["Align left edges", "Aligner les bords gauches", "Align left edges", "Align left edges", "左边缘对齐"]),
+ (
+ "Align horizontal centers",
+ ["Align horizontal centers", "Aligner les centres horizontaux", "Align horizontal centers", "Align horizontal centers", "水平居中对齐"],
+ ),
+ ("Align right edges", ["Align right edges", "Aligner les bords droits", "Align right edges", "Align right edges", "右边缘对齐"]),
+ ("Align top edges", ["Align top edges", "Aligner les bords supérieurs", "Align top edges", "Align top edges", "顶边缘对齐"]),
+ (
+ "Align vertical centers",
+ ["Align vertical centers", "Aligner les centres verticaux", "Align vertical centers", "Align vertical centers", "垂直居中对齐"],
+ ),
+ ("Align bottom edges", ["Align bottom edges", "Aligner les bords inférieurs", "Align bottom edges", "Align bottom edges", "底边缘对齐"]),
+ ("Align to Selection", ["Align to Selection", "Aligner sur la sélection", "Align to Selection", "Align to Selection", "对齐到所选对象"]),
+ ("Align to Key Object", ["Align to Key Object", "Aligner sur l'objet clé", "Align to Key Object", "Align to Key Object", "对齐到关键对象"]),
+ ("Align to Margins", ["Align to Margins", "Aligner sur les marges", "Align to Margins", "Align to Margins", "对齐到边距"]),
+ ("Align to Page", ["Align to Page", "Aligner sur la page", "Align to Page", "Align to Page", "对齐到页面"]),
+ ("Align to Spread", ["Align to Spread", "Aligner sur la planche", "Align to Spread", "Align to Spread", "对齐到跨页"]),
+ ("No Text Wrap", ["No Text Wrap", "Sans habillage", "No Text Wrap", "No Text Wrap", "无文本绕排"]),
+ (
+ "Wrap Around Bounding Box",
+ ["Wrap Around Bounding Box", "Habiller le cadre de sélection", "Wrap Around Bounding Box", "Wrap Around Bounding Box", "绕排定界框"],
+ ),
+ (
+ "Wrap Around Object Shape",
+ ["Wrap Around Object Shape", "Habiller la forme de l'objet", "Wrap Around Object Shape", "Wrap Around Object Shape", "绕排对象形状"],
+ ),
+ ("Jump Object", ["Jump Object", "Sauter l'objet", "Jump Object", "Jump Object", "跳过对象"]),
+ ("Jump to Next Column", ["Jump to Next Column", "Sauter à la colonne suivante", "Jump to Next Column", "Jump to Next Column", "跳至下一栏"]),
+ ("Bulleted List", ["Bulleted List", "Liste à puces", "Bulleted List", "Bulleted List", "项目符号列表"]),
+ ("Numbered List", ["Numbered List", "Liste numérotée", "Numbered List", "Numbered List", "编号列表"]),
+ ("UPPERCASE", ["UPPERCASE", "MAJUSCULES", "UPPERCASE", "UPPERCASE", "大写"]),
+ ("Small Caps", ["Small Caps", "Petites capitales", "Small Caps", "Small Caps", "小型大写字母"]),
+ ("Normal", ["Normal", "Normal", "Normal", "Normal", "正常"]),
+ ("Butt", ["Butt", "Aboutée", "Butt", "Butt", "平头"]),
+ ("Round", ["Round", "Arrondie", "Round", "Round", "圆形"]),
+ ("Projecting", ["Projecting", "Projetée", "Projecting", "Projecting", "突出"]),
+ ("Miter", ["Miter", "En pointe", "Miter", "Miter", "斜接"]),
+ ("Bevel", ["Bevel", "Biseau", "Bevel", "Bevel", "斜角"]),
+ ("Center", ["Center", "Centre", "Center", "Center", "居中"]),
+ ("Start/End:", ["Start/End:", "Début/Fin :", "Start/End:", "Start/End:", "起点/终点:"]),
+ ("Left", ["Left", "Gauche", "Left", "Left", "左"]),
+ ("Right", ["Right", "Droite", "Right", "Right", "右"]),
+ ("First", ["First", "Premier", "First", "First", "首行"]),
+ ("Last", ["Last", "Dernier", "Last", "Last", "末行"]),
+ ("Before", ["Before", "Avant", "Before", "Before", "段前"]),
+ ("After", ["After", "Après", "After", "After", "段后"]),
+ ("Shading", ["Shading", "Tramage", "Shading", "Shading", "底纹"]),
+ ("Border", ["Border", "Bordure", "Border", "Border", "边框"]),
+ ("Overprint Fill", ["Overprint Fill", "Surimpression du fond", "Overprint Fill", "Overprint Fill", "叠印填色"]),
+ ("Overprint Stroke", ["Overprint Stroke", "Surimpression du contour", "Overprint Stroke", "Overprint Stroke", "叠印描边"]),
+ ("Overprint Gap", ["Overprint Gap", "Surimpression de l'espace", "Overprint Gap", "Overprint Gap", "叠印间隙"]),
+ ("Nonprinting", ["Nonprinting", "Non imprimable", "Nonprinting", "Nonprinting", "非打印"]),
+ ("At Least", ["At Least", "Au moins", "At Least", "At Least", "至少"]),
+ ("Exactly", ["Exactly", "Exactement", "Exactly", "Exactly", "固定"]),
+ ("Justify", ["Justify", "Justifier", "Justify", "Justify", "两端对齐"]),
+ ("Underline Options", ["Underline Options", "Options de soulignement", "Underline Options", "Underline Options", "下划线选项"]),
+ ("Strikethrough Options", ["Strikethrough Options", "Options de barré", "Strikethrough Options", "Strikethrough Options", "删除线选项"]),
+ (
+ "Character Style Options",
+ ["Character Style Options", "Options de style de caractère", "Character Style Options", "Character Style Options", "字符样式选项"],
+ ),
+ (
+ "Advanced Character Formats",
+ ["Advanced Character Formats", "Formats de caractère avancés", "Advanced Character Formats", "Advanced Character Formats", "高级字符格式"],
+ ),
+ ("OpenType Features", ["OpenType Features", "Fonctions OpenType", "OpenType Features", "OpenType Features", "OpenType 功能"]),
+ ("Style Settings:", ["Style Settings:", "Paramètres du style :", "Style Settings:", "Style Settings:", "样式设置:"]),
+ ("Kerning:", ["Kerning:", "Crénage :", "Kerning:", "Kerning:", "字偶间距:"]),
+ ("Case:", ["Case:", "Casse :", "Case:", "Case:", "大小写:"]),
+ (
+ "OpenType All Small Caps",
+ [
+ "OpenType All Small Caps",
+ "Tout en petites capitales OpenType",
+ "OpenType All Small Caps",
+ "OpenType All Small Caps",
+ "OpenType 全部小型大写字母",
+ ],
+ ),
+ ("Subscript", ["Subscript", "Indice", "Subscript", "Subscript", "下标"]),
+ ("OpenType Subscript", ["OpenType Subscript", "Indice OpenType", "OpenType Subscript", "OpenType Subscript", "OpenType 下标"]),
+ ("OpenType Numerator", ["OpenType Numerator", "Numérateur OpenType", "OpenType Numerator", "OpenType Numerator", "OpenType 分子"]),
+ ("OpenType Denominator", ["OpenType Denominator", "Dénominateur OpenType", "OpenType Denominator", "OpenType Denominator", "OpenType 分母"]),
+ ("Ligatures", ["Ligatures", "Ligatures", "Ligatures", "Ligatures", "连字"]),
+ ("No Break", ["No Break", "Sans retour automatique", "No Break", "No Break", "不换行"]),
+ ("Horizontal Scale:", ["Horizontal Scale:", "Échelle horizontale :", "Horizontal Scale:", "Horizontal Scale:", "水平缩放:"]),
+ ("Vertical Scale:", ["Vertical Scale:", "Échelle verticale :", "Vertical Scale:", "Vertical Scale:", "垂直缩放:"]),
+ ("Baseline Shift:", ["Baseline Shift:", "Décalage vertical :", "Baseline Shift:", "Baseline Shift:", "基线偏移:"]),
+ ("Skew:", ["Skew:", "Inclinaison :", "Skew:", "Skew:", "倾斜:"]),
+ ("Language:", ["Language:", "Langue :", "Language:", "Language:", "语言:"]),
+ ("Digits:", ["Ziffern:", "Chiffres :", "Dígitos:", "数字:", "数字:"]),
+ ("Figure Style:", ["Figure Style:", "Style de chiffres :", "Figure Style:", "Figure Style:", "数字样式:"]),
+ ("Underline On", ["Underline On", "Souligné activé", "Underline On", "Underline On", "启用下划线"]),
+ ("Strikethrough On", ["Strikethrough On", "Barré activé", "Strikethrough On", "Strikethrough On", "启用删除线"]),
+ ("Edit \"{name}\"…", ["„{name}“ bearbeiten…", "Modifier « {name} »…", "Editar \"{name}\"…", "\"{name}\" を編集…", "编辑\"{name}\"…"]),
+ (
+ "Discretionary Ligatures",
+ ["Discretionary Ligatures", "Ligatures conditionnelles", "Discretionary Ligatures", "Discretionary Ligatures", "自由连字"],
+ ),
+ ("Fractions", ["Fractions", "Fractions", "Fractions", "Fractions", "分数"]),
+ ("Ordinal", ["Ordinal", "Ordinaux", "Ordinal", "Ordinal", "序数"]),
+ ("Swash", ["Swash", "Lettres italiques ornées", "Swash", "Swash", "花体"]),
+ ("Titling Alternates", ["Titling Alternates", "Variantes de titrage", "Titling Alternates", "Titling Alternates", "标题替代字形"]),
+ (
+ "Contextual Alternates",
+ ["Contextual Alternates", "Variantes contextuelles", "Contextual Alternates", "Contextual Alternates", "上下文替代字形"],
+ ),
+ ("Slashed Zero", ["Slashed Zero", "Zéro barré", "Slashed Zero", "Slashed Zero", "斜线零"]),
+ ("Tabular Lining", ["Tabular Lining", "Chiffres alignés tabulaires", "Tabular Lining", "Tabular Lining", "等宽齐线数字"]),
+ (
+ "Proportional Oldstyle",
+ ["Proportional Oldstyle", "Chiffres elzéviriens proportionnels", "Proportional Oldstyle", "Proportional Oldstyle", "比例旧式数字"],
+ ),
+ ("Proportional Lining", ["Proportional Lining", "Chiffres alignés proportionnels", "Proportional Lining", "Proportional Lining", "比例齐线数字"]),
+ ("Tabular Oldstyle", ["Tabular Oldstyle", "Chiffres elzéviriens tabulaires", "Tabular Oldstyle", "Tabular Oldstyle", "等宽旧式数字"]),
+ (
+ "Default Figure Style",
+ ["Default Figure Style", "Style de chiffres par défaut", "Default Figure Style", "Default Figure Style", "默认数字样式"],
+ ),
+ ("Not a button", ["Not a button", "Pas un bouton", "Not a button", "Not a button", "非按钮"]),
+ ("Go To Next Page", ["Go To Next Page", "Atteindre la page suivante", "Go To Next Page", "Go To Next Page", "转到下一页"]),
+ ("Go To Previous Page", ["Go To Previous Page", "Atteindre la page précédente", "Go To Previous Page", "Go To Previous Page", "转到上一页"]),
+ ("Go To First Page", ["Go To First Page", "Atteindre la première page", "Go To First Page", "Go To First Page", "转到第一页"]),
+ ("Go To Last Page", ["Go To Last Page", "Atteindre la dernière page", "Go To Last Page", "Go To Last Page", "转到最后一页"]),
+ ("Go To Page", ["Go To Page", "Atteindre la page", "Go To Page", "Go To Page", "转到页面"]),
+ ("Go To URL", ["Go To URL", "Atteindre l'URL", "Go To URL", "Go To URL", "转到网址"]),
+ ("Not a form field", ["Not a form field", "Pas un champ de formulaire", "Not a form field", "Not a form field", "非表单域"]),
+ ("Text Field", ["Text Field", "Champ de texte", "Text Field", "Text Field", "文本域"]),
+ ("Check Box", ["Check Box", "Case à cocher", "Check Box", "Check Box", "复选框"]),
+ ("Radio Button", ["Radio Button", "Bouton radio", "Radio Button", "Radio Button", "单选按钮"]),
+ ("Combo Box", ["Combo Box", "Liste déroulante", "Combo Box", "Combo Box", "组合框"]),
+ ("List Box", ["List Box", "Zone de liste", "List Box", "List Box", "列表框"]),
+ ("Signature", ["Signature", "Signature", "Signature", "Signature", "签名"]),
+ ("Resize width", ["Resize width", "Redimensionner la largeur", "Resize width", "Resize width", "调整宽度"]),
+ ("Resize height", ["Resize height", "Redimensionner la hauteur", "Resize height", "Resize height", "调整高度"]),
+ ("Pin top", ["Pin top", "Épingler en haut", "Pin top", "Pin top", "固定顶部"]),
+ ("Pin bottom", ["Pin bottom", "Épingler en bas", "Pin bottom", "Pin bottom", "固定底部"]),
+ ("Pin left", ["Pin left", "Épingler à gauche", "Pin left", "Pin left", "固定左侧"]),
+ ("Pin right", ["Pin right", "Épingler à droite", "Pin right", "Pin right", "固定右侧"]),
+ ("Inward", ["Inward", "Vers l'intérieur", "Inward", "Inward", "向内"]),
+ ("Metrics", ["Metrics", "Métrique", "Metrics", "Metrics", "度量"]),
+ ("Optical", ["Optical", "Optique", "Optical", "Optical", "视觉"]),
+ (
+ "Optical Margin Alignment",
+ ["Optischer Randausgleich", "Marges optiques", "Alineación de márgenes ópticos", "オプティカルマージン揃え", "视觉边距对齐"],
+ ),
+ ("Applies to fill", ["Applies to fill", "S'applique au fond", "Applies to fill", "Applies to fill", "应用于填色"]),
+ ("Applies to text", ["Applies to text", "S'applique au texte", "Applies to text", "Applies to text", "应用于文本"]),
+ ("Gray", ["Gray", "Gris", "Gray", "Gray", "灰度"]),
+ ("Linear", ["Linear", "Linéaire", "Linear", "Linear", "线性"]),
+ ("Radial", ["Radial", "Radial", "Radial", "Radial", "径向"]),
+ ("Arabic", ["Arabic", "Arabe", "Arabic", "Arabic", "阿拉伯语"]),
+ ("Kanji", ["Kanji", "Kanji", "Kanji", "漢数字", "汉字数字"]),
+ ("Beveled Rectangle", ["Beveled Rectangle", "Rectangle biseauté", "Beveled Rectangle", "Beveled Rectangle", "斜角矩形"]),
+ ("Chinese", ["Chinese", "Chinois", "Chinese", "Chinese", "中文"]),
+ (
+ "Constrain proportions for width and height",
+ [
+ "Constrain proportions for width and height",
+ "Conserver les proportions de la largeur et de la hauteur",
+ "Constrain proportions for width and height",
+ "Constrain proportions for width and height",
+ "约束宽高比例",
+ ],
+ ),
+ ("Corner", ["Corner", "Angles", "Corner", "Corner", "角"]),
+ ("Custom", ["Custom", "Personnalisé", "Custom", "Custom", "自定义"]),
+ ("Czech", ["Czech", "Tchèque", "Czech", "Czech", "捷克语"]),
+ ("Danish", ["Danish", "Danois", "Danish", "Danish", "丹麦语"]),
+ ("Dashed", ["Dashed", "Tirets", "Dashed", "Dashed", "虚线"]),
+ ("Dotted", ["Dotted", "Pointillé", "Dotted", "Dotted", "点线"]),
+ (
+ "Dutch: 2005 Reform",
+ ["Dutch: 2005 Reform", "Néerlandais : réforme de 2005", "Dutch: 2005 Reform", "Dutch: 2005 Reform", "荷兰语:2005 年拼写改革"],
+ ),
+ ("Embedded", ["Embedded", "Incorporé", "Embedded", "Embedded", "已嵌入"]),
+ ("English: Canadian", ["English: Canadian", "Anglais : Canada", "English: Canadian", "English: Canadian", "英语:加拿大"]),
+ ("English: UK", ["English: UK", "Anglais : Royaume-Uni", "English: UK", "English: UK", "英语:英国"]),
+ ("English: USA", ["English: USA", "Anglais : États-Unis", "English: USA", "English: USA", "英语:美国"]),
+ ("Farsi", ["Farsi", "Persan", "Farsi", "Farsi", "波斯语"]),
+ ("Finnish", ["Finnish", "Finnois", "Finnish", "Finnish", "芬兰语"]),
+ (
+ "Fit Frame to Content",
+ ["Fit Frame to Content", "Ajuster le bloc au contenu", "Fit Frame to Content", "Fit Frame to Content", "使框架适合内容"],
+ ),
+ ("French", ["French", "Français", "French", "French", "法语"]),
+ ("French: Canadian", ["French: Canadian", "Français : Canada", "French: Canadian", "French: Canadian", "法语:加拿大"]),
+ (
+ "German: 2006 Reform",
+ ["German: 2006 Reform", "Allemand : réforme de 2006", "German: 2006 Reform", "German: 2006 Reform", "德语:2006 年拼写改革"],
+ ),
+ (
+ "German: Swiss 2006 Reform",
+ [
+ "German: Swiss 2006 Reform",
+ "Allemand : réforme suisse 2006",
+ "German: Swiss 2006 Reform",
+ "German: Swiss 2006 Reform",
+ "德语:瑞士 2006 年拼写改革",
+ ],
+ ),
+ ("Greek", ["Greek", "Grec", "Greek", "Greek", "希腊语"]),
+ ("Hebrew", ["Hebrew", "Hébreu", "Hebrew", "Hebrew", "希伯来语"]),
+ ("Hindi", ["Hindi", "Hindi", "Hindi", "Hindi", "印地语"]),
+ ("Hungarian", ["Hungarian", "Hongrois", "Hungarian", "Hungarian", "匈牙利语"]),
+ (
+ "Inverse Rounded Rectangle",
+ ["Inverse Rounded Rectangle", "Rectangle arrondi inversé", "Inverse Rounded Rectangle", "Inverse Rounded Rectangle", "内凹圆角矩形"],
+ ),
+ ("Italian", ["Italian", "Italien", "Italian", "Italian", "意大利语"]),
+ ("Japanese", ["Japanese", "Japonais", "Japanese", "Japanese", "日语"]),
+ ("Korean", ["Korean", "Coréen", "Korean", "Korean", "韩语"]),
+ (
+ "Make all settings the same",
+ [
+ "Make all settings the same",
+ "Rendre tous les réglages identiques",
+ "Make all settings the same",
+ "Make all settings the same",
+ "统一所有设置",
+ ],
+ ),
+ ("Native", ["Native", "Natif", "Native", "Native", "本地数字"]),
+ ("Norwegian: Bokmål", ["Norwegian: Bokmål", "Norvégien : bokmål", "Norwegian: Bokmål", "Norwegian: Bokmål", "挪威语:书面语"]),
+ ("Orthogonal Line", ["Orthogonal Line", "Trait orthogonal", "Orthogonal Line", "Orthogonal Line", "正交线"]),
+ ("Polish", ["Polish", "Polonais", "Polish", "Polish", "波兰语"]),
+ ("Portuguese", ["Portuguese", "Portugais", "Portuguese", "Portuguese", "葡萄牙语"]),
+ ("Portuguese: Brazilian", ["Portuguese: Brazilian", "Portugais : Brésil", "Portuguese: Brazilian", "Portuguese: Brazilian", "葡萄牙语:巴西"]),
+ ("Rounded Rectangle", ["Rounded Rectangle", "Rectangle arrondi", "Rounded Rectangle", "Rounded Rectangle", "圆角矩形"]),
+ ("Russian", ["Russian", "Russe", "Russian", "Russian", "俄语"]),
+ ("Solid", ["Solid", "Continu", "Solid", "Solid", "实线"]),
+ ("Spanish", ["Spanish", "Espagnol", "Spanish", "Spanish", "西班牙语"]),
+ ("Story Editor", ["Story Editor", "Mode éditeur", "Story Editor", "Story Editor", "文章编辑器"]),
+ ("Swedish", ["Swedish", "Suédois", "Swedish", "Swedish", "瑞典语"]),
+ ("Thick - Thick", ["Thick - Thick", "Épais - épais", "Thick - Thick", "Thick - Thick", "粗线-粗线"]),
+ ("Thick - Thin", ["Thick - Thin", "Épais - fin", "Thick - Thin", "Thick - Thin", "粗线-细线"]),
+ ("Thin - Thick", ["Thin - Thick", "Fin - épais", "Thin - Thick", "Thin - Thick", "细线-粗线"]),
+ ("Thin - Thin", ["Thin - Thin", "Fin - fin", "Thin - Thin", "Thin - Thin", "细线-细线"]),
+ ("Thin - Thick - Thin", ["Thin - Thick - Thin", "Fin - épais - fin", "Thin - Thick - Thin", "Thin - Thick - Thin", "细线-粗线-细线"]),
+ ("Thick - Thin - Thick", ["Thick - Thin - Thick", "Épais - fin - épais", "Thick - Thin - Thick", "Thick - Thin - Thick", "粗线-细线-粗线"]),
+ ("Wavy", ["Wavy", "Ondulé", "Wavy", "Wavy", "波浪线"]),
+ ("Straight Hash", ["Straight Hash", "Hachures droites", "Straight Hash", "Straight Hash", "直斜线"]),
+ ("Stripes", ["Stripes", "Rayures", "Stripes", "Stripes", "条纹"]),
+ ("Triangle", ["Triangle", "Triangle", "Triangle", "Triangle", "三角形"]),
+ ("Turkish", ["Turkish", "Turc", "Turkish", "Turkish", "土耳其语"]),
+ ("Ukrainian", ["Ukrainian", "Ukrainien", "Ukrainian", "Ukrainian", "乌克兰语"]),
+ ("Cell Style", ["Cell Style", "Style de cellule", "Cell Style", "Cell Style", "单元格样式"]),
+ ("Table Style", ["Table Style", "Style de tableau", "Table Style", "Table Style", "表样式"]),
+ ("Col ←", ["Col ←", "Col. ←", "Col ←", "Col ←", "左侧插入列"]),
+ ("Col →", ["Col →", "Col. →", "Col →", "Col →", "右侧插入列"]),
+ ("Row ↑", ["Row ↑", "Ligne ↑", "Row ↑", "Row ↑", "上方插入行"]),
+ ("Row ↓", ["Row ↓", "Ligne ↓", "Row ↓", "Row ↓", "下方插入行"]),
+ ("Hide Others", ["Hide Others", "Masquer les autres", "Hide Others", "Hide Others", "隐藏其他图层"]),
+ ("Lock Others", ["Lock Others", "Verrouiller les autres", "Lock Others", "Lock Others", "锁定其他图层"]),
+ ("Show All Layers", ["Show All Layers", "Afficher tous les calques", "Show All Layers", "Show All Layers", "显示所有图层"]),
+ ("Unlock", ["Unlock", "Déverrouiller", "Unlock", "Unlock", "解锁"]),
+ ("Unlock All Layers", ["Unlock All Layers", "Déverrouiller tous les calques", "Unlock All Layers", "Unlock All Layers", "解锁所有图层"]),
+ ("Added", ["Added", "Ajouté", "Added", "Added", "已添加"]),
+ ("Deleted", ["Deleted", "Supprimé", "Deleted", "Deleted", "已删除"]),
+ ("Guide-based", ["Guide-based", "Basé sur les repères", "Guide-based", "Guide-based", "基于参考线"]),
+ ("Object-Based", ["Object-Based", "Basé sur les objets", "Object-Based", "Object-Based", "基于对象"]),
+ ("Guide-Based", ["Guide-Based", "Basé sur les repères", "Guide-Based", "Guide-Based", "基于参考线"]),
+ ("Page:", ["Seite:", "Page :", "Página:", "ページ:", "页面:"]),
+ ("Content:", ["Inhalt:", "Contenu :", "Contenido:", "コンテンツ:", "内容:"]),
+ ("Object Constraints:", ["Objektbeschränkungen:", "Contraintes d’objet :", "Restricciones de objeto:", "オブジェクトの制約:", "对象约束:"]),
+ (
+ "Resize with Page:",
+ ["Mit Seite skalieren:", "Redimensionner avec la page :", "Cambiar tamaño con la página:", "ページと共にサイズ変更:", "随页面调整大小:"],
+ ),
+ ("Pin:", ["Fixieren:", "Épingler :", "Fijar:", "固定:", "固定:"]),
+ ("Resize Page", ["Seitengröße ändern", "Redimensionner la page", "Cambiar tamaño de página", "ページのサイズを変更", "调整页面大小"]),
+ (
+ "Liquid Page Rule:",
+ ["Regel für flüssige Seiten:", "Règle de page liquide :", "Regla de página líquida:", "リキッドページルール:", "自适应页面规则:"],
+ ),
+ (
+ "Show Parent Page Overlay",
+ [
+ "Überlagerung der übergeordneten Seite anzeigen",
+ "Afficher la superposition du gabarit",
+ "Mostrar superposición de página principal",
+ "親ページオーバーレイを表示",
+ "显示父页面叠加",
+ ],
+ ),
+ (
+ "Controlled by Parent",
+ ["Durch übergeordnete Seite gesteuert", "Contrôlé par le gabarit", "Controlado por principal", "親ページで制御", "由父页面控制"],
+ ),
+ ("US Business Card", ["US-Visitenkarte", "Carte de visite US", "Tarjeta de visita EE. UU.", "US 名刺", "美国名片"]),
+ (
+ "Object is pinned relative to the page edge. Click to release.",
+ [
+ "Das Objekt ist relativ zum Seitenrand fixiert. Zum Lösen klicken.",
+ "L’objet est épinglé par rapport au bord de la page. Cliquez pour le libérer.",
+ "El objeto está fijado respecto al borde de la página. Haga clic para soltarlo.",
+ "オブジェクトはページの端を基準に固定されています。クリックすると解除します。",
+ "对象已相对于页面边缘固定。单击可释放。",
+ ],
+ ),
+ (
+ "Click to pin the object relative to the page edge.",
+ [
+ "Klicken, um das Objekt relativ zum Seitenrand zu fixieren.",
+ "Cliquez pour épingler l’objet par rapport au bord de la page.",
+ "Haga clic para fijar el objeto respecto al borde de la página.",
+ "クリックすると、オブジェクトをページの端を基準に固定します。",
+ "单击可将对象相对于页面边缘固定。",
+ ],
+ ),
+ (
+ "The object changes width as the page changes width. Click to lock the object width.",
+ [
+ "Die Objektbreite ändert sich mit der Seitenbreite. Zum Sperren der Breite klicken.",
+ "La largeur de l’objet suit celle de la page. Cliquez pour verrouiller la largeur.",
+ "El ancho del objeto cambia con el de la página. Haga clic para bloquear el ancho.",
+ "オブジェクトの幅はページの幅に合わせて変わります。クリックすると幅をロックします。",
+ "对象宽度随页面宽度变化。单击可锁定对象宽度。",
+ ],
+ ),
+ (
+ "The object's width is locked. Click to let the object change width as the page changes width.",
+ [
+ "Die Objektbreite ist gesperrt. Klicken, damit sie sich mit der Seitenbreite ändert.",
+ "La largeur de l’objet est verrouillée. Cliquez pour qu’elle suive celle de la page.",
+ "El ancho del objeto está bloqueado. Haga clic para que cambie con el de la página.",
+ "オブジェクトの幅はロックされています。クリックすると、ページの幅に合わせて変わります。",
+ "对象宽度已锁定。单击可让其随页面宽度变化。",
+ ],
+ ),
+ (
+ "The object changes height as the page changes height. Click to lock the object height.",
+ [
+ "Die Objekthöhe ändert sich mit der Seitenhöhe. Zum Sperren der Höhe klicken.",
+ "La hauteur de l’objet suit celle de la page. Cliquez pour verrouiller la hauteur.",
+ "El alto del objeto cambia con el de la página. Haga clic para bloquear el alto.",
+ "オブジェクトの高さはページの高さに合わせて変わります。クリックすると高さをロックします。",
+ "对象高度随页面高度变化。单击可锁定对象高度。",
+ ],
+ ),
+ (
+ "The object's height is locked. Click to let the object change height as the page changes height.",
+ [
+ "Die Objekthöhe ist gesperrt. Klicken, damit sie sich mit der Seitenhöhe ändert.",
+ "La hauteur de l’objet est verrouillée. Cliquez pour qu’elle suive celle de la page.",
+ "El alto del objeto está bloqueado. Haga clic para que cambie con el de la página.",
+ "オブジェクトの高さはロックされています。クリックすると、ページの高さに合わせて変わります。",
+ "对象高度已锁定。单击可让其随页面高度变化。",
+ ],
+ ),
+ ("Loop", ["Loop", "Boucle", "Loop", "Loop", "循环播放"]),
+ ("Object-based", ["Object-based", "Basé sur les objets", "Object-based", "Object-based", "基于对象"]),
+ ("Off", ["Off", "Désactivé", "Off", "Off", "关闭"]),
+ ("Play on Page Load", ["Play on Page Load", "Lire au chargement de la page", "Play on Page Load", "Play on Page Load", "页面载入时播放"]),
+ ("Re-center", ["Re-center", "Recentrer", "Re-center", "Re-center", "重新居中"]),
+ ("Show Controls", ["Show Controls", "Afficher les commandes", "Show Controls", "Show Controls", "显示控件"]),
+ ("Signature Field", ["Signature Field", "Champ de signature", "Signature Field", "Signature Field", "签名域"]),
+ (
+ "Select text to apply a condition",
+ [
+ "Select text to apply a condition",
+ "Sélectionnez du texte pour appliquer une condition",
+ "Select text to apply a condition",
+ "Select text to apply a condition",
+ "选择文本以应用条件",
+ ],
+ ),
+ ("Blinds", ["Blinds", "Stores", "Blinds", "Blinds", "百叶窗"]),
+ ("Box", ["Box", "Boîte", "Box", "Box", "方框"]),
+ ("Comb", ["Comb", "Peigne", "Comb", "Comb", "梳状"]),
+ ("Cover", ["Cover", "Recouvrir", "Cover", "Cover", "覆盖"]),
+ ("Dissolve", ["Dissolve", "Dissolution", "Dissolve", "Dissolve", "溶解"]),
+ ("Fade", ["Fade", "Fondu", "Fade", "Fade", "淡入淡出"]),
+ ("Push", ["Push", "Pousser", "Push", "Push", "推入"]),
+ ("Split", ["Split", "Fractionner", "Split", "Split", "分割"]),
+ ("Uncover", ["Uncover", "Découvrir", "Uncover", "Uncover", "揭开"]),
+ ("Wipe", ["Wipe", "Balayage", "Wipe", "Wipe", "擦除"]),
+ ("Simple", ["Simple", "Simple", "Simple", "Simple", "简单"]),
+ ("Simple - Wide", ["Simple - Wide", "Simple - large", "Simple - Wide", "Simple - Wide", "简单-宽"]),
+ ("Triangle - Wide", ["Triangle - Wide", "Triangle - large", "Triangle - Wide", "Triangle - Wide", "三角形-宽"]),
+ ("Barbed", ["Barbed", "Barbelée", "Barbed", "Barbed", "倒钩"]),
+ ("Curved", ["Curved", "Courbe", "Curved", "Curved", "曲线"]),
+ ("Circle", ["Circle", "Cercle", "Circle", "Circle", "圆形"]),
+ ("Circle - Solid", ["Circle - Solid", "Cercle - plein", "Circle - Solid", "Circle - Solid", "实心圆"]),
+ ("Square", ["Square", "Carré", "Square", "Square", "正方形"]),
+ ("Square - Solid", ["Square - Solid", "Carré - plein", "Square - Solid", "Square - Solid", "实心正方形"]),
+ ("Bar", ["Bar", "Barre", "Bar", "Bar", "短线"]),
+ ("Fit Text", ["Fit Text", "Ajuster le texte", "Fit Text", "Fit Text", "适合文本"]),
+ ("Preview (W)", ["Preview (W)", "Aperçu (W)", "Preview (W)", "Preview (W)", "预览 (W)"]),
+ ("Normal (W)", ["Normal (W)", "Normal (W)", "Normal (W)", "Normal (W)", "正常 (W)"]),
+ ("objects", ["objects", "objets", "objects", "objects", "个对象"]),
+ ("pages", ["pages", "pages", "pages", "pages", "页"]),
+ ("stories", ["stories", "articles", "stories", "stories", "篇文章"]),
+ ("items", ["items", "éléments", "items", "items", "个项目"]),
+ ("warnings", ["warnings", "avertissements", "warnings", "warnings", "个警告"]),
+ ("Render", ["Render", "Rendu", "Render", "Render", "渲染"]),
+ ("Set", ["Set", "Jeu", "Set", "Set", "样式集"]),
+ ("unused", ["unused", "inutilisé", "unused", "unused", "未使用"]),
+ ("⚠ Missing", ["⚠ Missing", "⚠ Manquant", "⚠ Missing", "⚠ Missing", "⚠ 缺失"]),
+ ("▲ Modified", ["▲ Modified", "▲ Modifié", "▲ Modified", "▲ Modified", "▲ 已修改"]),
+ ("(Text Color)", ["(Text Color)", "(Couleur du texte)", "(Text Color)", "(Text Color)", "(文本颜色)"]),
+ (
+ "{count} glyphs — click to insert at the text cursor",
+ [
+ "{count} glyphs — click to insert at the text cursor",
+ "{count} glyphes : cliquez pour insérer à l'emplacement du curseur",
+ "{count} glyphs — click to insert at the text cursor",
+ "{count} glyphs — click to insert at the text cursor",
+ "{count} 个字形 — 单击插入到文本光标处",
+ ],
+ ),
+ (
+ "{pages} Pages in {spreads} Spreads",
+ [
+ "{pages} Pages in {spreads} Spreads",
+ "{pages} pages sur {spreads} planches",
+ "{pages} Pages in {spreads} Spreads",
+ "{pages} Pages in {spreads} Spreads",
+ "共 {pages} 页,{spreads} 个跨页",
+ ],
+ ),
+ (" (auto)", [" (auto)", " (auto)", " (auto)", " (auto)", "(自动)"]),
+ (
+ "Absolute Numbering (instead of Section Numbering)",
+ [
+ "Absolute Numbering (instead of Section Numbering)",
+ "Numérotation absolue (au lieu de la numérotation par section)",
+ "Absolute Numbering (instead of Section Numbering)",
+ "Absolute Numbering (instead of Section Numbering)",
+ "绝对页码(而非章节页码)",
+ ],
+ ),
+ (
+ "Add and remove pages as the primary text frame's story grows and shrinks",
+ [
+ "Add and remove pages as the primary text frame's story grows and shrinks",
+ "Ajouter et supprimer des pages à mesure que l'article du bloc de texte principal s'allonge ou se raccourcit",
+ "Add and remove pages as the primary text frame's story grows and shrinks",
+ "Add and remove pages as the primary text frame's story grows and shrinks",
+ "随主文本框架内容增减自动添加或删除页面",
+ ],
+ ),
+ (
+ "Added Text (highlighted)",
+ ["Added Text (highlighted)", "Texte ajouté (surligné)", "Added Text (highlighted)", "Added Text (highlighted)", "新增文本(高亮)"],
+ ),
+ (
+ "Adjust Layout (objects follow the new page size)",
+ [
+ "Adjust Layout (objects follow the new page size)",
+ "Ajuster la mise en page (les objets suivent le nouveau format de page)",
+ "Adjust Layout (objects follow the new page size)",
+ "Adjust Layout (objects follow the new page size)",
+ "调整版面(对象随页面尺寸调整)",
+ ],
+ ),
+ ("Auto-Fit", ["Auto-Fit", "Ajustement automatique", "Auto-Fit", "Auto-Fit", "自动适合"]),
+ ("Case sensitive", ["Case sensitive", "Respecter la casse", "Case sensitive", "Case sensitive", "区分大小写"]),
+ (
+ "Custom Tracking/Kerning",
+ [
+ "Custom Tracking/Kerning",
+ "Approche/crénage personnalisés",
+ "Custom Tracking/Kerning",
+ "Custom Tracking/Kerning",
+ "自定义字距调整/字距微调",
+ ],
+ ),
+ (
+ "Dimensions Include Stroke Weight",
+ [
+ "Dimensions Include Stroke Weight",
+ "Les dimensions incluent l'épaisseur du contour",
+ "Dimensions Include Stroke Weight",
+ "Dimensions Include Stroke Weight",
+ "尺寸包括描边粗细",
+ ],
+ ),
+ ("Enable Autocorrect", ["Enable Autocorrect", "Activer la correction automatique", "Enable Autocorrect", "Enable Autocorrect", "启用自动更正"]),
+ (
+ "Enable Dynamic Spelling (underline misspelled words)",
+ [
+ "Enable Dynamic Spelling (underline misspelled words)",
+ "Activer l'orthographe dynamique (souligner les mots mal orthographiés)",
+ "Enable Dynamic Spelling (underline misspelled words)",
+ "Enable Dynamic Spelling (underline misspelled words)",
+ "启用动态拼写检查(在拼写错误下加线)",
+ ],
+ ),
+ ("Grids in Back", ["Grids in Back", "Grilles en arrière-plan", "Grids in Back", "Grids in Back", "网格置于后方"]),
+ ("H&J Violations", ["H&J Violations", "Infractions de C&J", "H&J Violations", "H&J Violations", "断字与对齐违规"]),
+ ("Include Bleed", ["Include Bleed", "Inclure le fond perdu", "Include Bleed", "Include Bleed", "包含出血"]),
+ (
+ "Include Stroke Weight",
+ ["Include Stroke Weight", "Inclure l'épaisseur du contour", "Include Stroke Weight", "Include Stroke Weight", "包含描边粗细"],
+ ),
+ ("Join our Discord", ["Join our Discord", "Rejoindre notre Discord", "Join our Discord", "Join our Discord", "加入我们的 Discord 社区"]),
+ ("Keep Violations", ["Keep Violations", "Infractions d'enchaînement", "Keep Violations", "Keep Violations", "保持选项违规"]),
+ (
+ "Overprint [Black] Swatch at 100%",
+ [
+ "Overprint [Black] Swatch at 100%",
+ "Surimpression de la nuance [Noir] à 100 %",
+ "Overprint [Black] Swatch at 100%",
+ "Overprint [Black] Swatch at 100%",
+ "100% 黑色色板叠印",
+ ],
+ ),
+ ("Printer's Marks", ["Printer's Marks", "Repères d'impression", "Printer's Marks", "Printer's Marks", "打印标记"]),
+ (
+ "Remove Styles and Formatting from Text and Tables",
+ [
+ "Remove Styles and Formatting from Text and Tables",
+ "Supprimer les styles et la mise en forme du texte et des tableaux",
+ "Remove Styles and Formatting from Text and Tables",
+ "Remove Styles and Formatting from Text and Tables",
+ "从文本和表格中删除样式和格式",
+ ],
+ ),
+ ("Ruby", ["Ruby", "Ruby", "Ruby", "Ruby", "旁注"]),
+ (
+ "Show Note Anchors in Layout View",
+ [
+ "Show Note Anchors in Layout View",
+ "Afficher les ancres de note dans l'affichage Mise en page",
+ "Show Note Anchors in Layout View",
+ "Show Note Anchors in Layout View",
+ "在版面视图显示附注锚点",
+ ],
+ ),
+ ("Spreads", ["Spreads", "Planches", "Spreads", "Spreads", "跨页"]),
+ ("Substituted Fonts", ["Substituted Fonts", "Polices substituées", "Substituted Fonts", "Substituted Fonts", "替换字体"]),
+ (
+ "Transformations are Totals",
+ [
+ "Transformations are Totals",
+ "Les transformations sont des totaux",
+ "Transformations are Totals",
+ "Transformations are Totals",
+ "变换为总计",
+ ],
+ ),
+ (
+ "Use Black Point Compensation",
+ [
+ "Use Black Point Compensation",
+ "Utiliser la compensation du point noir",
+ "Use Black Point Compensation",
+ "Use Black Point Compensation",
+ "使用黑场补偿",
+ ],
+ ),
+ (
+ "Use Typographer's Quotes",
+ [
+ "Use Typographer's Quotes",
+ "Utiliser les guillemets typographiques",
+ "Use Typographer's Quotes",
+ "Use Typographer's Quotes",
+ "使用排版引号",
+ ],
+ ),
+ ("Whole word", ["Whole word", "Mot entier", "Whole word", "Whole word", "全字匹配"]),
+ ("Interface", ["Interface", "Interface", "Interface", "Interface", "界面"]),
+ ("Advanced Type", ["Advanced Type", "Texte avancé", "Advanced Type", "Advanced Type", "高级文字"]),
+ ("Composition", ["Composition", "Composition", "Composition", "Composition", "排版"]),
+ (
+ "Show Font Names in English",
+ [
+ "Schriftnamen auf Englisch anzeigen",
+ "Afficher les noms de police en anglais",
+ "Mostrar nombres de fuentes en inglés",
+ "フォント名を英語で表示",
+ "以英文显示字体名称",
+ ],
+ ),
+ ("Show CJK Features", ["CJK-Funktionen anzeigen", "Afficher les fonctions CJK", "Mostrar funciones CJK", "CJK 機能を表示", "显示中日韩功能"]),
+ ("Missing Glyphs", ["Fehlende Glyphen", "Glyphes manquants", "Glifos que faltan", "欠落グリフ", "缺失字形"]),
+ (
+ "Draw Missing Glyphs from Fallback Fonts",
+ [
+ "Fehlende Glyphen aus Ersatzschriften zeichnen",
+ "Dessiner les glyphes manquants avec des polices de substitution",
+ "Dibujar los glifos que faltan con fuentes alternativas",
+ "欠落グリフを代替フォントで表示",
+ "用后备字体绘制缺失字形",
+ ],
+ ),
+ ("Units & Increments", ["Units & Increments", "Unités et incréments", "Units & Increments", "Units & Increments", "单位和增量"]),
+ ("Grids", ["Grids", "Grilles", "Grids", "Grids", "网格"]),
+ ("Guides & Pasteboard", ["Guides & Pasteboard", "Repères et table de montage", "Guides & Pasteboard", "Guides & Pasteboard", "参考线和粘贴板"]),
+ ("Dictionary", ["Dictionary", "Dictionnaire", "Dictionary", "Dictionary", "词典"]),
+ ("Autocorrect", ["Autocorrect", "Correction automatique", "Autocorrect", "Autocorrect", "自动更正"]),
+ ("Story Editor Display", ["Story Editor Display", "Affichage du mode éditeur", "Story Editor Display", "Story Editor Display", "文章编辑器显示"]),
+ ("File Handling", ["File Handling", "Gestion des fichiers", "File Handling", "File Handling", "文件处理"]),
+ (
+ "Formatting affects container (J)",
+ [
+ "Formatting affects container (J)",
+ "La mise en forme agit sur le conteneur (J)",
+ "Formatting affects container (J)",
+ "Formatting affects container (J)",
+ "格式应用于容器 (J)",
+ ],
+ ),
+ (
+ "Formatting affects text (J)",
+ [
+ "Formatting affects text (J)",
+ "La mise en forme agit sur le texte (J)",
+ "Formatting affects text (J)",
+ "Formatting affects text (J)",
+ "格式应用于文字 (J)",
+ ],
+ ),
+ ("Apply None", ["Apply None", "Appliquer Aucun", "Apply None", "Apply None", "应用无色"]),
+ ("Height Only", ["Height Only", "Hauteur uniquement", "Height Only", "Height Only", "仅高度"]),
+ ("Width Only", ["Width Only", "Largeur uniquement", "Width Only", "Width Only", "仅宽度"]),
+ ("Height and Width", ["Height and Width", "Hauteur et largeur", "Height and Width", "Height and Width", "高度和宽度"]),
+ ("Height only", ["Height only", "Hauteur uniquement", "Height only", "Height only", "仅高度"]),
+ ("Width only", ["Width only", "Largeur uniquement", "Width only", "Width only", "仅宽度"]),
+ ("Height and width", ["Height and width", "Hauteur et largeur", "Height and width", "Height and width", "高度和宽度"]),
+ ("Version", ["Version", "Version", "Version", "Version", "版本"]),
+ (
+ "{count} characters don't fit",
+ [
+ "{count} characters don't fit",
+ "{count} caractères ne tiennent pas",
+ "{count} characters don't fit",
+ "{count} characters don't fit",
+ "有 {count} 个字符溢出",
+ ],
+ ),
+ ("document", ["document", "document", "document", "document", "文档"]),
+ ("story", ["story", "article", "story", "story", "文章"]),
+ ("selection", ["selection", "sélection", "selection", "selection", "选区"]),
+ ("top", ["top", "haut", "top", "top", "顶部"]),
+ ("center", ["center", "centre", "center", "center", "居中"]),
+ ("bottom", ["bottom", "bas", "bottom", "bottom", "底部"]),
+ ("justify", ["justify", "justifié", "justify", "justify", "两端对齐"]),
+ ("text", ["text", "texte", "text", "text", "文字"]),
+ ("graphic", ["graphic", "graphique", "graphic", "graphic", "图形"]),
+ ("unassigned", ["unassigned", "non attribué", "unassigned", "unassigned", "未指定"]),
+ ("Perceptual", ["Perceptual", "Perception", "Perceptual", "Perceptual", "可感知"]),
+ ("Relative Colorimetric", ["Relative Colorimetric", "Colorimétrie relative", "Relative Colorimetric", "Relative Colorimetric", "相对比色"]),
+ ("Saturation", ["Saturation", "Saturation", "Saturation", "Saturation", "饱和度"]),
+ ("Absolute Colorimetric", ["Absolute Colorimetric", "Colorimétrie absolue", "Absolute Colorimetric", "Absolute Colorimetric", "绝对比色"]),
+ ("No conflicts", ["No conflicts", "Aucun conflit", "No conflicts", "No conflicts", "没有冲突"]),
+ ("Page (1–{count}):", ["Page (1–{count}):", "Page (1–{count}) :", "Page (1–{count}):", "Page (1–{count}):", "页码 (1–{count}):"]),
+ (
+ "Fonts in Document: {count} Missing: {missing}",
+ [
+ "Fonts in Document: {count} Missing: {missing}",
+ "Polices du document : {count} Manquantes : {missing}",
+ "Fonts in Document: {count} Missing: {missing}",
+ "Fonts in Document: {count} Missing: {missing}",
+ "文档中的字体:{count} 缺失:{missing}",
+ ],
+ ),
+ ("No data source", ["Keine Datenquelle", "Aucune source de données", "No hay fuente de datos", "データソースがありません", "没有数据源"]),
+ (
+ "Select Data Source…",
+ ["Datenquelle auswählen …", "Choisir une source de données…", "Seleccionar fuente de datos…", "データソースを選択…", "选择数据源…"],
+ ),
+ ("Data Merge", ["Datenzusammenführung", "Fusion des données", "Combinación de datos", "データ結合", "数据合并"]),
+ ("Preview", ["Vorschau", "Aperçu", "Previsualización", "プレビュー", "预览"]),
+ ("Previous", ["Zurück", "Précédent", "Anterior", "前へ", "上一条"]),
+ ("Next", ["Weiter", "Suivant", "Siguiente", "次へ", "下一条"]),
+ ("Record", ["Datensatz", "Enregistrement", "Registro", "レコード", "记录"]),
+ ("Merge options", ["Optionen für die Zusammenführung", "Options de fusion", "Opciones de combinación", "結合オプション", "合并选项"]),
+ ("All records", ["Alle Datensätze", "Tous les enregistrements", "Todos los registros", "すべてのレコード", "全部记录"]),
+ ("One record", ["Ein Datensatz", "Un enregistrement", "Un registro", "1件のレコード", "一条记录"]),
+ ("Range", ["Bereich", "Plage", "Intervalo", "範囲", "范围"]),
+ ("Records per page", ["Datensätze pro Seite", "Enregistrements par page", "Registros por página", "ページあたりのレコード", "每页记录数"]),
+ ("Single record", ["Einzelner Datensatz", "Un seul enregistrement", "Un solo registro", "単一レコード", "单条记录"]),
+ ("Multiple records", ["Mehrere Datensätze", "Plusieurs enregistrements", "Varios registros", "複数レコード", "多条记录"]),
+ ("Arrangement", ["Anordnung", "Disposition", "Disposición", "配置", "排列"]),
+ ("Rows first", ["Zeilen zuerst", "Lignes d'abord", "Filas primero", "行を優先", "先行后列"]),
+ ("Columns first", ["Spalten zuerst", "Colonnes d'abord", "Columnas primero", "列を優先", "先列后行"]),
+ ("Column spacing", ["Spaltenabstand", "Espacement des colonnes", "Espacio entre columnas", "列の間隔", "列间距"]),
+ ("Row spacing", ["Zeilenabstand", "Espacement des lignes", "Espacio entre filas", "行の間隔", "行间距"]),
+ (
+ "Fit proportionally",
+ ["Proportional einpassen", "Ajuster proportionnellement", "Encajar proporcionalmente", "縦横比を保持して合わせる", "按比例适合"],
+ ),
+ (
+ "Fill proportionally",
+ ["Proportional füllen", "Remplir proportionnellement", "Llenar proporcionalmente", "縦横比を保持して塗りつぶす", "按比例填充"],
+ ),
+ (
+ "Fit content to frame",
+ ["Inhalt an Rahmen anpassen", "Ajuster le contenu au bloc", "Ajustar el contenido al marco", "内容をフレームに合わせる", "内容适合框架"],
+ ),
+ ("Center in frame", ["Im Rahmen zentrieren", "Centrer dans le bloc", "Centrar en el marco", "フレーム内で中央", "在框架中居中"]),
+ ("Link images", ["Bilder verknüpfen", "Lier les images", "Vincular imágenes", "画像をリンク", "链接图像"]),
+ ("Limit", ["Obergrenze", "Limite", "Límite", "上限", "上限"]),
+ ("Bind to frame", ["An Rahmen binden", "Lier au bloc", "Vincular al marco", "フレームにバインド", "绑定到框架"]),
+ ("Insert field", ["Feld einfügen", "Insérer le champ", "Insertar campo", "フィールドを挿入", "插入字段"]),
+ (
+ "Pass csv, rows, or bytes from the control channel.",
+ [
+ "csv, rows oder bytes über den Steuerkanal übergeben.",
+ "Transmettez csv, rows ou bytes par le canal de contrôle.",
+ "Pase csv, rows o bytes por el canal de control.",
+ "制御チャネルから csv、rows または bytes を渡します。",
+ "请通过控制通道传入 csv、rows 或 bytes。",
+ ],
+ ),
+ // Paragraph Rules.
+ ("Paragraph Rules…", ["Absatzlinien …", "Filets de paragraphe…", "Filetes de párrafo…", "段落境界線…", "段落线…"]),
+ ("Paragraph Rules", ["Absatzlinien", "Filets de paragraphe", "Filetes de párrafo", "段落境界線", "段落线"]),
+ ("Justification…", ["Blocksatzeinstellungen …", "Justification…", "Justificación…", "両端揃え…", "两端对齐…"]),
+ ("Rule Below", ["Linie unterhalb", "Filet au-dessous", "Filete después", "後境界線", "下方横线"]),
+ ("Tint:", ["Farbton:", "Teinte :", "Matiz:", "濃淡:", "色调:"]),
+ ("Apply To:", ["Anwenden auf:", "Appliquer à :", "Aplicar a:", "適用先:", "应用于:"]),
+ ("Frame", ["Rahmen", "Bloc", "Marco", "フレーム", "框架"]),
+ ("Slug", ["Infobereich", "Ligne-bloc", "Indicaciones", "印刷可能領域", "辅助信息区"]),
+ ("Presentation", ["Präsentation", "Présentation", "Presentación", "プレゼンテーション", "演示文稿"]),
+ ("Extras", ["Extras", "Extras", "Extras", "エクストラ", "附加"]),
+ ("Column", ["Spalte", "Colonne", "Columna", "段", "栏"]),
+ // File › New › Document
+ ("Recent", ["Zuletzt verwendet", "Récents", "Recientes", "最近使用", "最近"]),
+ ("Saved", ["Gespeichert", "Enregistrés", "Guardados", "保存済み", "已保存"]),
+ ("[Default]", ["[Standard]", "[Par défaut]", "[Predeterminado]", "[初期設定]", "[默认]"]),
+ ("Your Recent Items", ["Zuletzt verwendete Elemente", "Éléments récents", "Elementos recientes", "最近使用した項目", "最近使用的项目"]),
+ (
+ "Saved Presets",
+ ["Gespeicherte Vorgaben", "Paramètres prédéfinis enregistrés", "Ajustes preestablecidos guardados", "保存済みプリセット", "已保存的预设"],
+ ),
+ (
+ "Blank Document Presets",
+ [
+ "Vorgaben für leere Dokumente",
+ "Paramètres prédéfinis de document vierge",
+ "Ajustes preestablecidos de documento en blanco",
+ "空のドキュメントプリセット",
+ "空白文档预设",
+ ],
+ ),
+ ("Delete Preset", ["Vorgabe löschen", "Supprimer le paramètre prédéfini", "Eliminar ajuste preestablecido", "プリセットを削除", "删除预设"]),
+ (
+ "Preset Details",
+ ["Vorgabedetails", "Détails du paramètre prédéfini", "Detalles del ajuste preestablecido", "プリセットの詳細", "预设详细信息"],
+ ),
+ ("Document Name", ["Dokumentname", "Nom du document", "Nombre del documento", "ドキュメント名", "文档名称"]),
+ (
+ "Save Document Preset",
+ [
+ "Dokumentvorgabe speichern",
+ "Enregistrer le paramètre prédéfini de document",
+ "Guardar ajuste preestablecido de documento",
+ "ドキュメントプリセットを保存",
+ "存储文档预设",
+ ],
+ ),
+ (
+ "Save Document Preset As:",
+ [
+ "Dokumentvorgabe speichern unter:",
+ "Enregistrer le paramètre prédéfini de document sous :",
+ "Guardar ajuste preestablecido de documento como:",
+ "ドキュメントプリセットの保存名:",
+ "存储文档预设为:",
+ ],
+ ),
+ ("Preset Name", ["Vorgabename", "Nom du paramètre prédéfini", "Nombre del ajuste preestablecido", "プリセット名", "预设名称"]),
+ ("Save Preset", ["Vorgabe speichern", "Enregistrer le paramètre prédéfini", "Guardar ajuste preestablecido", "プリセットを保存", "存储预设"]),
+ ("Start #", ["Startseitennr.", "N° de début", "N.º inicial", "開始ページ番号", "起始页码"]),
+ ("Column Gutter", ["Spaltenabstand", "Gouttière", "Medianil", "列間隔", "栏间距"]),
+ // Layout › Numbering & Section Options
+ ("Start Section", ["Abschnittsanfang", "Début de section", "Iniciar sección", "セクション開始", "开始新章节"]),
+ (
+ "Automatic Page Numbering",
+ [
+ "Automatische Seitennummerierung",
+ "Numérotation automatique des pages",
+ "Numeración de páginas automática",
+ "自動ページ番号",
+ "自动编排页码",
+ ],
+ ),
+ (
+ "Start Page Numbering at:",
+ ["Seitennummerierung beginnen bei:", "Commencer la numérotation à :", "Iniciar numeración de páginas en:", "開始ページ番号:", "起始页码:"],
+ ),
+ ("Section Prefix:", ["Abschnittspräfix:", "Préfixe de section :", "Prefijo de sección:", "セクションプレフィックス:", "章节前缀:"]),
+ ("Section Marker:", ["Abschnittsmarke:", "Marqueur de section :", "Marcador de sección:", "セクションマーカー:", "章节标志符:"]),
+ (
+ "Include Prefix when Numbering Pages",
+ [
+ "Präfix in Seitennummerierung einschließen",
+ "Inclure le préfixe lors de la numérotation des pages",
+ "Incluir prefijo al numerar páginas",
+ "ページ番号にプレフィックスを含める",
+ "编排页码时包含前缀",
+ ],
+ ),
+ (
+ "Document Chapter Numbering",
+ [
+ "Kapitelnummerierung des Dokuments",
+ "Numérotation des chapitres du document",
+ "Numeración de capítulos del documento",
+ "ドキュメントの章番号",
+ "文档章节编号",
+ ],
+ ),
+ (
+ "Automatic Chapter Numbering",
+ [
+ "Automatische Kapitelnummerierung",
+ "Numérotation automatique des chapitres",
+ "Numeración de capítulos automática",
+ "自動章番号",
+ "自动为章节编号",
+ ],
+ ),
+ (
+ "Start Chapter Numbering at:",
+ [
+ "Kapitelnummerierung beginnen bei:",
+ "Commencer la numérotation des chapitres à :",
+ "Iniciar numeración de capítulos en:",
+ "開始章番号:",
+ "起始章节编号:",
+ ],
+ ),
+ (
+ "Same as Previous Document in the Book",
+ [
+ "Wie vorheriges Dokument im Buch",
+ "Identique au document précédent du livre",
+ "Igual que el documento anterior del libro",
+ "ブック内の前のドキュメントと同じ",
+ "与书籍中的上一文档相同",
+ ],
+ ),
+ ("Book Name:", ["Buchname:", "Nom du livre :", "Nombre del libro:", "ブック名:", "书籍名称:"]),
+ ("N/A", ["–", "S.O.", "N/D", "なし", "不适用"]),
+ // Paragraph Style Options: Paragraph Border, Paragraph Shading, Keep Options, Span Columns, Bullets and Numbering.
+ ("Paragraph Border", ["Absatzrahmen", "Contour de paragraphe", "Borde de párrafo", "段落囲み罫", "段落边框"]),
+ ("Paragraph Shading", ["Absatzschattierung", "Ombrage de paragraphe", "Sombreado de párrafo", "段落の背景色", "段落底纹"]),
+ ("Keep Options", ["Umbruchoptionen", "Options d'enchaînement", "Opciones de separación", "段落分離禁止オプション", "保持选项"]),
+ ("Span Columns", ["Spalten überspannen", "Étendre sur les colonnes", "Abarcar columnas", "段抜きと段分割", "跨栏"]),
+ ("Keep with Next:", ["Nicht trennen von nächsten:", "Lier aux suivantes:", "Conservar con siguientes:", "次の段落と分離禁止:", "与下一段保持:"]),
+ ("Keep Lines Together", ["Zeilen nicht trennen", "Lignes solidaires", "Conservar líneas juntas", "行を分離しない", "保持各行同页"]),
+ (
+ "All Lines in Paragraph",
+ ["Alle Zeilen im Absatz", "Toutes les lignes du paragraphe", "Todas las líneas del párrafo", "段落のすべての行", "段落中所有行"],
+ ),
+ (
+ "At Start/End of Paragraph",
+ ["Am Anfang/Ende des Absatzes", "Au début/à la fin du paragraphe", "Al inicio/final del párrafo", "段落の始めと終わり", "在段落开头/结尾"],
+ ),
+ ("End:", ["Ende:", "Fin:", "Final:", "終了位置:", "结束:"]),
+ ("Start Paragraph:", ["Absatzbeginn:", "Début de paragraphe:", "Inicio de párrafo:", "段落の開始位置:", "段落开始:"]),
+ ("Anywhere", ["Überall", "N'importe où", "En cualquier lugar", "任意の位置", "任意位置"]),
+ ("In Next Column", ["In nächster Spalte", "Dans la colonne suivante", "En la siguiente columna", "次の段", "于下一栏"]),
+ ("In Next Frame", ["In nächstem Rahmen", "Dans le bloc suivant", "En el siguiente marco", "次のフレーム", "于下一框架"]),
+ ("On Next Page", ["Auf nächster Seite", "Sur la page suivante", "En la página siguiente", "次のページ", "于下一页"]),
+ (
+ "On Next Odd Page",
+ ["Auf nächster ungerader Seite", "Sur la page impaire suivante", "En la siguiente página impar", "次の奇数ページ", "于下一奇数页"],
+ ),
+ (
+ "On Next Even Page",
+ ["Auf nächster gerader Seite", "Sur la page paire suivante", "En la siguiente página par", "次の偶数ページ", "于下一偶数页"],
+ ),
+ ("Paragraph Layout:", ["Absatzlayout:", "Disposition du paragraphe:", "Diseño de párrafo:", "段落レイアウト:", "段落版面:"]),
+ ("Single Column", ["Eine Spalte", "Colonne simple", "Una columna", "単一段", "单栏"]),
+ ("Split Column", ["Spalte unterteilen", "Diviser la colonne", "Dividir columna", "段分割", "拆分栏"]),
+ ("Columns:", ["Spalten:", "Colonnes :", "Columnas:", "段:", "栏数:"]),
+ ("All", ["Alle", "Toutes", "Todas", "すべて", "全部"]),
+ ("Inside Gutter:", ["Innerer Spaltenabstand:", "Gouttière intérieure:", "Medianil interior:", "内側の間隔:", "内栏间距:"]),
+ ("Outside Gutter:", ["Äußerer Spaltenabstand:", "Gouttière extérieure:", "Medianil exterior:", "外側の間隔:", "外栏间距:"]),
+ ("List Type:", ["Listentyp:", "Type de liste:", "Tipo de lista:", "リストタイプ:", "列表类型:"]),
+ ("Bullets", ["Aufzählungszeichen", "Puces", "Viñetas", "箇条書き記号", "项目符号"]),
+ ("Numbers", ["Nummerierung", "Numéros", "Números", "自動番号", "编号"]),
+ ("Bullet Character:", ["Aufzählungszeichen:", "Caractère de puce:", "Carácter de viñeta:", "箇条書き記号:", "项目符号字符:"]),
+ ("Text After:", ["Text danach:", "Texte après:", "Texto después:", "後続テキスト:", "后续文本:"]),
+ ("Gap Tint:", ["Lückenfarbton:", "Teinte de l'espace:", "Matiz del hueco:", "すき間の濃淡:", "间隙色调:"]),
+ (
+ "Corner Size and Shape",
+ ["Eckengröße und -form", "Taille et forme des angles", "Tamaño y forma de esquinas", "角のサイズとシェイプ", "角大小和形状"],
+ ),
+ ("Top Left:", ["Oben links:", "En haut à gauche:", "Superior izquierda:", "左上:", "左上:"]),
+ ("Top Right:", ["Oben rechts:", "En haut à droite:", "Superior derecha:", "右上:", "右上:"]),
+ ("Bottom Right:", ["Unten rechts:", "En bas à droite:", "Inferior derecha:", "右下:", "右下:"]),
+ ("Bottom Left:", ["Unten links:", "En bas à gauche:", "Inferior izquierda:", "左下:", "左下:"]),
+ ("Rounded", ["Abgerundet", "Arrondi", "Redondeado", "角丸", "圆角"]),
+ ("Inverse Rounded", ["Umgekehrt abgerundet", "Arrondi inversé", "Redondeado inverso", "逆角丸", "反向圆角"]),
+ ("Inset", ["Eingezogen", "En retrait", "Hundido", "内側に切り欠き", "内凹"]),
+ ("Fancy", ["Verziert", "Fantaisie", "Decorativo", "装飾", "花式"]),
+ ("Top Edge:", ["Obere Kante:", "Bord supérieur:", "Borde superior:", "上端:", "上边缘:"]),
+ ("Bottom Edge:", ["Untere Kante:", "Bord inférieur:", "Borde inferior:", "下端:", "下边缘:"]),
+ ("Em Box Top", ["Geviert oben", "Haut du cadratin", "Parte superior del cuadratín", "仮想ボディの上", "全角框顶部"]),
+ ("Descent", ["Unterlänge", "Jambage inférieur", "Descendente", "ディセント", "下伸部"]),
+ ("Em Box Bottom", ["Geviert unten", "Bas du cadratin", "Parte inferior del cuadratín", "仮想ボディの下", "全角框底部"]),
+ (
+ "Display Border if Paragraph Splits Across Frames/Columns",
+ [
+ "Rahmen anzeigen, wenn der Absatz auf Rahmen/Spalten verteilt ist",
+ "Afficher le contour si le paragraphe est réparti sur plusieurs blocs/colonnes",
+ "Mostrar borde si el párrafo se divide entre marcos/columnas",
+ "段落がフレームや段をまたぐときに囲み罫を表示",
+ "段落跨框架/栏拆分时显示边框",
+ ],
+ ),
+ (
+ "Merge Consecutive Borders and Shading",
+ [
+ "Aufeinanderfolgende Rahmen und Schattierungen zusammenführen",
+ "Fusionner les contours et trames consécutifs",
+ "Combinar bordes y sombreados consecutivos",
+ "連続する囲み罫と背景色を結合",
+ "合并连续的边框和底纹",
+ ],
+ ),
+ ("Clip to Frame", ["Auf Rahmen beschneiden", "Découper selon le bloc", "Recortar al marco", "フレームでクリップ", "剪切到框架"]),
+ (
+ "Do not Print or Export",
+ ["Nicht drucken oder exportieren", "Ne pas imprimer ni exporter", "No imprimir ni exportar", "印刷・書き出ししない", "不打印或导出"],
+ ),
+ ("Space Before Span:", ["Abstand vor Überspannung:", "Espace avant l'étendue:", "Espacio antes de abarcar:", "段抜き前のアキ:", "跨栏前间距:"]),
+ (
+ "Space After Span:",
+ ["Abstand nach Überspannung:", "Espace après l'étendue:", "Espacio después de abarcar:", "段抜き後のアキ:", "跨栏后间距:"],
+ ),
+ ("Space Before Split:", ["Abstand vor Teilung:", "Espace avant la division:", "Espacio antes de dividir:", "段分割前のアキ:", "拆分前间距:"]),
+ ("Space After Split:", ["Abstand nach Teilung:", "Espace après la division:", "Espacio después de dividir:", "段分割後のアキ:", "拆分后间距:"]),
+ ("Level:", ["Ebene:", "Niveau:", "Nivel:", "レベル:", "级别:"]),
+ ("Glyphs…", ["Glyphen…", "Glyphes…", "Glifos…", "字形…", "字形…"]),
+ ("(Paragraph Font)", ["(Absatzschrift)", "(Police du paragraphe)", "(Fuente del párrafo)", "(段落のフォント)", "(段落字体)"]),
+ (
+ "Restart Numbers at This Level After:",
+ [
+ "Nummerierung auf dieser Ebene neu beginnen nach:",
+ "Recommencer la numérotation à ce niveau après:",
+ "Reiniciar números en este nivel después de:",
+ "このレベルの番号を振り直すきっかけ:",
+ "在此级别后重新编号:",
+ ],
+ ),
+ (
+ "Any Previous Level",
+ ["Einer beliebigen höheren Ebene", "Tout niveau précédent", "Cualquier nivel anterior", "任意の上位レベル", "任何上一级别"],
+ ),
+ ("Tab Position:", ["Tabulatorposition:", "Position de la tabulation:", "Posición de tabulación:", "タブ位置:", "制表符位置:"]),
+ (
+ "Paragraph Borders and Shading…",
+ [
+ "Absatzrahmen und -schattierung…",
+ "Contours et trames de paragraphe…",
+ "Bordes y sombreado de párrafo…",
+ "段落囲み罫と段落背景色…",
+ "段落边框和底纹…",
+ ],
+ ),
+ (
+ "Paragraph Borders and Shading",
+ [
+ "Absatzrahmen und -schattierung",
+ "Contours et trames de paragraphe",
+ "Bordes y sombreado de párrafo",
+ "段落囲み罫と段落背景色",
+ "段落边框和底纹",
+ ],
+ ),
+ ("Span Columns…", ["Spalten überspannen…", "Étendre sur les colonnes…", "Abarcar columnas…", "段抜きと段分割…", "跨栏…"]),
+ (
+ "Bullets and Numbering…",
+ ["Aufzählungszeichen und Nummerierung…", "Puces et numérotation…", "Viñetas y numeración…", "箇条書き記号と番号付け…", "项目符号和编号…"],
+ ),
+ ("List:", ["Liste:", "Liste :", "Lista:", "リスト:", "列表:"]),
+ ("Mode:", ["Modus:", "Mode :", "Modo:", "モード:", "模式:"]),
+ (
+ "Continue from Previous Number",
+ [
+ "Ab vorheriger Zahl fortfahren",
+ "Continuer à partir du numéro précédent",
+ "Continuar desde el número anterior",
+ "前の番号から継続",
+ "从上一编号继续",
+ ],
+ ),
+ ("Start At", ["Beginnen bei", "Commencer à", "Empezar en", "開始番号", "起始编号"]),
+ // Cell strokes.
+ ("Strokes and Fills…", ["Konturen und Flächen …", "Contours et fonds…", "Trazos y rellenos…", "線と塗り…", "描边和填色…"]),
+ ("Cell Stroke", ["Zellkontur", "Contour de cellule", "Trazo de celda", "セルの線", "单元格描边"]),
+ ("Cell Fill", ["Zellfläche", "Fond de cellule", "Relleno de celda", "セルの塗り", "单元格填色"]),
+ ("Cell edges", ["Zellkanten", "Bords de cellule", "Bordes de celda", "セルの境界線", "单元格边缘"]),
+ (
+ "Click a line to include or exclude it. Double-click selects all outer or all inner lines; triple-click selects or clears all.",
+ [
+ "Klicken Sie auf eine Linie, um sie ein- oder auszuschließen. Doppelklick wählt alle äußeren oder alle inneren Linien; Dreifachklick wählt alle aus oder hebt die Auswahl auf.",
+ "Cliquez sur une ligne pour l'inclure ou l'exclure. Un double-clic sélectionne toutes les lignes extérieures ou intérieures ; un triple-clic sélectionne ou désélectionne tout.",
+ "Haga clic en una línea para incluirla o excluirla. Doble clic selecciona todas las líneas exteriores o interiores; triple clic selecciona o borra todas.",
+ "線をクリックすると、含めるか除外するかを切り替えます。ダブルクリックで外側または内側の線をすべて選択し、トリプルクリックですべてを選択または解除します。",
+ "单击线条可将其包含或排除。双击选择所有外侧或所有内侧线条;三击选择或清除全部。",
+ ],
+ ),
+ ("Swatch Options…", ["Farbfeldoptionen …", "Options de nuance…", "Opciones de muestra…", "スウォッチオプション…", "色板选项…"]),
+ ("Swatch Options", ["Farbfeldoptionen", "Options de nuance", "Opciones de muestra", "スウォッチオプション", "色板选项"]),
+ (
+ "Color Group Options…",
+ ["Farbgruppenoptionen …", "Options du groupe de couleurs…", "Opciones de grupo de colores…", "カラーグループオプション…", "颜色组选项…"],
+ ),
+ ("Layer Options", ["Ebenenoptionen", "Options de calque", "Opciones de capa", "レイヤーオプション", "图层选项"]),
+ (
+ "Layer Options for \"{name}\"…",
+ [
+ "Ebenenoptionen für „{name}“ …",
+ "Options du calque « {name} »…",
+ "Opciones de capa para «{name}»…",
+ "「{name}」のレイヤーオプション…",
+ "“{name}”的图层选项…",
+ ],
+ ),
+ ("Swatch Name:", ["Farbfeldname:", "Nom de la nuance :", "Nombre de muestra:", "スウォッチ名:", "色板名称:"]),
+ (
+ "Name with Color Value",
+ ["Name mit Farbwert", "Nommer d'après la valeur chromatique", "Nombre con valor de color", "カラー値を名前にする", "以颜色值命名"],
+ ),
+ ("Color Type:", ["Farbtyp:", "Type de couleur :", "Tipo de color:", "カラータイプ:", "颜色类型:"]),
+ ("Process", ["Prozessfarbe", "Quadrichromie", "Cuatricromía", "プロセス", "印刷色"]),
+ ("Spot", ["Volltonfarbe", "Ton direct", "Tinta plana", "特色", "专色"]),
+ ("Color Mode:", ["Farbmodus:", "Mode colorimétrique :", "Modo de color:", "カラーモード:", "颜色模式:"]),
+ ("Base Color:", ["Grundfarbe:", "Couleur de base :", "Color base:", "ベースカラー:", "基准颜色:"]),
+ (
+ "Edit the gradient's stops in the Gradient panel.",
+ [
+ "Die Verlaufsregler bearbeiten Sie im Verlaufsbedienfeld.",
+ "Modifiez les arrêts du dégradé dans le panneau Dégradé.",
+ "Edite las paradas del degradado en el panel Degradado.",
+ "グラデーションの分岐点はグラデーションパネルで編集します。",
+ "在“渐变”面板中编辑渐变的色标。",
+ ],
+ ),
+ (
+ "This swatch can't be edited.",
+ [
+ "Dieses Farbfeld kann nicht bearbeitet werden.",
+ "Cette nuance ne peut pas être modifiée.",
+ "Esta muestra no se puede editar.",
+ "このスウォッチは編集できません。",
+ "此色板无法编辑。",
+ ],
+ ),
+ ("Light Blue", ["Hellblau", "Bleu clair", "Azul claro", "ライトブルー", "浅蓝色"]),
+ ("Red", ["Rot", "Rouge", "Rojo", "レッド", "红色"]),
+ ("Green", ["Grün", "Vert", "Verde", "グリーン", "绿色"]),
+ ("Blue", ["Blau", "Bleu", "Azul", "ブルー", "蓝色"]),
+ ("Yellow", ["Gelb", "Jaune", "Amarillo", "イエロー", "黄色"]),
+ ("Magenta", ["Magenta", "Magenta", "Magenta", "マゼンタ", "洋红色"]),
+ ("Cyan", ["Cyan", "Cyan", "Cian", "シアン", "青色"]),
+ ("Black", ["Schwarz", "Noir", "Negro", "ブラック", "黑色"]),
+ ("Orange", ["Orange", "Orange", "Naranja", "オレンジ", "橙色"]),
+ ("Dark Green", ["Dunkelgrün", "Vert foncé", "Verde oscuro", "ダークグリーン", "深绿色"]),
+ ("Teal", ["Blaugrün", "Bleu canard", "Verde azulado", "ティール", "蓝绿色"]),
+ ("Tan", ["Hellbraun", "Fauve", "Tostado", "タン", "棕褐色"]),
+ ("Brown", ["Braun", "Marron", "Marrón", "ブラウン", "褐色"]),
+ ("Violet", ["Violett", "Violet", "Violeta", "バイオレット", "紫罗兰色"]),
+ ("Gold", ["Gold", "Or", "Dorado", "ゴールド", "金色"]),
+ ("Show Layer", ["Ebene einblenden", "Afficher le calque", "Mostrar capa", "レイヤーを表示", "显示图层"]),
+ ("Lock Layer", ["Ebene fixieren", "Verrouiller le calque", "Bloquear capa", "レイヤーをロック", "锁定图层"]),
+ ("Print Layer", ["Ebene drucken", "Imprimer le calque", "Imprimir capa", "レイヤーをプリント", "打印图层"]),
+ (
+ "Suppress Text Wrap When Layer is Hidden",
+ [
+ "Textumfluss bei ausgeblendeter Ebene unterdrücken",
+ "Supprimer l'habillage quand le calque est masqué",
+ "Suprimir ceñir texto cuando la capa está oculta",
+ "非表示レイヤーのテキストの回り込みを無視",
+ "图层隐藏时禁止文本绕排",
+ ],
+ ),
+ // Document Setup
+ ("Page Size:", ["Seitenformat:", "Format de page :", "Tamaño de página:", "ページサイズ:", "页面大小:"]),
+ (
+ "Adjust page elements to document changes",
+ [
+ "Seitenelemente an Dokumentänderungen anpassen",
+ "Adapter les éléments de page aux modifications du document",
+ "Ajustar los elementos de página a los cambios del documento",
+ "ページ要素をドキュメントの変更に合わせて調整",
+ "根据文档更改调整页面元素",
+ ],
+ ),
+ (
+ "Apply the changes; objects follow the new page size and margins",
+ [
+ "Änderungen anwenden; Objekte folgen dem neuen Seitenformat und den Rändern",
+ "Appliquer les modifications ; les objets suivent le nouveau format et les marges",
+ "Aplicar los cambios; los objetos siguen el nuevo tamaño de página y los márgenes",
+ "変更を適用し、オブジェクトを新しいページサイズとマージンに合わせます",
+ "应用更改;对象跟随新的页面大小和边距",
+ ],
+ ),
+ ("Bleed:", ["Anschnitt:", "Fond perdu :", "Sangrado:", "裁ち落とし:", "出血:"]),
+ ("Slug:", ["Infobereich:", "Ligne-bloc :", "Indicaciones:", "印刷可能領域:", "辅助信息区:"]),
+ // Font menu
+ ("Filters:", ["Filter:", "Filtres :", "Filtros:", "フィルター:", "过滤器:"]),
+ ("All Classes", ["Alle Klassen", "Toutes les classes", "Todas las clases", "すべての分類", "所有分类"]),
+ ("Serif", ["Serifenschrift", "Serif", "Con serifa", "セリフ", "衬线"]),
+ ("Slab Serif", ["Egyptienne", "Slab serif", "Serifa cuadrada", "スラブセリフ", "粗衬线"]),
+ ("Sans Serif", ["Serifenlos", "Sans serif", "Sin serifa", "サンセリフ", "无衬线"]),
+ ("Script", ["Schreibschrift", "Script", "Manuscrita", "スクリプト", "手写体"]),
+ ("Monospaced", ["Dicktengleich", "Chasse fixe", "Monoespaciada", "等幅", "等宽"]),
+ ("Decorative", ["Dekorativ", "Décorative", "Decorativa", "装飾", "装饰"]),
+ ("Symbol", ["Symbol", "Symbole", "Símbolo", "記号", "符号"]),
+ (
+ "Show Recently Added",
+ [
+ "Zuletzt hinzugefügte anzeigen",
+ "Afficher les polices ajoutées récemment",
+ "Mostrar añadidas recientemente",
+ "最近追加したフォントを表示",
+ "显示最近添加的字体",
+ ],
+ ),
+ (
+ "Small Sample Text Size",
+ ["Kleine Beispieltextgröße", "Petite taille de l'exemple", "Tamaño de muestra pequeño", "サンプルテキスト(小)", "小号示例文本"],
+ ),
+ (
+ "Medium Sample Text Size",
+ ["Mittlere Beispieltextgröße", "Taille moyenne de l'exemple", "Tamaño de muestra mediano", "サンプルテキスト(中)", "中号示例文本"],
+ ),
+ (
+ "Large Sample Text Size",
+ ["Große Beispieltextgröße", "Grande taille de l'exemple", "Tamaño de muestra grande", "サンプルテキスト(大)", "大号示例文本"],
+ ),
+ ("Selected Text", ["Ausgewählter Text", "Texte sélectionné", "Texto seleccionado", "選択したテキスト", "所选文本"]),
+ ("Sample", ["Beispiel", "Exemple", "Muestra", "サンプル", "示例"]),
+ ("Similar to {family}", ["Ähnlich wie {family}", "Semblables à {family}", "Similares a {family}", "{family} に類似", "与 {family} 相似"]),
+ (
+ "No fonts match",
+ ["Keine passenden Schriften", "Aucune police ne correspond", "Ninguna fuente coincide", "一致するフォントはありません", "没有匹配的字体"],
+ ),
+ (
+ "Show Similar Fonts",
+ ["Ähnliche Schriften anzeigen", "Afficher les polices semblables", "Mostrar fuentes similares", "類似フォントを表示", "显示相似字体"],
+ ),
+ ("Loading fonts…", ["Schriften werden geladen…", "Chargement des polices…", "Cargando fuentes…", "フォントを読み込み中…", "正在加载字体…"]),
+ ("Show Styles", ["Schnitte einblenden", "Afficher les styles", "Mostrar estilos", "スタイルを表示", "显示样式"]),
+ ("Hide Styles", ["Schnitte ausblenden", "Masquer les styles", "Ocultar estilos", "スタイルを隠す", "隐藏样式"]),
+ ("TrueType font", ["TrueType-Schrift", "Police TrueType", "Fuente TrueType", "TrueType フォント", "TrueType 字体"]),
+ ("OpenType font", ["OpenType-Schrift", "Police OpenType", "Fuente OpenType", "OpenType フォント", "OpenType 字体"]),
+ ("Variable font", ["Variable Schrift", "Police variable", "Fuente variable", "バリアブルフォント", "可变字体"]),
+ ("Color font", ["Farbschrift", "Police couleur", "Fuente de color", "カラーフォント", "彩色字体"]),
+ // Table of Contents.
+ (
+ "Sort Entries in Alphabetical Order",
+ [
+ "Einträge alphabetisch sortieren",
+ "Trier les entrées par ordre alphabétique",
+ "Ordenar entradas alfabéticamente",
+ "項目をアルファベット順に並べ替え",
+ "按字母顺序排列条目",
+ ],
+ ),
+ ];