Vector kit command

text.setRangeStyle

Character

Sets character attributes on a byte range of one type object (default all its text): font, size, leading, tracking, kerning, scale, rotation, fill, stroke and more.

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

Parameters

Parameters of text.setRangeStyle
NameTypeRequiredDescription
allCapsbooleanno
baselineShiftnumbernopoints
charAlign"romanBaseline" | "emBoxTop" | "emBoxCenter" | "emBoxBottom" | "icfTop" | "icfBottom"no
endintegerno0 to 255; default: all text
featuresstring[]no
fillstringnoa colour such as #rrggbb
fontstringno
hScalenumbernopercent
idintegernoobject ID
kerningnumber | "auto"no
leadingnumber | "auto"no
position"normal" | "superscript" | "subscript"nosizes from Document Setup
rotationnumbernodegrees
sizenumbernopoints
smallCapsbooleanno
startintegerno0 to 255
strikethroughbooleanno
strokestringnoa colour such as #rrggbb
strokeOptionsobjectno{weight?, cap?, join?, miterLimit?, dash?, dashOffset?, alignDashes?} (as stroke.set: the character stroke); as stroke.set: the character stroke
strokeWidthnumbernopoints
stylestringno
trackingnumberno
underlinebooleanno
vScalenumbernopercent

Call through vector_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: allCaps, baselineShift, charAlign, end, features, fill, font, hScale, id, kerning, leading, position, rotation, size, smallCaps, start, strikethrough, stroke, strokeOptions, strokeWidth, style, tracking, underline, vScale. 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": {
    "allCaps": {
      "type": "boolean"
    },
    "baselineShift": {
      "description": "points",
      "type": "number"
    },
    "charAlign": {
      "enum": [
        "romanBaseline",
        "emBoxTop",
        "emBoxCenter",
        "emBoxBottom",
        "icfTop",
        "icfBottom"
      ],
      "type": "string"
    },
    "end": {
      "description": "0 to 255; default: all text",
      "type": "integer"
    },
    "features": {
      "items": {
        "description": "like dlig",
        "type": "string"
      },
      "type": "array"
    },
    "fill": {
      "description": "a colour such as #rrggbb",
      "type": "string"
    },
    "font": {
      "type": "string"
    },
    "hScale": {
      "description": "percent",
      "type": "number"
    },
    "id": {
      "description": "object ID",
      "type": "integer",
      "x-khp-types": [
        "Node"
      ]
    },
    "kerning": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "enum": [
            "auto"
          ],
          "type": "string"
        }
      ]
    },
    "leading": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "enum": [
            "auto"
          ],
          "type": "string"
        }
      ]
    },
    "position": {
      "description": "sizes from Document Setup",
      "enum": [
        "normal",
        "superscript",
        "subscript"
      ],
      "type": "string"
    },
    "rotation": {
      "description": "degrees",
      "type": "number"
    },
    "size": {
      "description": "points",
      "type": "number"
    },
    "smallCaps": {
      "type": "boolean"
    },
    "start": {
      "description": "0 to 255",
      "type": "integer"
    },
    "strikethrough": {
      "type": "boolean"
    },
    "stroke": {
      "description": "a colour such as #rrggbb",
      "type": "string"
    },
    "strokeOptions": {
      "additionalProperties": true,
      "description": "{weight?, cap?, join?, miterLimit?, dash?, dashOffset?, alignDashes?} (as stroke.set: the character stroke); as stroke.set: the character stroke",
      "properties": {
        "alignDashes": {},
        "cap": {},
        "dash": {},
        "dashOffset": {},
        "join": {},
        "miterLimit": {},
        "weight": {
          "type": "number"
        }
      },
      "type": "object"
    },
    "strokeWidth": {
      "description": "points",
      "type": "number"
    },
    "style": {
      "type": "string"
    },
    "tracking": {
      "type": "number"
    },
    "underline": {
      "type": "boolean"
    },
    "vScale": {
      "description": "percent",
      "type": "number"
    }
  },
  "returns": "{id, runs}",
  "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.