Add Text
photopea_add_textAdd a text layer to the active document at a given position. Configure font, size, color, alignment, bold, italic, letter spacing, line height. Specify paragraphBounds to create a text box with word wrapping.
Instructions
Add a new text layer to the active document at the specified position. The text layer becomes the active layer. Use paragraphBounds to create a text box with word wrapping, or omit for point text. Use load_font to add custom fonts, and list_fonts to find available font names.
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": {
"content": "<content>",
"x": "<x>",
"y": "<y>"
},
"name": "photopea_add_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X position in pixels from the left edge of the document | |
| y | Yes | Y position in pixels from the top edge of the document | |
| bold | No | Apply faux bold | |
| font | No | Font PostScript name (e.g. ArialMT, Helvetica-Bold). Use list_fonts to find available names. | |
| size | No | Font size in points (default varies by document resolution) | |
| color | No | Color as hex string (e.g. #ff0000) | |
| italic | No | Apply faux italic | |
| content | Yes | Text content to display on the layer | |
| alignment | No | Text alignment | |
| lineHeight | No | Line height (leading) | |
| letterSpacing | No | Letter tracking/spacing | |
| paragraphBounds | No | Paragraph text box bounds |