Motion kit command

layer.setText

Edit Text

Edits a text layer: replaces `text` (whole or a character `range`) and sets character and paragraph formatting (`font`, `size`, `fill`, `stroke`, `tracking`, `leading`, `justify`, OpenType features, `box`). Keys the source text when animated.

Kit
Motion 0.1.0 (.kmotion)
Changes the document
yes
Acts on
layer (one id), which a run step’s on fills

Parameters

Parameters of layer.setText
NameTypeRequiredDescription
allCapsbooleanno
allSmallCapsbooleanno
applyFillbooleanno
applyStrokebooleanno
baseline"normal" | "superscript" | "subscript"no
baselineShiftnumbernopixels
boxany[]no[x,y,w,h]|null (layer space); layer space
compinteger | stringnoread by the command beside its listed parameters
composer"everyLine" | "singleLine"no
contextualAlternatesbooleanno
direction"ltr" | "rtl"no
discretionaryLigaturesbooleannoOpenType
fauxBoldbooleanno
fauxItalicbooleanno
figureStyle"default" | "lining" | "oldStyle"no
figureWidth"default" | "proportional" | "tabular"no
figuresanyno
fillstring | number[]noa colour, "#rrggbb" or [r, g, b] (0 to 1)
fontstringno
fractionsbooleanno
hScalenumbernopercent
hangingPunctuationbooleanno
indentFirstnumberno
indentLeftnumberno
indentRightnumberno
justify"left" | "center" | "right" | "justifyLeft" | "justifyCenter" | "justifyRight" | "justifyAll"no
kerning"metrics" | "optical" | numbernometrics|optical|number
layerinteger | stringno
leadingnumbernopx|"auto"
ligaturesbooleanno
mergestringnoread by the command beside its listed parameters
ordinalsbooleanno
rangenumber[]no[start, end]; characters; default all
sizenumberno
smallCapsbooleanno
spaceAfternumberno
spaceBeforenumberno
ss01booleannoOpenType stylistic set 1
ss02booleannoOpenType stylistic set 2
ss03booleannoOpenType stylistic set 3
ss04booleannoOpenType stylistic set 4
ss05booleannoOpenType stylistic set 5
ss06booleannoOpenType stylistic set 6
ss07booleannoOpenType stylistic set 7
ss08booleannoOpenType stylistic set 8
ss09booleannoOpenType stylistic set 9
ss10booleannoOpenType stylistic set 10
ss11booleannoOpenType stylistic set 11
ss12booleannoOpenType stylistic set 12
ss13booleannoOpenType stylistic set 13
ss14booleannoOpenType stylistic set 14
ss15booleannoOpenType stylistic set 15
ss16booleannoOpenType stylistic set 16
ss17booleannoOpenType stylistic set 17
ss18booleannoOpenType stylistic set 18
ss19booleannoOpenType stylistic set 19
ss20booleannoOpenType stylistic set 20
strokestring | number[]noa colour, "#rrggbb" or [r, g, b] (0 to 1)
strokeOverFillbooleanno
strokeWidthnumberno
stylestringno
stylisticAlternatesbooleanno
stylisticSetsany[]no[1–20]
subscriptbooleanno
superscriptbooleanno
swashbooleanno
textstringno
titlingbooleanno
trackingnumberno
tsumenumbernopercent
vScalenumbernopercent
variationsobjectnovariable font axes; null resets
verticalbooleanno

Call through motion_run

