Fit text to size
fit_text_to_widthScale a static text layer's font size until its bounds fit a target width and/or height in pixels, with optional min/max limits and anchor re-centering.
Instructions
Scale the font size so the text's bounds fit 'width' and/or 'height' (px, layer space; scale is ignored). Works on static (non-keyframed) text; mixed sizes become one size. Optionally re-centers the anchor point.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"layer": "<layer>"
},
"name": "fit_text_to_width"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comp | No | Composition name, 'Folder/Name' path, or item id. Omit to use the active composition. | |
| layer | Yes | Text layer: 1-based index, name, or {id}. | |
| width | No | Target width in px. | |
| height | No | Target height in px (the smaller fit wins when both are given). | |
| maxFontSize | No | Upper limit (default 2000). | |
| minFontSize | No | Lower limit (default 1). | |
| centerAnchor | No | Re-center the anchor point afterwards. |