Add Text
photopea_add_textAdd text layers to Photopea documents with precise positioning and formatting. Create point text or paragraph text boxes using custom fonts, sizes, colors, and alignment settings.
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.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Text content to display on the layer | |
| 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 | |
| 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) | |
| alignment | No | Text alignment | |
| bold | No | Apply faux bold | |
| italic | No | Apply faux italic | |
| letterSpacing | No | Letter tracking/spacing | |
| lineHeight | No | Line height (leading) | |
| paragraphBounds | No | Paragraph text box bounds |