For the complete documentation index, see llms.txt. This page is also available as Markdown.

Text styling

  1. Select the shape by name you want to modify. See here 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

Download: input.zip | output.pptx


{
  "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"
            }
          }
        ]
      }
    ]
  }
}

Last updated

Was this helpful?