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’sonfills
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
allCaps | boolean | no | |
baselineShift | number | no | points |
charAlign | "romanBaseline" | "emBoxTop" | "emBoxCenter" | "emBoxBottom" | "icfTop" | "icfBottom" | no | |
end | integer | no | 0 to 255; default: all text |
features | string[] | no | |
fill | string | no | a colour such as #rrggbb |
font | string | no | |
hScale | number | no | percent |
id | integer | no | object ID |
kerning | number | "auto" | no | |
leading | number | "auto" | no | |
position | "normal" | "superscript" | "subscript" | no | sizes from Document Setup |
rotation | number | no | degrees |
size | number | no | points |
smallCaps | boolean | no | |
start | integer | no | 0 to 255 |
strikethrough | boolean | no | |
stroke | string | no | a colour such as #rrggbb |
strokeOptions | object | no | {weight?, cap?, join?, miterLimit?, dash?, dashOffset?, alignDashes?} (as stroke.set: the character stroke); as stroke.set: the character stroke |
strokeWidth | number | no | points |
style | string | no | |
tracking | number | no | |
underline | boolean | no | |
vScale | number | no | percent |
Call through vector_run
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
{
"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.