photoshop_set_text_style
Set typography on the active text layer: tracking, leading, alignment, font, size, and color. Convert between point and paragraph text or batch changes in one undo-friendly call.
Instructions
Set layer-wide typography on the active text layer: tracking, leading, point vs paragraph box, alignment, font, size, color.
Users often say: letter spacing, tracking, line height, leading, text box width, paragraph text, 字间距, 行高, 文本框.
Use when: tightening/loosening type, setting line height, converting to a wrapped paragraph box, or batching several text attributes in one undo-friendly call. Do NOT use when: creating a new layer — pass the same fields on photoshop_create_text_layer. Do NOT use when: mixed fonts/colors inside one layer — use photoshop_set_text_ranges. Do NOT use execute_script for tracking/leading/box.
Returns: JSON { ok, summary, details: { style } }. Preconditions: active text layer. Side effects: mutates TextItem attributes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| red | No | Red 0–255 | |
| blue | No | Blue 0–255 | |
| kind | No | point or paragraph (wrapped) text | |
| green | No | Green 0–255 | |
| leading | No | Line height in points. Sets auto_leading false. | |
| fontName | No | Font display or PostScript name | |
| fontSize | No | Size in points | |
| tracking | No | Character spacing in 1/1000 em (−1000 to 10000) | |
| alignment | No | Justification (same enum as photoshop_set_text_alignment) | |
| box_width | No | Paragraph box width in pixels (implies kind=paragraph) | |
| box_height | No | Paragraph box height in pixels (implies kind=paragraph) | |
| document_id | Yes | Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call. | |
| auto_leading | No | Use Photoshop auto leading |