DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Docs: explain hyphenation defaults and image fitting modes to agents
KnottyDyes0d77f39443a2
diff --git a/crates/engine/src/cmd/object.rs b/crates/engine/src/cmd/object.rsindex 5e9ed3912..7d7c7fae7 100644--- a/crates/engine/src/cmd/object.rs+++ b/crates/engine/src/cmd/object.rs@@ -586,7 +586,7 @@ pub fn specs() -> Vec<CommandSpec> {"Fitting",["Object", "Fitting"],None,- "{mode: fillProportionally|fitProportionally|fitContentToFrame|centerContent|fitFrameToContent, ids?}",+ "{mode: fillProportionally (preserves aspect ratio, covers frame, clips overflow)|fitProportionally (preserves aspect ratio, shows whole image, may leave empty space)|fitContentToFrame (stretches content to frame)|centerContent (keeps current size, positions at fitting alignment)|fitFrameToContent (resizes frame to content), ids?}",has_selection,fit),diff --git a/crates/engine/src/cmd/text.rs b/crates/engine/src/cmd/text.rsindex 0b87820ff..6996a796e 100644--- a/crates/engine/src/cmd/text.rs+++ b/crates/engine/src/cmd/text.rs@@ -148,7 +148,7 @@ pub fn specs() -> Vec<CommandSpec> {"Paragraph Formatting",[],None,- "{attrs: {align?, leftIndent?, firstLineIndent?, spaceBefore?, spaceAfter?, dropCapLines?, dropCapChars?, dropCapStyle?, dropCapAlignLeft?, dropCapScaleDescenders?, hyphenate?, composer?, tabs?, ruleAbove?/ruleBelow?: {on?, weight?, color?, tint?, columnWidth?, offset?, leftIndent?, rightIndent?} (only the named rule fields change), …}}",+ "{attrs: {align?, leftIndent?, firstLineIndent?, spaceBefore?, spaceAfter?, dropCapLines?, dropCapChars?, dropCapStyle?, dropCapAlignLeft?, dropCapScaleDescenders?, hyphenate?: bool (default true), composer?, tabs?, ruleAbove?/ruleBelow?: {on?, weight?, color?, tint?, columnWidth?, offset?, leftIndent?, rightIndent?} (only the named rule fields change), …}}",has_text_or_frames,|s, p| format_paras(s, p.get("attrs").unwrap_or(p))),diff --git a/docs/mcp.md b/docs/mcp.mdindex f35585746..2eb03e1cc 100644--- a/docs/mcp.md+++ b/docs/mcp.md@@ -71,6 +71,27 @@ and `text.move` return, a story's `length` in `get_story` and `inspect_document``get_story`. A character outside ASCII takes 2 to 4 bytes (é 2, — and は 3), so the story `はただ商店` has length 15and its second character starts at 3. An offset inside a character snaps back to the start of that character.+## Text and image fitting++Hyphenation is on by default for new text (`hyphenate: true`). To turn it off, select the text or a text frame,+then call `execute`:++```text+execute {"command": "type.para", "params": {"attrs": {"hyphenate": false}}}+```++With a text selection, this formats the selected paragraphs; with selected text frames, it formats their whole stories.++Use `execute` with `object.fit` to fit a selected graphic frame (or pass `ids`):++| `mode` | What it does |+|---|---|+| `fillProportionally` | Preserves aspect ratio, covers the frame and clips overflow. |+| `fitProportionally` | Preserves aspect ratio, shows the whole image and may leave empty space. |+| `fitContentToFrame` | Stretches the content to the frame's width and height. |+| `centerContent` | Keeps the current size and positions content at the fitting alignment (center by default). |+| `fitFrameToContent` | Resizes the frame to the content's bounds. |+## Tools| Tool | What it does |