text
motion_run {
  "path": "<file>.kmotion",
  "steps": [{ "command": "layer.setText" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: allCaps, allSmallCaps, applyFill, applyStroke, baseline, baselineShift, box, comp, composer, contextualAlternates, direction, discretionaryLigatures, fauxBold, fauxItalic, figureStyle, figureWidth, figures, fill, font, fractions, hScale, hangingPunctuation, indentFirst, indentLeft, indentRight, justify, kerning, layer, leading, ligatures, merge, ordinals, range, size, smallCaps, spaceAfter, spaceBefore, ss01, ss02, ss03, ss04, ss05, ss06, ss07, ss08, ss09, ss10, ss11, ss12, ss13, ss14, ss15, ss16, ss17, ss18, ss19, ss20, stroke, strokeOverFill, strokeWidth, style, stylisticAlternates, stylisticSets, subscript, superscript, swash, text, titling, tracking, tsume, vScale, variations, vertical. motion_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "allCaps": {
      "type": "boolean"
    },
    "allSmallCaps": {
      "type": "boolean"
    },
    "applyFill": {
      "type": "boolean"
    },
    "applyStroke": {
      "type": "boolean"
    },
    "baseline": {
      "enum": [
        "normal",
        "superscript",
        "subscript"
      ],
      "type": "string"
    },
    "baselineShift": {
      "description": "pixels",
      "type": "number"
    },
    "box": {
      "description": "[x,y,w,h]|null (layer space); layer space",
      "items": {},
      "type": "array"
    },
    "comp": {
      "description": "read by the command beside its listed parameters",
      "oneOf": [
        {
          "description": "comp's item id as motion_inspect lists it",
          "type": "integer"
        },
        {
          "description": "the item id as receipts print it (\"1\"), or the comp's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Item"
      ]
    },
    "composer": {
      "enum": [
        "everyLine",
        "singleLine"
      ],
      "type": "string"
    },
    "contextualAlternates": {
      "type": "boolean"
    },
    "direction": {
      "enum": [
        "ltr",
        "rtl"
      ],
      "type": "string"
    },
    "discretionaryLigatures": {
      "description": "OpenType",
      "type": "boolean"
    },
    "fauxBold": {
      "type": "boolean"
    },
    "fauxItalic": {
      "type": "boolean"
    },
    "figureStyle": {
      "enum": [
        "default",
        "lining",
        "oldStyle"
      ],
      "type": "string"
    },
    "figureWidth": {
      "enum": [
        "default",
        "proportional",
        "tabular"
      ],
      "type": "string"
    },
    "figures": {},
    "fill": {
      "description": "a colour, \"#rrggbb\" or [r, g, b] (0 to 1)",
      "oneOf": [
        {
          "description": "#rrggbb",
          "type": "string"
        },
        {
          "description": "[r, g, b], 0 to 1",
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "font": {
      "type": "string"
    },
    "fractions": {
      "type": "boolean"
    },
    "hScale": {
      "description": "percent",
      "type": "number"
    },
    "hangingPunctuation": {
      "type": "boolean"
    },
    "indentFirst": {
      "type": "number"
    },
    "indentLeft": {
      "type": "number"
    },
    "indentRight": {
      "type": "number"
    },
    "justify": {
      "enum": [
        "left",
        "center",
        "right",
        "justifyLeft",
        "justifyCenter",
        "justifyRight",
        "justifyAll"
      ],
      "type": "string"
    },
    "kerning": {
      "description": "metrics|optical|number",
      "oneOf": [
        {
          "enum": [
            "metrics",
            "optical"
          ],
          "type": "string"
        },
        {
          "type": "number"
        }
      ]
    },
    "layer": {
      "oneOf": [
        {
          "description": "layer id as motion_inspect lists it (when no layer has that id, its 1-based stack position)",
          "type": "integer"
        },
        {
          "description": "layer id as receipts print it (\"51\"), a layer name, or #n for the n-th from the top",
          "type": "string"
        }
      ],
      "x-khp-index": "#",
      "x-khp-index-numbers": true,
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "leading": {
      "description": "px|\"auto\"",
      "type": "number"
    },
    "ligatures": {
      "type": "boolean"
    },
    "merge": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "ordinals": {
      "type": "boolean"
    },
    "range": {
      "description": "[start, end]; characters; default all",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "size": {
      "type": "number"
    },
    "smallCaps": {
      "type": "boolean"
    },
    "spaceAfter": {
      "type": "number"
    },
    "spaceBefore": {
      "type": "number"
    },
    "ss01": {
      "description": "OpenType stylistic set 1",
      "type": "boolean"
    },
    "ss02": {
      "description": "OpenType stylistic set 2",
      "type": "boolean"
    },
    "ss03": {
      "description": "OpenType stylistic set 3",
      "type": "boolean"
    },
    "ss04": {
      "description": "OpenType stylistic set 4",
      "type": "boolean"
    },
    "ss05": {
      "description": "OpenType stylistic set 5",
      "type": "boolean"
    },
    "ss06": {
      "description": "OpenType stylistic set 6",
      "type": "boolean"
    },
    "ss07": {
      "description": "OpenType stylistic set 7",
      "type": "boolean"
    },
    "ss08": {
      "description": "OpenType stylistic set 8",
      "type": "boolean"
    },
    "ss09": {
      "description": "OpenType stylistic set 9",
      "type": "boolean"
    },
    "ss10": {
      "description": "OpenType stylistic set 10",
      "type": "boolean"
    },
    "ss11": {
      "description": "OpenType stylistic set 11",
      "type": "boolean"
    },
    "ss12": {
      "description": "OpenType stylistic set 12",
      "type": "boolean"
    },
    "ss13": {
      "description": "OpenType stylistic set 13",
      "type": "boolean"
    },
    "ss14": {
      "description": "OpenType stylistic set 14",
      "type": "boolean"
    },
    "ss15": {
      "description": "OpenType stylistic set 15",
      "type": "boolean"
    },
    "ss16": {
      "description": "OpenType stylistic set 16",
      "type": "boolean"
    },
    "ss17": {
      "description": "OpenType stylistic set 17",
      "type": "boolean"
    },
    "ss18": {
      "description": "OpenType stylistic set 18",
      "type": "boolean"
    },
    "ss19": {
      "description": "OpenType stylistic set 19",
      "type": "boolean"
    },
    "ss20": {
      "description": "OpenType stylistic set 20",
      "type": "boolean"
    },
    "stroke": {
      "description": "a colour, \"#rrggbb\" or [r, g, b] (0 to 1)",
      "oneOf": [
        {
          "description": "#rrggbb",
          "type": "string"
        },
        {
          "description": "[r, g, b], 0 to 1",
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "strokeOverFill": {
      "type": "boolean"
    },
    "strokeWidth": {
      "type": "number"
    },
    "style": {
      "type": "string"
    },
    "stylisticAlternates": {
      "type": "boolean"
    },
    "stylisticSets": {
      "description": "[1–20]",
      "items": {},
      "type": "array"
    },
    "subscript": {
      "type": "boolean"
    },
    "superscript": {
      "type": "boolean"
    },
    "swash": {
      "type": "boolean"
    },
    "text": {
      "type": "string"
    },
    "titling": {
      "type": "boolean"
    },
    "tracking": {
      "type": "number"
    },
    "tsume": {
      "description": "percent",
      "type": "number"
    },
    "vScale": {
      "description": "percent",
      "type": "number"
    },
    "variations": {
      "additionalProperties": true,
      "description": "variable font axes; null resets",
      "properties": {
        "tag": {}
      },
      "type": "object"
    },
    "vertical": {
      "type": "boolean"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (motion_commands through @kition/[email protected], built from KitionAI/kition-motion@4719aa7). As data: commands.jsonl.