OPF

Search docs

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

    Stroke

    A line along an outline: a shape block's outline or a picture's frame (the picture key 'border' was renamed 'stroke' in 0.33, with no alias). DrawingML a:ln. 'none' removes the line.

    Metadata

    Definition
    #/$defs/Stroke
    Form
    2 inclusive forms (anyOf)
    Source
    spec/schemas/opf.schema.json

    Field index

    This definition uses the forms or value constraints below.

    anyOf 1 · const

    No line (a:ln with a:noFill), also on a shape whose style would draw one.

    Exact constraints for anyOf 1
    anyOf 1 schema
    {
      "type": "string",
      "const": "none",
      "description": "No line (a:ln with a:noFill), also on a shape whose style would draw one."
    }

    anyOf 2 · object

    FieldTypeReq.DefaultDescription
    colorref:ColorRef——Line color: any ColorRef (eight-digit hex keeps its alpha). Default the shape style's line color, or the slide's neutral line on a picture.
    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"
    gradientref:Gradient——A gradient line instead of a solid color (a:ln/a:gradFill).
    widthnumber——Line width in reference pixels at a 720-pixel short edge. 0 removes the line. Default 4/3 (1 point, PowerPoint's default line) on a shape, 2 on a picture.
    dashenum | array<number>——Dash pattern: a preset name or an array of dash and gap lengths in stroke widths.
    dash · Named choices (see schema for other values and constraints)
    "solid""dot""dash""longDash""dashDot""longDashDot""longDashDotDot""sysDot""sysDash""sysDashDot""sysDashDotDot"
    capenum——Line cap (a:ln cap flat, rnd, sq). Default flat.
    cap · Allowed values
    "flat""round""square"
    joinenum——Line join (a:miter, a:round, a:bevel). Default miter, PowerPoint's default line join.
    join · Allowed values
    "miter""round""bevel"
    miterLimitnumber——Miter join limit, as a multiple of the stroke width (a:miter lim). Default 8. Ignored by round and bevel joins.
    compoundenum——Compound line (a:ln cmpd sng, dbl, thickThin, thinThick, tri). Default single.
    compound · Allowed values
    "single""double""thickThin""thinThick""triple"
    alignenum——Where the line sits on the outline (a:ln algn ctr or in). Default center. PowerPoint draws inside-aligned lines only on closed outlines.
    align · Allowed values
    "center""inside"
    startref:Arrowhead——Arrowhead at the start of an open path (a:headEnd).
    endref:Arrowhead——Arrowhead at the end of an open path (a:tailEnd).
    sketchenum——Hand-drawn look (PowerPoint's Sketched line, ask:lineSketchStyleProps): curved, freehand or scribble. OPF computes the sketched outline from a seed and both engines draw it: the preview strokes it and the PPTX stores it, which PowerPoint draws as stored, so the two match. A stroked path's fill follows the sketched outline too. PowerPoint versions before 2021 draw the plain line.
    sketch · Allowed values
    "curved""freehand""scribble"

    color

    typeref:ColorRefrequirednodefault—

    Line color: any ColorRef (eight-digit hex keeps its alpha). Default the shape style's line color, or the slide's neutral line on a picture.

    Named choices are not exhaustive. See the schema for other values and constraints.
    color, color (anyOf 4).color · Named choices
    "accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "dark1", "dark2", "light1", "light2", "hyperlink", "followedHyperlink", "primary", "secondary", "accent", "background", "surface", "surfaceAlt", "text", "textSecondary"

    gradient

    typeref:Gradientrequirednodefault—

    A gradient line instead of a solid color (a:ln/a:gradFill).

    Named choices are not exhaustive. See the schema for other values and constraints.
    gradient.type · Allowed values
    "linear", "radial", "rectangle", "shape"
    gradient.stops[].color, gradient.stops[].color (anyOf 4).color · Named choices
    "accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "dark1", "dark2", "light1", "light2", "hyperlink", "followedHyperlink", "primary", "secondary", "accent", "background", "surface", "surfaceAlt", "text", "textSecondary"

    width

    typenumberrequirednodefault—

    Line width in reference pixels at a 720-pixel short edge. 0 removes the line. Default 4/3 (1 point, PowerPoint's default line) on a shape, 2 on a picture.

    dash

    typeenum | array<number>requirednodefault—

    Dash pattern: a preset name or an array of dash and gap lengths in stroke widths.

    dash · Named choices (see schema for other values and constraints)
    "solid""dot""dash""longDash""dashDot""longDashDot""longDashDotDot""sysDot""sysDash""sysDashDot""sysDashDotDot"

    cap

    typeenumrequirednodefault—

    Line cap (a:ln cap flat, rnd, sq). Default flat.

    cap · Allowed values
    "flat""round""square"
    cap.json
    {
      "cap": "flat"
    }

    join

    typeenumrequirednodefault—

    Line join (a:miter, a:round, a:bevel). Default miter, PowerPoint's default line join.

    join · Allowed values
    "miter""round""bevel"
    join.json
    {
      "join": "miter"
    }

    miterLimit

    typenumberrequirednodefault—

    Miter join limit, as a multiple of the stroke width (a:miter lim). Default 8. Ignored by round and bevel joins.

    compound

    typeenumrequirednodefault—

    Compound line (a:ln cmpd sng, dbl, thickThin, thinThick, tri). Default single.

    compound · Allowed values
    "single""double""thickThin""thinThick""triple"
    compound.json
    {
      "compound": "single"
    }

    align

    typeenumrequirednodefault—

    Where the line sits on the outline (a:ln algn ctr or in). Default center. PowerPoint draws inside-aligned lines only on closed outlines.

    align · Allowed values
    "center""inside"
    align.json
    {
      "align": "center"
    }

    start

    typeref:Arrowheadrequirednodefault—

    Arrowhead at the start of an open path (a:headEnd).

    start.type · Allowed values
    "none""triangle""stealth""diamond""oval""arrow"
    start.width · Allowed values
    "small""medium""large"
    start.length · Allowed values
    "small""medium""large"

    end

    typeref:Arrowheadrequirednodefault—

    Arrowhead at the end of an open path (a:tailEnd).

    end.type · Allowed values
    "none""triangle""stealth""diamond""oval""arrow"
    end.width · Allowed values
    "small""medium""large"
    end.length · Allowed values
    "small""medium""large"

    sketch

    typeenumrequirednodefault—

    Hand-drawn look (PowerPoint's Sketched line, ask:lineSketchStyleProps): curved, freehand or scribble. OPF computes the sketched outline from a seed and both engines draw it: the preview strokes it and the PPTX stores it, which PowerPoint draws as stored, so the two match. A stroked path's fill follows the sketched outline too. PowerPoint versions before 2021 draw the plain line.

    sketch · Allowed values
    "curved""freehand""scribble"
    sketch.json
    {
      "sketch": "curved"
    }
    Exact constraints for anyOf 2
    anyOf 2 schema
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "color": {
          "$ref": "#/$defs/ColorRef",
          "description": "Line color: any ColorRef (eight-digit hex keeps its alpha). Default the shape style's line color, or the slide's neutral line on a picture."
        },
        "gradient": {
          "$ref": "#/$defs/Gradient",
          "description": "A gradient line instead of a solid color (a:ln/a:gradFill)."
        },
        "width": {
          "type": "number",
          "minimum": 0,
          "maximum": 64,
          "description": "Line width in reference pixels at a 720-pixel short edge. 0 removes the line. Default 4/3 (1 point, PowerPoint's default line) on a shape, 2 on a picture."
        },
        "dash": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "solid",
                "dot",
                "dash",
                "longDash",
                "dashDot",
                "longDashDot",
                "longDashDotDot",
                "sysDot",
                "sysDash",
                "sysDashDot",
                "sysDashDotDot"
              ],
              "description": "DrawingML preset dash (a:prstDash). Default solid."
            },
            {
              "type": "array",
              "minItems": 2,
              "maxItems": 20,
              "items": {
                "type": "number",
                "exclusiveMinimum": 0,
                "maximum": 100
              },
              "description": "A custom dash (a:custDash): dash and gap lengths in stroke widths, alternating, for example [4, 2]. An odd count repeats."
            }
          ],
          "description": "Dash pattern: a preset name or an array of dash and gap lengths in stroke widths."
        },
        "cap": {
          "type": "string",
          "enum": [
            "flat",
            "round",
            "square"
          ],
          "description": "Line cap (a:ln cap flat, rnd, sq). Default flat."
        },
        "join": {
          "type": "string",
          "enum": [
            "miter",
            "round",
            "bevel"
          ],
          "description": "Line join (a:miter, a:round, a:bevel). Default miter, PowerPoint's default line join."
        },
        "miterLimit": {
          "type": "number",
          "minimum": 1,
          "maximum": 100,
          "description": "Miter join limit, as a multiple of the stroke width (a:miter lim). Default 8. Ignored by round and bevel joins."
        },
        "compound": {
          "type": "string",
          "enum": [
            "single",
            "double",
            "thickThin",
            "thinThick",
            "triple"
          ],
          "description": "Compound line (a:ln cmpd sng, dbl, thickThin, thinThick, tri). Default single."
        },
        "align": {
          "type": "string",
          "enum": [
            "center",
            "inside"
          ],
          "description": "Where the line sits on the outline (a:ln algn ctr or in). Default center. PowerPoint draws inside-aligned lines only on closed outlines."
        },
        "start": {
          "$ref": "#/$defs/Arrowhead",
          "description": "Arrowhead at the start of an open path (a:headEnd)."
        },
        "end": {
          "$ref": "#/$defs/Arrowhead",
          "description": "Arrowhead at the end of an open path (a:tailEnd)."
        },
        "sketch": {
          "type": "string",
          "enum": [
            "curved",
            "freehand",
            "scribble"
          ],
          "description": "Hand-drawn look (PowerPoint's Sketched line, ask:lineSketchStyleProps): curved, freehand or scribble. OPF computes the sketched outline from a seed and both engines draw it: the preview strokes it and the PPTX stores it, which PowerPoint draws as stored, so the two match. A stroked path's fill follows the sketched outline too. PowerPoint versions before 2021 draw the plain line."
        }
      }
    }
    Complete definition constraints
    Schema constraints
    {
      "anyOf": [
        {
          "type": "string",
          "const": "none",
          "description": "No line (a:ln with a:noFill), also on a shape whose style would draw one."
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "color": {
              "$ref": "#/$defs/ColorRef",
              "description": "Line color: any ColorRef (eight-digit hex keeps its alpha). Default the shape style's line color, or the slide's neutral line on a picture."
            },
            "gradient": {
              "$ref": "#/$defs/Gradient",
              "description": "A gradient line instead of a solid color (a:ln/a:gradFill)."
            },
            "width": {
              "type": "number",
              "minimum": 0,
              "maximum": 64,
              "description": "Line width in reference pixels at a 720-pixel short edge. 0 removes the line. Default 4/3 (1 point, PowerPoint's default line) on a shape, 2 on a picture."
            },
            "dash": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "solid",
                    "dot",
                    "dash",
                    "longDash",
                    "dashDot",
                    "longDashDot",
                    "longDashDotDot",
                    "sysDot",
                    "sysDash",
                    "sysDashDot",
                    "sysDashDotDot"
                  ],
                  "description": "DrawingML preset dash (a:prstDash). Default solid."
                },
                {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 20,
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 100
                  },
                  "description": "A custom dash (a:custDash): dash and gap lengths in stroke widths, alternating, for example [4, 2]. An odd count repeats."
                }
              ],
              "description": "Dash pattern: a preset name or an array of dash and gap lengths in stroke widths."
            },
            "cap": {
              "type": "string",
              "enum": [
                "flat",
                "round",
                "square"
              ],
              "description": "Line cap (a:ln cap flat, rnd, sq). Default flat."
            },
            "join": {
              "type": "string",
              "enum": [
                "miter",
                "round",
                "bevel"
              ],
              "description": "Line join (a:miter, a:round, a:bevel). Default miter, PowerPoint's default line join."
            },
            "miterLimit": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "description": "Miter join limit, as a multiple of the stroke width (a:miter lim). Default 8. Ignored by round and bevel joins."
            },
            "compound": {
              "type": "string",
              "enum": [
                "single",
                "double",
                "thickThin",
                "thinThick",
                "triple"
              ],
              "description": "Compound line (a:ln cmpd sng, dbl, thickThin, thinThick, tri). Default single."
            },
            "align": {
              "type": "string",
              "enum": [
                "center",
                "inside"
              ],
              "description": "Where the line sits on the outline (a:ln algn ctr or in). Default center. PowerPoint draws inside-aligned lines only on closed outlines."
            },
            "start": {
              "$ref": "#/$defs/Arrowhead",
              "description": "Arrowhead at the start of an open path (a:headEnd)."
            },
            "end": {
              "$ref": "#/$defs/Arrowhead",
              "description": "Arrowhead at the end of an open path (a:tailEnd)."
            },
            "sketch": {
              "type": "string",
              "enum": [
                "curved",
                "freehand",
                "scribble"
              ],
              "description": "Hand-drawn look (PowerPoint's Sketched line, ask:lineSketchStyleProps): curved, freehand or scribble. OPF computes the sketched outline from a seed and both engines draw it: the preview strokes it and the PPTX stores it, which PowerPoint draws as stored, so the two match. A stroked path's fill follows the sketched outline too. PowerPoint versions before 2021 draw the plain line."
            }
          }
        }
      ],
      "description": "A line along an outline: a shape block's outline or a picture's frame (the picture key 'border' was renamed 'stroke' in 0.33, with no alias). DrawingML a:ln. 'none' removes the line.",
      "examples": [
        "none",
        {
          "color": "accent1",
          "width": 2
        },
        {
          "color": "text",
          "width": 1.5,
          "dash": "dash",
          "end": {
            "type": "triangle"
          }
        },
        {
          "color": "#0F172A",
          "width": 12,
          "join": "round"
        }
      ]
    }
    value · Named choices (see schema for other values and constraints)
    "none"