Motion kit command

layer.newText

Text

Adds a text layer with `text` (point text at `position`, or paragraph text in `box` [x, y, w, h]) and character options: `font`, `size`, `fill`, `stroke`, `tracking`, `leading`, `justify`. Edit it later with layer.setText. Returns the layer.

Kit
Motion 0.1.0 (.kmotion)
Changes the document
yes

Parameters

Parameters of layer.newText
NameTypeRequiredDescription
allCapsbooleanno
applyFillbooleanno
applyStrokebooleanno
baselinestringno
baselineShiftnumberno
boxnumber[]noparagraph text, comp space
compinteger | stringnoread by the command beside its listed parameters
composerstringno
directionstringno
editbooleannostart editing
fauxBoldbooleanno
fauxItalicbooleanno
fillstring | number[]noa colour, "#rrggbb" or [r, g, b] (0 to 1)
fontstringno
hScalenumberno
hangingPunctuationbooleanno
indentFirstnumberno
indentLeftnumberno
indentRightnumberno
justifystringno
kerning"metrics" | "optical" | numberno
leadingnumberno
ligaturesbooleanno
namestringnolayer name; default the text
positionnumber[]no
sizenumberno
smallCapsbooleanno
spaceAfternumberno
spaceBeforenumberno
strokestring | number[]noa colour, "#rrggbb" or [r, g, b] (0 to 1)
strokeOverFillbooleanno
strokeWidthnumberno
stylestringno
subscriptbooleanno
superscriptbooleanno
textstringno
trackingnumberno
tsumenumberno
vScalenumberno
verticalbooleanno

Call through motion_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: allCaps, applyFill, applyStroke, baseline, baselineShift, box, comp, composer, direction, edit, fauxBold, fauxItalic, fill, font, hScale, hangingPunctuation, indentFirst, indentLeft, indentRight, justify, kerning, leading, ligatures, name, position, size, smallCaps, spaceAfter, spaceBefore, stroke, strokeOverFill, strokeWidth, style, subscript, superscript, text, tracking, tsume, vScale, 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"
    },
    "applyFill": {
      "type": "boolean"
    },
    "applyStroke": {
      "type": "boolean"
    },
    "baseline": {
      "type": "string"
    },
    "baselineShift": {
      "type": "number"
    },
    "box": {
      "description": "paragraph text, comp space",
      "items": {
        "type": "number"
      },
      "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": {
      "type": "string"
    },
    "direction": {
      "type": "string"
    },
    "edit": {
      "description": "start editing",
      "type": "boolean"
    },
    "fauxBold": {
      "type": "boolean"
    },
    "fauxItalic": {
      "type": "boolean"
    },
    "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"
    },
    "hScale": {
      "type": "number"
    },
    "hangingPunctuation": {
      "type": "boolean"
    },
    "indentFirst": {
      "type": "number"
    },
    "indentLeft": {
      "type": "number"
    },
    "indentRight": {
      "type": "number"
    },
    "justify": {
      "type": "string"
    },
    "kerning": {
      "oneOf": [
        {
          "enum": [
            "metrics",
            "optical"
          ],
          "type": "string"
        },
        {
          "type": "number"
        }
      ]
    },
    "leading": {
      "type": "number"
    },
    "ligatures": {
      "type": "boolean"
    },
    "name": {
      "description": "layer name; default the text",
      "type": "string"
    },
    "position": {
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "size": {
      "type": "number"
    },
    "smallCaps": {
      "type": "boolean"
    },
    "spaceAfter": {
      "type": "number"
    },
    "spaceBefore": {
      "type": "number"
    },
    "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"
    },
    "subscript": {
      "type": "boolean"
    },
    "superscript": {
      "type": "boolean"
    },
    "text": {
      "type": "string"
    },
    "tracking": {
      "type": "number"
    },
    "tsume": {
      "type": "number"
    },
    "vScale": {
      "type": "number"
    },
    "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.