set_text_style
Apply a saved text style or custom typography to a Figma TEXT node, including font, size, spacing, alignment, wrapping, and fills.
Instructions
Apply a text style and/or fine-grained typography to a TEXT node. Pass textStyleId to apply an existing style; also supports fontFamily/fontStyle, variationSettings (variable-font axes, e.g. {wght:550}), fontSize, lineHeight (number|'AUTO'|{unit,value}), letterSpacing (number|{unit,value}), textCase, textDecoration, textAlignHorizontal (LEFT|CENTER|RIGHT|JUSTIFIED), textAlignVertical (TOP|CENTER|BOTTOM), textAutoResize (WIDTH_AND_HEIGHT|HEIGHT|NONE|TRUNCATE), layoutSizingHorizontal/Vertical or width/height (FIXED|HUG|FILL), paragraphIndent/Spacing, fillsHex/fills/fillStyleId, boundVariables, textWrapStyle (AUTO|BALANCE|PRETTY), textTruncation (DISABLED|ENDING) and maxLines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fills | No | ||
| width | No | Alias for layoutSizingHorizontal | |
| height | No | Alias for layoutSizingVertical | |
| nodeId | Yes | ||
| fillsHex | No | ||
| fontSize | No | ||
| maxLines | No | ||
| textCase | No | ||
| fontStyle | No | ||
| fontFamily | No | ||
| lineHeight | No | ||
| fillStyleId | No | ||
| textStyleId | No | ||
| letterSpacing | No | ||
| textWrapStyle | No | ||
| boundVariables | No | ||
| textAutoResize | No | WIDTH_AND_HEIGHT | HEIGHT | NONE | TRUNCATE | |
| textDecoration | No | ||
| textTruncation | No | ||
| paragraphIndent | No | ||
| paragraphSpacing | No | ||
| textAlignVertical | No | TOP | CENTER | BOTTOM | |
| variationSettings | No | Variable-font axis values keyed by OpenType tag, e.g. { wght: 550, slnt: -10 }. | |
| textAlignHorizontal | No | LEFT | CENTER | RIGHT | JUSTIFIED | |
| layoutSizingVertical | No | ||
| layoutSizingHorizontal | No |