# Text styling

1. Select the shape by `name` you want to modify. See [here](https://docs.powerpointgeneratorapi.com/knowledge-base/finding-shape-names) to find shape names.
2. Use the `text` property to define one or more **text runs** — each run can have its own visual properties.
3. Each text run uses the `text_run` field to define content, and the `text_properties` field to specify styling such as:
   1. `font_type`, `font_size`, `font_color`
   2. `font_bold`, `font_italic`, `font_underline`
   3. `text_align`, `font_bg_color`, and `new_line` (to start a new line)
4. Use `settings` for general text box configuration such as line spacing, alignment, and vertical positioning.

Reference: [#settings-object](https://docs.powerpointgeneratorapi.com/json-template-syntax/shapes/textbox#settings-object "mention")

Download: [input.zip](https://drive.google.com/uc?export=download\&id=1GfNyIgUysOA4J6YOmJuZPGYtpQFohADW) | [output.pptx](https://drive.google.com/uc?export=download\&id=1nMTWN05aloRWCPXFsOYv4ceA0IOghjYW)

{% columns %}
{% column width="41.66666666666667%" %}

<figure><img src="https://1155212587-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgoqdluo05I2RXHZpTr-887967055%2Fuploads%2Fu8vHTjAgCHcEmV1waTTv%2Ftemplate.png?alt=media&#x26;token=be6fb91f-da90-4fa2-b215-e4ce0cd35628" alt=""><figcaption></figcaption></figure>

***

<figure><img src="https://1155212587-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgoqdluo05I2RXHZpTr-887967055%2Fuploads%2FxE4GPNdZOwPgVRkaOqNY%2Foutput.png?alt=media&#x26;token=f4f3d2dd-100e-4f10-adb4-79ac90d87a04" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="58.33333333333333%" %}
{% code lineNumbers="true" %}

```json
{
  "presentation": {
    "template": "template.pptx",
    "slides": [
      {
        "slide_index": 0,
        "shapes": [
          {
            "name": "TextBox 1",
            "text": [
              {
                "text_run": "Courier New ",
                "text_properties": {
                  "font_type": "Courier New",
                  "font_size": 36,
                  "font_color": "114, 225, 210"
                }
              },
              {
                "text_run": "36",
                "text_properties": {
                  "font_type": "Courier New",
                  "font_size": 36,
                  "font_color": "255, 255, 0",
                  "new_line":true 
                }
              },
              {
                "text_run": "Italic Arial ",
                "text_properties": {
                  "font_type": "Arial",
                  "font_italic": true,
                  "font_size": 48,
                  "font_color": "242, 174, 247"
                }
              },
              {
                "text_run": "28",
                "text_properties": {
                  "font_type": "Arial",
                  "font_italic": true,
                  "font_size": 28,
                  "font_color": "0, 176, 80",
                  "text_align": "right",
                  "new_line":true 
                }
              },
              {
                "text_run": "Bold Verdana ",
                "text_properties": {
                  "font_type": "Verdana",
                  "font_bold": true,
                  "font_size": 28,
                  "font_color": "241, 194, 50"
                }
              },
              {
                "text_run": "50",
                "text_properties": {
                  "font_type": "Verdana",
                  "font_bold": true,
                  "font_size": 28,
                  "font_color": "112, 48, 160",
                  "font_bg_color": "#817463",
                  "new_line":true 
                }
              },
              {
                "text_run": "Alignment right",
                "text_properties": {
                  "font_type": "Forte",
                  "font_size": 20,
                  "text_align": "right",
                  "font_color": "255, 255, 255",
                  "font_bg_color": "#817463",
                  "new_line":true 
                }
              },
              {
                "text_run": "Underline",
                "text_properties": {
                  "font_type": "Segoe Script",
                  "font_size": 36,
                  "text_align": "center",
                  "font_underline": "single",
                  "font_color": "0, 176, 240",
                  "new_line":true
                }
              },
              {
                "text_run": "Text highlight ",
                "text_properties": {
                  "font_type": "Impact",
                  "font_size": 20,
                  "text_align": "left",
                  "font_color": "orange",
                  "font_bg_color": "#00ff00"
                }
              }
            ]
          },
          {
            "name": "TextBox 2",
            "text": "First line\nSecond line\nThird line\nFourth line",
            "settings": {
              "text_line_spacing": 1.5,
              "vertical_anchor": "middle",
              "font_type": "Courier New",
              "font_size": 15,
              "font_bold": true,
              "font_italic": true,
              "text_align": "center",
              "font_color": "114, 225, 210"
            }
          }
        ]
      }
    ]
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}


---

# 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://docs.powerpointgeneratorapi.com/examples/text-shape/text-styling.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.
