# Text

Available properties:

| Property                                                                                                                                                                                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **payload**                                                                                                                                                                                                           | [Go to Payload documentation](#payload)                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **color**                                                                                                                                                                                                             | [Go to Color documentation](#color)                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **background\_color**                                                                                                                                                                                                 | Same as `color`, but allows to add a background behind the text                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **background\_padding**                                                                                                                                                                                               | [Go to Background Padding documentation](#background-padding)                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **font\_size**                                                                                                                                                                                                        | Number. **Force font size in pixels** (must be > 1)                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p><strong>font</strong><br><strong>font\_weight</strong></p>                                                                                                                                                         | [Go to Font documentation](#font)                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **line\_height**                                                                                                                                                                                                      | Number. **Force line height in percentage** (must be > 1). *This parameter is only applied when the text is a multiline one.*                                                                                                                                                                                                                                                                                                                                                                       |
| **skew\_y**                                                                                                                                                                                                           | Number: between `-20` and `20`. **Slant text on the y axis**                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **alignment**                                                                                                                                                                                                         | [Go to Alignment documentation](#text-alignment)                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <p><strong>stroke\_width</strong><br><strong>stroke\_color</strong></p>                                                                                                                                               | [Go to Stroke documentation](#stroke)                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><strong>shadow\_color</strong><br><strong>shadow\_blur</strong><br><strong>shadow\_offset\_x</strong><br><strong>shadow\_offset\_y</strong></p>                                                                    | [Go to Shadow documentation](/rest-api/generation/element-properties.md#shadow)                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **auto\_resize**                                                                                                                                                                                                      | <p>Boolean: Automatically adjusts the text size to fit within its container <br><em>(If set to true, <strong><code>min\_font\_size</code></strong> must be defined)</em></p>                                                                                                                                                                                                                                                                                                                        |
| **min\_font\_size**                                                                                                                                                                                                   | <p>Number: Specifies the minimum font size allowed when auto-resizing text. <br><em>(auto\_resize must be set to <strong>true</strong>)</em></p>                                                                                                                                                                                                                                                                                                                                                    |
| **text\_transform**                                                                                                                                                                                                   | <p>String: Force the text to be transformed to one of the following formats:</p><ul><li>"<code>uppercase</code>" – All letters become uppercase (e.g., EXAMPLE).</li><li>"<code>lowercase</code>" – All letters become lowercase (e.g., example).</li><li><p>"<code>titlecase</code>" – The first letter of each word is capitalized (e.g., Example Text).</p><ul><li>"<code>capitalize</code>" – Only the first letter of the entire text is capitalized (e.g., Example text).</li></ul></li></ul> |
| <p><strong>side\_border</strong><br><strong>side\_border\_thickness</strong></p><p><strong>side\_border\_padding</strong></p><p><strong>side\_border\_color</strong></p><p><strong>side\_border\_rounded</strong></p> | [Go to Text Side Border documentation](#font-1)                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **max\_lines**                                                                                                                                                                                                        | Number > 0. Maximum number of lines allowed.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **text\_harmony**                                                                                                                                                                                                     | Boolean. Attempts to balance line lengths with a maximum variance of 20% between lines. *The system first adjusts character spacing (±20), then reduces the font size (up to -10px) if needed.*                                                                                                                                                                                                                                                                                                     |
| **text\_truncation**                                                                                                                                                                                                  | Boolean. If the text still does not fit, it is truncated and an ellipsis (...) is added at the end of the line.                                                                                                                                                                                                                                                                                                                                                                                     |

**Example of a decorated text:**

<table data-header-hidden><thead><tr><th width="486"></th><th></th></tr></thead><tbody><tr><td><code>"payload": "Lorem i&#x3C;c=#ff0000>&#x3C;u>p&#x3C;/u>&#x3C;/c>su&#x3C;s>m&#x3C;/s> is simply &#x3C;c=#1A47FF>dummy&#x3C;/c> &#x3C;u>text&#x3C;/u>"</code><br><code>"color": "#ffffff"</code><br><code>"background_color": "#8A4F4F"</code><br><code>"background_padding": "2 6"</code><br><code>"skew_y": -4</code><br><code>"alignment": "middle center"</code><br><code>"font_size": 30</code><br><code>"line_height": 150</code><br><code>"shadow_color": "#000080"</code><br><code>"shadow_blur": 3</code><br><code>"shadow_offset_x": 0</code><br><code>"shadow_offset_y": 6</code></td><td><img src="/files/4NPOrsyZImBnvqKs2ZOM" alt=""></td></tr><tr><td><code>"payload": "Lorem i&#x3C;c=cmyka(0,100,100,0)>&#x3C;u>p&#x3C;/u>&#x3C;/c>su&#x3C;s>m&#x3C;/s> is simply &#x3C;c=cmyka(90,72,0,0,100)>dummy&#x3C;/c> &#x3C;u>text&#x3C;/u>"</code><br><code>"color": "cmyka(0,0,0,0,100)"</code><br><code>"background_color":"cmyka(0,43,43,46)"</code><br><code>"background_padding": "2 6"</code><br><code>"skew_y": -4</code><br><code>"alignment": "middle center"</code><br><code>"font_size": 30</code><br><code>"line_height": 150</code><br><code>"shadow_color":cmyka(100,100,0,50,100)"</code><br><code>"shadow_blur": 3</code><br><code>"shadow_offset_x": 0</code><br><code>"shadow_offset_y": 6</code></td><td><img src="/files/4NPOrsyZImBnvqKs2ZOM" alt=""></td></tr></tbody></table>

## Color <a href="#color" id="color"></a>

`color`: The text color, can be a **monochrome** ([6-8 digits hexa color](/rest-api/generation/element-properties/root.md#image-background)) , **gradient** ([Go to Linear Gradient documentation](/rest-api/generation/element-properties/root.md#linear-gradient)), or **cmyka** (only for print, [cmyka](/rest-api/generation/element-properties/root.md#cmyka))

**Examples:**

| `"color": "#1A47FF"`                                                    | ![](/files/omhlLpM4mmZ4hlT47Ek2) |
| ----------------------------------------------------------------------- | -------------------------------- |
| `"color": "linear-gradient(0% 0% 100% 0%,0% #0a68ff 1,100% #ff0000 1)"` | ![](/files/SGFXra0ameNThjP7dddf) |
| `"color": "cmyka(89,51,0,13,100)"`                                      | ![](/files/omhlLpM4mmZ4hlT47Ek2) |

## Payload <a href="#payload" id="payload"></a>

`payload` is the text content.

**Constraints:**

* Cannot be empty
* 2048 characters maximum

### **Line breaks**

By default, line breaks are automatically computed from the available space.&#x20;

**You can however force line breaks by adding `\n`**.

{% hint style="info" %}
*Beware of external integrations (Zapier, Integromat, Airtable): as they support multi text line inputs this parameter won't be interpreted on the Abyssale generation side.*
{% endhint %}

**Example:**

| `"payload": "Lorem Ipsum\nis simply dummy text"` | ![](/files/VteYXgb3uBNG0xThmcwS) |
| ------------------------------------------------ | -------------------------------- |

### **Partial Text Decorations**

Text markups can be added to underline, colorise, strike of change font weight on specific part of the payload. *(it resembles html markup but is not)*

{% hint style="warning" %}
**Text markups will override global text decoration settings.** If you only want to change the global text style, do not use markups -> use global text properties.
{% endhint %}

**Available markups:**

<table><thead><tr><th width="263">Type</th><th>Markup</th></tr></thead><tbody><tr><td><strong>Color</strong></td><td><p><code>&#x3C;c={hexaColor}>my colored part&#x3C;/c></code><br><br><em>Example:</em><br></p><p><code>&#x3C;c=#FF0000>Lorem Ipsum&#x3C;/c> is simply dummy text</code><br><img src="/files/UNnaJ9SH6hZ3tPl1HqCk" alt=""></p></td></tr><tr><td><strong>Font weight</strong></td><td><p><code>&#x3C;w={weight}>my changed part&#x3C;/w></code><br><br><code>{weight}</code>: Integer representing the font weight (100 to 900):<br>thin (<code>100</code>), normal (<code>400</code>), bold (<code>700</code>), heavy (<code>900</code>)).<br><br><em>If the font does not support the given weight, it fallbacks to the current weight.</em><br><br><em>Example:</em></p><p></p><p><code>&#x3C;w=900>Lorem Ipsum&#x3C;/w> is simply dummy text</code><br><img src="/files/megeKtWQYlzeXwMqJ70V" alt=""></p></td></tr><tr><td><strong>Underline</strong></td><td><p><code>&#x3C;u>my underline part&#x3C;/u></code></p><p></p><p><em>Example:</em></p><p></p><p><code>&#x3C;u>Lorem Ipsum&#x3C;/u> is simply dummy text</code><br><img src="/files/P9WF1iy4BMaSb8QLRk3B" alt=""></p></td></tr><tr><td><strong>Underline with colored line</strong></td><td><p><code>&#x3C;u={hexaColor}>my colored underline part&#x3C;/u></code></p><p></p><p><em>Example:</em></p><p></p><p><code>&#x3C;u=#FF0000>Lorem Ipsum&#x3C;/u> is simply dummy text</code><br><img src="/files/hm699Z1M6wI3lNdATtW5" alt=""></p></td></tr><tr><td><strong>Strike through</strong></td><td><p><code>&#x3C;s>my strikethrough part&#x3C;/s></code></p><p></p><p><em>Example:</em></p><p></p><p><code>&#x3C;s>Lorem Ipsum&#x3C;/s> is simply dummy text</code><br><img src="/files/hjNbRftdBySK4wGbRuzu" alt=""></p></td></tr><tr><td><strong>Strike through with colored strike</strong></td><td><p><code>&#x3C;s={hexaColor}>my colored strike part&#x3C;/s></code><br></p><p><em>Example:</em></p><p></p><p><code>&#x3C;s=#FF0000>Lorem Ipsum&#x3C;/s> is simply dummy text</code><br><img src="/files/2MZoWPZzksCZEjfZQU8d" alt=""></p></td></tr><tr><td><strong>Diagonal Strike through</strong></td><td><p><code>&#x3C;d>my diagonal strike part&#x3C;/d></code><br></p><p><em>Example:</em></p><p></p><p><code>&#x3C;d>Lorem Ipsum&#x3C;/d> is simply dummy text</code><br><img src="/files/3XXDzdxOhRHvhMlSOHiA" alt=""></p></td></tr><tr><td><strong>Diagonal Strike through with colored strike</strong></td><td><p><code>&#x3C;d={hexaColor}>my colored diagonal strike part&#x3C;/d></code><br></p><p><em>Example:</em></p><p></p><p><code>&#x3C;d=#FF0000>Lorem Ipsum&#x3C;/d> is simply dummy text</code><br><img src="/files/8P85ieIXlxudeclVTPei" alt=""></p></td></tr><tr><td><strong>Background color</strong></td><td><p><code>&#x3C;bg={hexaColor}>Text with bg color&#x3C;/bg></code><br><br>The padding around the background is controlled on the whole element (by using the <code>background_padding</code> property)<br><br><em>Example:</em></p><p></p><p><code>&#x3C;bg=#f6aeb8>Lorem Ipsum&#x3C;/bg> is simply dummy text</code><br><img src="/files/m58glofxatwbC8u7SVvu" alt=""></p></td></tr><tr><td><strong>Font size</strong></td><td><p><code>&#x3C;f={fontSize}>Text with font size changed&#x3C;/f></code> <br><br><code>{fontSize}</code> can be either an absolute value (<strong><code>110</code></strong> for instance), which will be interpreted in pixels or a percentage (<strong><code>110%</code></strong>) of the current font size.<br><br><em>Example:</em><br></p><p><code>Lorem &#x3C;f=60%>ipsum&#x3C;/f> is simply dummy text</code><br><img src="/files/1xy7nlAPH534CF71zOUc" alt=""></p></td></tr><tr><td><strong>Superscript</strong></td><td><p><code>&#x3C;sup>Text smaller, slightly above the normal line&#x3C;/sup></code> <br><br><em>Example:</em></p><p></p><p><code>Lorem Ip&#x3C;sup>sum&#x3C;/sup> is simply dummy text</code><br><img src="/files/izvycgtSmU9xTYnGU5SN" alt=""></p></td></tr><tr><td><strong>Subscript</strong></td><td><p><code>&#x3C;sub>Text smaller, slightly below the normal line&#x3C;/sub></code> <br><br><em>Example:</em></p><p></p><p><code>Lorem Ip&#x3C;sub>sum&#x3C;/sub> is simply dummy text</code><br><img src="/files/WcqlCYS2jClfmzTNOsor" alt=""></p></td></tr><tr><td><strong>Kerning</strong></td><td><p>Kerning defines the spacing after a specific letter, expressed <strong>as a percentage relative to the current font size</strong>. The value can also be negative.</p><p></p><p></p><p><em>Example:</em></p><p><code>&#x3C;k=-20%>Spac&#x3C;k=100%>ing</code><br><br><img src="/files/I1wiJt6bvAy1fIxNU7Qd" alt=""></p></td></tr></tbody></table>

`{hexaColor}`: [6 or 8 (for the opacity) digits hexadecimal color starting with # (i.e. `#EAEAEA` or `#00000080`)](/rest-api/generation/element-properties/root.md#image-background)

`{cmykaColor}`: [4-5 numbers digits  starting with `cmyka`](/rest-api/generation/element-properties/root.md#cmyka)(only for print)

{% hint style="info" %}
All of those markups can be combined.&#x20;
{% endhint %}

{% hint style="warning" %}
It works like HTML. You have to pay attention on how you write your opening & closing tags.
{% endhint %}

## Background padding <a href="#background-padding" id="background-padding"></a>

`background_padding`: **The padding of the background color around the text**.

* String: Two numbers separated by a space: First number represents the vertical padding in pixels & the second the vertical padding. *For instance: `0 10` : `0` as vertical padding & `10` as horizontal*
* or 1 `Number`: Horizontal & vertical paddings in pixels

{% hint style="info" %}
This parameter will only be used if a background color is defined.
{% endhint %}

**Examples:**

| `"background_padding": "0 10"` | ![](/files/tZR9pqu5rqZcXGCrfawF) |
| ------------------------------ | -------------------------------- |
| `"background_padding": "5 10"` | ![](/files/iE0a95zCdUH6DmUenxHf) |

## Stroke <a href="#stroke" id="stroke"></a>

A stroke can be added to text. In order to customise it, 2 properties are available:

* `stroke_width`: Number between 0 & 40. **Width of the stroke**
* `stroke_color`: [6-8 digits Hexa color.](/rest-api/generation/element-properties/root.md#image-background) , for print [cmyka](/rest-api/generation/element-properties/root.md#cmyka)

*If your design does not contain any stroke, those 2 properties are required to have a stroke (and the width must be > 0).*

**Example:**

| <p><code>stroke\_width: 8</code><br><code>stroke\_color: "#1A47FF"</code></p> | ![](/files/ywF4s5hR8LziliB3FJPR) |
| ----------------------------------------------------------------------------- | -------------------------------- |

## Text Alignment <a href="#text-alignment" id="text-alignment"></a>

`alignment` can be defined to override the default text alignment.&#x20;

{% hint style="info" %}
The text position will then be computed from the text bounding box defined within the design.
{% endhint %}

It can be of two forms:

* One string: `top`, `middle`, `bottom`, `left`, `center`, `right`
* Two strings: One vertical alignment parameter (`top`, `middle`, `bottom`) associated with a horizontal alignment parameter (`left`, `center`, `right`) separated by a space. i.e: (`top left` , `middle right`)

**Examples:**

| `"alignment": "center"` | ![](/files/YBYlnbMhchaudqMiJ7pJ) |
| ----------------------- | -------------------------------- |
| `"alignment": "right"`  | ![](/files/NYM3tyteGrPj6vGBRa6O) |

## Font <a href="#font" id="font"></a>

The default font can be overridden with the `font` and `font_weight` properties:

* `font`: String. **Force a specific font by ID**. The fonts list is available by calling the [`GET /fonts`](/rest-api/fonts.md) API route.
* `font_weight`: Number. **Force a font weight**. Available values: 100, 200, 300, 400, 500, 600, 700, 800, 900

{% hint style="warning" %}
If the font does not contain a font weight, the nearest weight will be used.
{% endhint %}

**Examples:**

| <p>Podkova font (Medium):</p><p><br><code>font: "6156872a-33c5-11ea-9877-92672c1b8195"</code><br><code>font\_weight: 500</code></p>     | ![](/files/EcCuYdTweTEAGHZZMlYK) |
| --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| <p>Poppins font (Extra Bold):</p><p><br><code>font: "6156907e-33c5-11ea-9877-92672c1b8195"</code><br><code>font\_weight: 800</code></p> | ![](/files/KN3YHeAc5LWopOCDjR2i) |

## Text Side Border <a href="#font" id="font"></a>

A side border can be applied to a text element on one of its sides (left, right, top, or bottom). The border’s position, size, color, spacing, and shape can be customized using the properties below.<br>

* **`side_border`**: String. One of "`left`", "`right`", "`top`", "`bottom`", "`none`". Defines the side on which the border is rendered. If not set, no side border is applied. If "`none`" is set, it disables a side border if it was initially present in the design.
* **`side_border_thickness`**: Number in pixel > 0. The thickness of the side border.&#x20;
* **`side_border_color`**: [6-8 digits Hexa color.](/rest-api/generation/element-properties/root.md#image-background) , for print [cmyka](/rest-api/generation/element-properties/root.md#cmyka)&#x20;
* **`side_border_rounded`:** Boolean. Defines whether the border corners are rounded (`true`) or square (`false`). Default is false.
* **`side_border_padding`:** Number in pixel > 0. The distance between the text content and the side border. Default is 0.
* **`side_border_offset`**: Number in pixel. Moves the border along the axis perpendicular to its orientation:

  * If `side_border` is `"top"` or `"bottom"` → offset moves the border horizontally.
  * If `side_border` is `"left"` or `"right"` → offset moves the border vertically.

  Positive and negative values shift the border in opposite directions. Default is 0.&#x20;
* **`side_border_spread` :** Number if pixel. Extends the length of the border beyond the text bounding box by the specified number of pixels. Default is 0.

**Example:**

| <p>"side\_border": "left", <br>"side\_border\_thickness": 17,<br>"side\_border\_padding": 8,<br>"side\_border\_color": "#6d50a5a7",<br>"side\_border\_rounded": true,<br>"side\_border\_spread": 16,<br>"side\_border\_offset": 7</p> | <img src="/files/6bT5O8k2VuC2RNh7tgY6" alt="" data-size="original"> |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |

## Using Variables Inside Text Content

If you want to customize only a specific part of a text element without replacing the entire text, you can use **variables** within your text content.

A **variable** is a placeholder defined by a name enclosed in curly braces, for example: `{title}`.

**In your original text of your design, include these variables where you want dynamic content to appear.** Then, when calling the API, you can replace these variables by passing a `vars` object with key-value pairs, where the key matches the variable name (without braces) and the value is the new content you want to insert.

**Example:**

Original text:\
`Welcome, {username}!`

API call:

```json
{
  elements: {
    vars: {
      "username": "Alice"
    }
  }
}
```

Resulting text:\
`Welcome, Alice!`

This method allows you to dynamically update parts of your text without needing to rewrite the entire content.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.abyssale.com/rest-api/generation/element-properties/text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
