# 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](https://developers.abyssale.com/rest-api/generation/element-properties/..#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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FLjpEHgWII7i50wREiPqJ%2Ftext-fully-decorated-0bd3ad47.jpeg?alt=media&#x26;token=8d114cff-4167-44c6-b987-eaa69cd7cc1f" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FLjpEHgWII7i50wREiPqJ%2Ftext-fully-decorated-0bd3ad47.jpeg?alt=media&#x26;token=8d114cff-4167-44c6-b987-eaa69cd7cc1f" 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](https://developers.abyssale.com/rest-api/generation/root#image-background)) , **gradient** ([Go to Linear Gradient documentation](https://developers.abyssale.com/rest-api/generation/root#linear-gradient)), or **cmyka** (only for print, [cmyka](https://developers.abyssale.com/rest-api/generation/root#cmyka))

**Examples:**

| `"color": "#1A47FF"`                                                    | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F24uz7dTS4q7EKz63QJzo%2Ftext-colored-c8f8573e.jpeg?alt=media\&token=f6cb38d1-07dc-4293-ba91-907aff67d672)          |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `"color": "linear-gradient(0% 0% 100% 0%,0% #0a68ff 1,100% #ff0000 1)"` | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fx2quC5kobehbHwYLQKwM%2Ftext-gradient-colored-80159555.jpeg?alt=media\&token=46cbc2df-aeeb-4cec-844b-17b655fabc83) |
| `"color": "cmyka(89,51,0,13,100)"`                                      | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F24uz7dTS4q7EKz63QJzo%2Ftext-colored-c8f8573e.jpeg?alt=media\&token=f6cb38d1-07dc-4293-ba91-907aff67d672)          |

## 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"` | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FbB3CkuQ9QWGNoeDHepqO%2Ftext-payload-line-break-49e34b67.jpeg?alt=media\&token=a6ace152-1d3d-4aac-8970-2cf3b0aa587e) |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fd8FUm6U7udV9DZiYpz57%2Ftext-colored-part-4adf41f7.jpeg?alt=media&#x26;token=128af38e-84c3-4bb1-bee0-874a6221a067" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FEV9LmluB2sWduawlK9zz%2Ftext-font-weight-part-0c2ad8f2.jpeg?alt=media&#x26;token=b93c3280-8ecc-433f-a618-5b4b4d7f5e46" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FplYnFdgtCVYg6XE2NqHI%2Ftext-underline-part-c5e6f41e.jpeg?alt=media&#x26;token=dd79c45e-e39a-4d61-94cb-3ad0351872dd" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FHpcd7Ibw5wRH0pksb06B%2Ftext-underline-colored-part-0afecf4e.jpeg?alt=media&#x26;token=fb8ccbda-1244-4ef8-9564-9e7eb384d0cf" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fm7E4bK5YcqYJSoqksKhf%2Ftext-strike-part-b11143e4.jpeg?alt=media&#x26;token=65d7f9d9-8107-49ed-8ff9-766b19c3ee7a" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F3qvVqroZj5akNWfkPdss%2Ftext-strike-colored-part-b38a6276.jpeg?alt=media&#x26;token=be07e17d-e8ee-4cb2-9aec-35826e26d2f2" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fv6F78qPti3iXSYoa6e60%2Fimage.png?alt=media&#x26;token=db15ea90-c484-4862-b81f-28f5660cc4e7" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FSmRDS1p67LrYpiVtCTRP%2Fimage.png?alt=media&#x26;token=19665351-d774-47d3-8e2b-861b68d60e04" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FUovfrO65xe1vCqovh1K6%2Ftext-bg-colored-part-b5de271d.jpeg?alt=media&#x26;token=ea04b735-b2d5-4b3b-931b-b2ee7440ecb7" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FI4QgM6WXvJZHa3qwzYyH%2Fimage.png?alt=media&#x26;token=c1ea6e0a-ea50-4bab-8944-a3bf66360776" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fh8LTqBPN60vNdGMOrY9h%2Fimage.png?alt=media&#x26;token=db070c1c-4cbf-4c03-af4a-fee744907c4b" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FSZp1MeFXJIB8G47E0HYF%2Fimage.png?alt=media&#x26;token=e45558b4-e343-4cb2-a989-6f88068f8720" 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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F3APNthVOgXiL75HKory3%2Fimage.png?alt=media&#x26;token=e3d2eb30-f770-4c09-b2fb-8cd3affdbd8c" alt=""></p></td></tr></tbody></table>

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

`{cmykaColor}`: [4-5 numbers digits  starting with `cmyka`](https://developers.abyssale.com/rest-api/generation/root#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"` | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FEf63FZS7XearLdGyOsav%2Ftext-background-padding-small-1eba1351.jpeg?alt=media\&token=d706626a-b694-44d8-bd1e-92fcff433684) |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `"background_padding": "5 10"` | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FnkbhhpIKnwrbxkCDFfrO%2Ftext-background-padding-big-8a92ba97.jpeg?alt=media\&token=fe22766a-91af-4048-b968-d0d63412e320)   |

## 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.](https://developers.abyssale.com/rest-api/generation/root#image-background) , for print [cmyka](https://developers.abyssale.com/rest-api/generation/root#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> | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F6BbmppjG4Kdlv1yoV9Ok%2Ftext-stroke-e40e52cb.jpeg?alt=media\&token=c35559ce-75f9-4f6c-a271-d3b0a81e062b) |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

## 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"` | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2F9a9QYfpVpotSprAvsiAy%2Ftext-align-center-1b29b491.jpeg?alt=media\&token=1655e90b-fc5c-466c-80a4-5aeaeb8bcdbb) |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `"alignment": "right"`  | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Ft7LtLT3T89uaPWkqKQ7M%2Ftext-align-right-9ac25f05.jpeg?alt=media\&token=87e2116f-f415-4508-9508-6aab82006123)  |

## 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`](https://developers.abyssale.com/rest-api/fonts) 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>     | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fog0n7iCt0FXHQisJU6cx%2Ftext-font-podkova-b4c23417.jpeg?alt=media\&token=b8acf6f2-8ea0-4a5a-a01d-6b30e16a6b7d) |
| --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>Poppins font (Extra Bold):</p><p><br><code>font: "6156907e-33c5-11ea-9877-92672c1b8195"</code><br><code>font\_weight: 800</code></p> | ![](https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2Fn3m5hbncSWUyASV104NW%2Ftext-font-poppins-28036afe.jpeg?alt=media\&token=9891618a-0869-4345-a88b-987638508b58) |

## 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.](https://developers.abyssale.com/rest-api/generation/root#image-background) , for print [cmyka](https://developers.abyssale.com/rest-api/generation/root#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="https://3568284716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHvY8mOYKzvcoxVpCu4FE%2Fuploads%2FrkTipQPabgfmUoKFZ9NH%2Fimage.png?alt=media&#x26;token=9f023069-c50e-411c-bf06-604de3aa28e5" 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.
