diff --git a/crates/engine/src/cmd/object.rs b/crates/engine/src/cmd/object.rs index c5ee322d..fc319a40 100644 --- a/crates/engine/src/cmd/object.rs +++ b/crates/engine/src/cmd/object.rs @@ -525,7 +525,7 @@ pub fn specs() -> Vec { "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.rs index 2f8a3b34..b8f93cf0 100644 --- a/crates/engine/src/cmd/text.rs +++ b/crates/engine/src/cmd/text.rs @@ -138,7 +138,7 @@ pub fn specs() -> Vec { "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.md index 5f8e000c..c42aade1 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -68,6 +68,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 15 and 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 |