Vector kit command

text.add

Create Text

Creates point or area type at x, y with text, size, font, colour and alignment options; answers its id. Use text.setText to change existing type.

Kit
Vector 0.1.0 (.kvector)
Changes the document
yes

Parameters

Parameters of text.add
NameTypeRequiredDescription
areaobjectno{width, height, fit?: none|autoHeight|shrinkText, fitMinPercent?}
charAlign"romanBaseline" | "emBoxTop" | "emBoxCenter" | "emBoxBottom" | "icfTop" | "icfBottom"nodefault: emBoxTop and emBoxCenter while the interface is in Japanese, else romanBaseline
colorstringno
fontstringno
leadingModel"romanBaseline" | "emBoxTop"no
placeholderbooleannofill it with placeholder text instead, as the Type tools do with prefs placeholderText
sizenumbernopoints
stylestringno
textstringno
verticalbooleanno
xnumberno
ynumberno

Call through vector_run

text
vector_run {
  "path": "<file>.kvector",
  "steps": [{ "command": "text.add" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: area, charAlign, color, font, leadingModel, placeholder, size, style, text, vertical, x, y. vector_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": {
    "area": {
      "additionalProperties": true,
      "description": "{width, height, fit?: none|autoHeight|shrinkText, fitMinPercent?}",
      "properties": {
        "fit": {
          "enum": [
            "none",
            "autoHeight",
            "shrinkText"
          ],
          "type": "string"
        },
        "fitMinPercent": {},
        "height": {
          "type": "number"
        },
        "width": {
          "type": "number"
        }
      },
      "type": "object"
    },
    "charAlign": {
      "description": "default: emBoxTop and emBoxCenter while the interface is in Japanese, else romanBaseline",
      "enum": [
        "romanBaseline",
        "emBoxTop",
        "emBoxCenter",
        "emBoxBottom",
        "icfTop",
        "icfBottom"
      ],
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "font": {
      "type": "string"
    },
    "leadingModel": {
      "enum": [
        "romanBaseline",
        "emBoxTop"
      ],
      "type": "string"
    },
    "placeholder": {
      "description": "fill it with placeholder text instead, as the Type tools do with prefs placeholderText",
      "type": "boolean"
    },
    "size": {
      "description": "points",
      "type": "number"
    },
    "style": {
      "type": "string"
    },
    "text": {
      "type": "string"
    },
    "vertical": {
      "default": false,
      "type": "boolean"
    },
    "x": {
      "type": "number"
    },
    "y": {
      "type": "number"
    }
  },
  "returns": "{id}; new area type gets Auto Size (fit autoHeight) when the autoSizeAreaType preference is on",
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (vector_commands through @kition/[email protected], built from KitionAI/kition-vector@7cf908f). As data: commands.jsonl.