Text styles

You can set styles for individual {placeholder}.

"styles.font" apply only to the replaced text. "styles.shape" styles apply to the entire shape that the placeholder is in.

You can also unset some styles by passing an empty string, e.g. {"outline": ""}.

Reference: the Text object · the Styles object

Download: input.zip · output.pptx

template.pptx

1
template.pptx slide 1

output.pptx

1
output.pptx slide 1

data.json

{
  "slides": [
    {
      "template": 1,
      "text-with-styles": {
        "value": "Do it with style!",
        "styles": {
          "font": {
            "typeface": "Georgia",
            "color": "e4b054",
            "bold": true
          }
        }
      },

      "sign": {
        "value": "+",
        "styles": {
          "font": {
            "color": "00b14e",
            "size": 14
          }
        }
      },
      "number": {
        "value": "230",
        "styles": {
          "font": {
            "color": "00b14e",
            "size": 26,
            "bold": true
          }
        }
      },
      "unit": {
        "value": "%",
        "styles": {
          "font": {
            "color": "00b14e",
            "size": 14
          }
        }
      },

      "person": {
        "value": "Chick Corea",
        "styles": {
          "shape": {
            "fill": "f4e4c3",
            "outline": "b69858"
          }
        }
      },

      "remove-outline": {
        "value": "Outline removed",
        "styles": {
          "shape": {
            "outline": ""
          }
        }
      },
      "remove-fill": {
        "value": "Fill removed",
        "styles": {
          "shape": {
            "fill": ""
          }
        }
      }
    }
  ]
}