OPF

Search docs

Loading documentation…
    OpenPresentation/opf
    Browse docs
    On this page
    View source

    Text Run

    A contiguous run of text. Strings cover unformatted spans; object form adds character formatting.

    Metadata

    Definition
    #/$defs/TextRun
    Form
    2 alternative forms (oneOf)
    Source
    spec/schemas/opf.schema.json

    Field index

    This definition uses the forms or value constraints below.

    oneOf 1 · string

    Exact constraints for oneOf 1
    oneOf 1 schema
    {
      "type": "string"
    }

    oneOf 2 · object

    FieldTypeReq.DefaultDescription
    textstringyes—Text for this run.
    boldboolean——Whether the run is rendered in bold.
    italicboolean——Whether the run is rendered in italic.
    underlineboolean——Whether the run is underlined.
    strikethroughboolean——Whether the run is rendered with a strikethrough line.
    colorstring | ref:ColorTransform——Run text color. Documented forms: a hex string ('#RGB', '#RRGGBB', '#RRGGBBAA'), a color-scheme slot or role name resolved through the effective color scheme ('accent2', 'text'), or a 'var:<id>' reference into the top-level variables map. Prefer names over hex so runs survive re-theming. Or the lighter or darker object form of a ColorRef ({ "color": "accent1", "darken": 0.25 }). Any other string stays schema-valid so imported decks keep validating: validators warn and renderers fall back to the theme text color.
    fontSizenumber——Run font size in points, the unit presenters know from PowerPoint. One point is 4/3 reference pixels at a 720-pixel short edge, so 12 points corresponds to 16 reference pixels (composition.minFontSize: 16). Other fields state their own units, including inches, reference pixels, fractional geometry and chart data-axis values.
    fontFamilystring——Run font family override. It wins over the code font a run with 'code' takes.
    codeboolean——Whether the run is an inline code span: it is drawn in the design's code font (design.fontScheme.code, else the resolved font scheme's code family, else Roboto Mono), unless the run names its own fontFamily. Only the font changes; there is no background, because a PPTX run cannot have one. Markdown backticks read and write code runs.
    languagestring——BCP-47 language tag of the run, such as 'fr-FR' or 'ja-JP', when it differs from the deck language. It sets the proofing language (PPTX a:rPr lang) and the language the run's script fonts and glyph variants follow (for example the Japanese or the Simplified Chinese face for Han characters); without it the run follows the effective slide language, then the deck language.
    linkstring——URL to link the run text to: an http(s) URL, a 'mailto:' address or a 'tel:' number, without whitespace. The preview draws it as a link and PPTX export writes a native hyperlink for all three; any other scheme is not valid.
    superscriptboolean——Whether the run is rendered as superscript.
    subscriptboolean——Whether the run is rendered as subscript.
    citestring | array<string>——One or more ids from the top-level references list that this run cites. Engines draw a superscript marker ('1', or '1,2' for several ids) directly after the run and list '<n> <reference text>' in the slide's footnote area; markers are numbered per deck in order of first use, and the same id keeps its number. An id missing from references is a validation error (cite-unknown-reference). Supported in text, bullets and list item runs, in the slide title, subtitle and tag, and in the quote text.
    footnotestring | array<ref:TextRun>——An inline note for this run, without a references entry. Engines draw a superscript marker after the run and list the note in the slide's footnote area; every footnote takes a new number in the deck's marker sequence. Supported in text, bullets and list item runs, in the slide title, subtitle and tag, and in the quote text.

    text

    typestringrequiredyesdefault—

    Text for this run.

    text.json
    {
      "text": "Hello, "
    }

    bold

    typebooleanrequirednodefault—

    Whether the run is rendered in bold.

    italic

    typebooleanrequirednodefault—

    Whether the run is rendered in italic.

    underline

    typebooleanrequirednodefault—

    Whether the run is underlined.

    strikethrough

    typebooleanrequirednodefault—

    Whether the run is rendered with a strikethrough line.

    color

    typestring | ref:ColorTransformrequirednodefault—

    Run text color. Documented forms: a hex string ('#RGB', '#RRGGBB', '#RRGGBBAA'), a color-scheme slot or role name resolved through the effective color scheme ('accent2', 'text'), or a 'var:<id>' reference into the top-level variables map. Prefer names over hex so runs survive re-theming. Or the lighter or darker object form of a ColorRef ({ "color": "accent1", "darken": 0.25 }). Any other string stays schema-valid so imported decks keep validating: validators warn and renderers fall back to the theme text color.

    color (anyOf 2).color · Named choices (see schema for other values and constraints)
    "accent1""accent2""accent3""accent4""accent5""accent6""dark1""dark2""light1""light2""hyperlink""followedHyperlink""primary""secondary""accent""background""surface""surfaceAlt""text""textSecondary"
    color.json
    {
      "color": "#0F172A"
    }

    fontSize

    typenumberrequirednodefault—

    Run font size in points, the unit presenters know from PowerPoint. One point is 4/3 reference pixels at a 720-pixel short edge, so 12 points corresponds to 16 reference pixels (composition.minFontSize: 16). Other fields state their own units, including inches, reference pixels, fractional geometry and chart data-axis values.

    fontFamily

    typestringrequirednodefault—

    Run font family override. It wins over the code font a run with 'code' takes.

    fontFamily.json
    {
      "fontFamily": "Inter"
    }

    code

    typebooleanrequirednodefault—

    Whether the run is an inline code span: it is drawn in the design's code font (design.fontScheme.code, else the resolved font scheme's code family, else Roboto Mono), unless the run names its own fontFamily. Only the font changes; there is no background, because a PPTX run cannot have one. Markdown backticks read and write code runs.

    language

    typestringrequirednodefault—pattern^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$

    BCP-47 language tag of the run, such as 'fr-FR' or 'ja-JP', when it differs from the deck language. It sets the proofing language (PPTX a:rPr lang) and the language the run's script fonts and glyph variants follow (for example the Japanese or the Simplified Chinese face for Han characters); without it the run follows the effective slide language, then the deck language.

    language.json
    {
      "language": "fr-FR"
    }

    superscript

    typebooleanrequirednodefault—

    Whether the run is rendered as superscript.

    subscript

    typebooleanrequirednodefault—

    Whether the run is rendered as subscript.

    cite

    typestring | array<string>requirednodefault—

    One or more ids from the top-level references list that this run cites. Engines draw a superscript marker ('1', or '1,2' for several ids) directly after the run and list '<n> <reference text>' in the slide's footnote area; markers are numbered per deck in order of first use, and the same id keeps its number. An id missing from references is a validation error (cite-unknown-reference). Supported in text, bullets and list item runs, in the slide title, subtitle and tag, and in the quote text.

    cite.json
    {
      "cite": "gartner-2026"
    }

    footnote

    typestring | array<ref:TextRun>requirednodefault—

    An inline note for this run, without a references entry. Engines draw a superscript marker after the run and list the note in the slide's footnote area; every footnote takes a new number in the deck's marker sequence. Supported in text, bullets and list item runs, in the slide title, subtitle and tag, and in the quote text.

    footnote (oneOf 2)[] (oneOf 2).color (anyOf 2).color · Named choices (see schema for other values and constraints)
    "accent1""accent2""accent3""accent4""accent5""accent6""dark1""dark2""light1""light2""hyperlink""followedHyperlink""primary""secondary""accent""background""surface""surfaceAlt""text""textSecondary"
    footnote.json
    {
      "footnote": "Excludes the discontinued hardware line."
    }
    Exact constraints for oneOf 2
    oneOf 2 schema
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "description": "Text for this run.",
          "examples": [
            "Hello, ",
            "world"
          ]
        },
        "bold": {
          "type": "boolean",
          "description": "Whether the run is rendered in bold."
        },
        "italic": {
          "type": "boolean",
          "description": "Whether the run is rendered in italic."
        },
        "underline": {
          "type": "boolean",
          "description": "Whether the run is underlined."
        },
        "strikethrough": {
          "type": "boolean",
          "description": "Whether the run is rendered with a strikethrough line."
        },
        "color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/ColorTransform"
            }
          ],
          "description": "Run text color. Documented forms: a hex string ('#RGB', '#RRGGBB', '#RRGGBBAA'), a color-scheme slot or role name resolved through the effective color scheme ('accent2', 'text'), or a 'var:<id>' reference into the top-level variables map. Prefer names over hex so runs survive re-theming. Or the lighter or darker object form of a ColorRef ({ \"color\": \"accent1\", \"darken\": 0.25 }). Any other string stays schema-valid so imported decks keep validating: validators warn and renderers fall back to the theme text color.",
          "examples": [
            "#0F172A",
            "accent2",
            "var:risk",
            {
              "color": "accent1",
              "darken": 0.25
            }
          ]
        },
        "fontSize": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Run font size in points, the unit presenters know from PowerPoint. One point is 4/3 reference pixels at a 720-pixel short edge, so 12 points corresponds to 16 reference pixels (composition.minFontSize: 16). Other fields state their own units, including inches, reference pixels, fractional geometry and chart data-axis values."
        },
        "fontFamily": {
          "type": "string",
          "description": "Run font family override. It wins over the code font a run with 'code' takes.",
          "examples": [
            "Inter",
            "Source Serif Pro",
            "JetBrains Mono"
          ]
        },
        "code": {
          "type": "boolean",
          "description": "Whether the run is an inline code span: it is drawn in the design's code font (design.fontScheme.code, else the resolved font scheme's code family, else Roboto Mono), unless the run names its own fontFamily. Only the font changes; there is no background, because a PPTX run cannot have one. Markdown backticks read and write code runs."
        },
        "language": {
          "type": "string",
          "pattern": "^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",
          "description": "BCP-47 language tag of the run, such as 'fr-FR' or 'ja-JP', when it differs from the deck language. It sets the proofing language (PPTX a:rPr lang) and the language the run's script fonts and glyph variants follow (for example the Japanese or the Simplified Chinese face for Han characters); without it the run follows the effective slide language, then the deck language.",
          "examples": [
            "fr-FR",
            "ja-JP",
            "de"
          ]
        },
        "link": {
          "type": "string",
          "pattern": "^(https?://|mailto:|tel:)\\S+$",
          "description": "URL to link the run text to: an http(s) URL, a 'mailto:' address or a 'tel:' number, without whitespace. The preview draws it as a link and PPTX export writes a native hyperlink for all three; any other scheme is not valid.",
          "examples": [
            "https://acme.com",
            "https://acme.com/case-studies/beta",
            "mailto:hello@acme.com",
            "tel:+15551234567"
          ]
        },
        "superscript": {
          "type": "boolean",
          "description": "Whether the run is rendered as superscript."
        },
        "subscript": {
          "type": "boolean",
          "description": "Whether the run is rendered as subscript."
        },
        "cite": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          ],
          "description": "One or more ids from the top-level references list that this run cites. Engines draw a superscript marker ('1', or '1,2' for several ids) directly after the run and list '<n> <reference text>' in the slide's footnote area; markers are numbered per deck in order of first use, and the same id keeps its number. An id missing from references is a validation error (cite-unknown-reference). Supported in text, bullets and list item runs, in the slide title, subtitle and tag, and in the quote text.",
          "examples": [
            "gartner-2026",
            [
              "gartner-2026",
              "annual-report"
            ]
          ]
        },
        "footnote": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "array",
              "minItems": 1,
              "items": {
                "$ref": "#/$defs/TextRun"
              }
            }
          ],
          "description": "An inline note for this run, without a references entry. Engines draw a superscript marker after the run and list the note in the slide's footnote area; every footnote takes a new number in the deck's marker sequence. Supported in text, bullets and list item runs, in the slide title, subtitle and tag, and in the quote text.",
          "examples": [
            "Excludes the discontinued hardware line."
          ]
        }
      }
    }
    Complete definition constraints
    Schema constraints
    {
      "description": "A contiguous run of text. Strings cover unformatted spans; object form adds character formatting.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "text"
          ],
          "properties": {
            "text": {
              "type": "string",
              "description": "Text for this run.",
              "examples": [
                "Hello, ",
                "world"
              ]
            },
            "bold": {
              "type": "boolean",
              "description": "Whether the run is rendered in bold."
            },
            "italic": {
              "type": "boolean",
              "description": "Whether the run is rendered in italic."
            },
            "underline": {
              "type": "boolean",
              "description": "Whether the run is underlined."
            },
            "strikethrough": {
              "type": "boolean",
              "description": "Whether the run is rendered with a strikethrough line."
            },
            "color": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/$defs/ColorTransform"
                }
              ],
              "description": "Run text color. Documented forms: a hex string ('#RGB', '#RRGGBB', '#RRGGBBAA'), a color-scheme slot or role name resolved through the effective color scheme ('accent2', 'text'), or a 'var:<id>' reference into the top-level variables map. Prefer names over hex so runs survive re-theming. Or the lighter or darker object form of a ColorRef ({ \"color\": \"accent1\", \"darken\": 0.25 }). Any other string stays schema-valid so imported decks keep validating: validators warn and renderers fall back to the theme text color.",
              "examples": [
                "#0F172A",
                "accent2",
                "var:risk",
                {
                  "color": "accent1",
                  "darken": 0.25
                }
              ]
            },
            "fontSize": {
              "type": "number",
              "exclusiveMinimum": 0,
              "description": "Run font size in points, the unit presenters know from PowerPoint. One point is 4/3 reference pixels at a 720-pixel short edge, so 12 points corresponds to 16 reference pixels (composition.minFontSize: 16). Other fields state their own units, including inches, reference pixels, fractional geometry and chart data-axis values."
            },
            "fontFamily": {
              "type": "string",
              "description": "Run font family override. It wins over the code font a run with 'code' takes.",
              "examples": [
                "Inter",
                "Source Serif Pro",
                "JetBrains Mono"
              ]
            },
            "code": {
              "type": "boolean",
              "description": "Whether the run is an inline code span: it is drawn in the design's code font (design.fontScheme.code, else the resolved font scheme's code family, else Roboto Mono), unless the run names its own fontFamily. Only the font changes; there is no background, because a PPTX run cannot have one. Markdown backticks read and write code runs."
            },
            "language": {
              "type": "string",
              "pattern": "^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",
              "description": "BCP-47 language tag of the run, such as 'fr-FR' or 'ja-JP', when it differs from the deck language. It sets the proofing language (PPTX a:rPr lang) and the language the run's script fonts and glyph variants follow (for example the Japanese or the Simplified Chinese face for Han characters); without it the run follows the effective slide language, then the deck language.",
              "examples": [
                "fr-FR",
                "ja-JP",
                "de"
              ]
            },
            "link": {
              "type": "string",
              "pattern": "^(https?://|mailto:|tel:)\\S+$",
              "description": "URL to link the run text to: an http(s) URL, a 'mailto:' address or a 'tel:' number, without whitespace. The preview draws it as a link and PPTX export writes a native hyperlink for all three; any other scheme is not valid.",
              "examples": [
                "https://acme.com",
                "https://acme.com/case-studies/beta",
                "mailto:hello@acme.com",
                "tel:+15551234567"
              ]
            },
            "superscript": {
              "type": "boolean",
              "description": "Whether the run is rendered as superscript."
            },
            "subscript": {
              "type": "boolean",
              "description": "Whether the run is rendered as subscript."
            },
            "cite": {
              "oneOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              ],
              "description": "One or more ids from the top-level references list that this run cites. Engines draw a superscript marker ('1', or '1,2' for several ids) directly after the run and list '<n> <reference text>' in the slide's footnote area; markers are numbered per deck in order of first use, and the same id keeps its number. An id missing from references is a validation error (cite-unknown-reference). Supported in text, bullets and list item runs, in the slide title, subtitle and tag, and in the quote text.",
              "examples": [
                "gartner-2026",
                [
                  "gartner-2026",
                  "annual-report"
                ]
              ]
            },
            "footnote": {
              "oneOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "$ref": "#/$defs/TextRun"
                  }
                }
              ],
              "description": "An inline note for this run, without a references entry. Engines draw a superscript marker after the run and list the note in the slide's footnote area; every footnote takes a new number in the deck's marker sequence. Supported in text, bullets and list item runs, in the slide title, subtitle and tag, and in the quote text.",
              "examples": [
                "Excludes the discontinued hardware line."
              ]
            }
          }
        }
      ]
    }