Doc kit command

format.state

Formatting at Selection

Answers the character and paragraph formatting at the selection (font, size, bold, italic, style, alignment…), as the ribbon shows it; on Chinese, Japanese or Korean text (`eastAsian`) the Font box shows the East Asian font (`fontEa`), and `fontShown` names the family that draws the shown font when this engine has no face of that name.

Kit
Doc 0.1.0 (.docx)
Changes the document
no

Parameters

None.

Call through doc_run

text
doc_run {
  "path": "<file>.docx",
  "steps": [{ "command": "format.state" }]
}

The required parameters, with placeholders for their types: not a tested example. doc_run answers the step’s result in completed[i].result.

Result

Result of format.state
NameTypeRequiredDescription
boldbooleanno
borderbooleanno
colorstringno
eastAsianbooleanno
fontstringno
fontEastringno
fontShownanyno
highlightanyno
italicbooleanno
sizenumberno
strikebooleanno
stylestringno
styleNamestringno
subscriptbooleanno
superscriptbooleanno
underlinebooleanno
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "bold": {
      "type": "boolean"
    },
    "border": {
      "type": "boolean"
    },
    "color": {
      "type": "string"
    },
    "eastAsian": {
      "type": "boolean"
    },
    "font": {
      "type": "string"
    },
    "fontEa": {
      "type": "string"
    },
    "fontShown": {},
    "highlight": {},
    "italic": {
      "type": "boolean"
    },
    "size": {
      "type": "number"
    },
    "strike": {
      "type": "boolean"
    },
    "style": {
      "type": "string"
    },
    "styleName": {
      "type": "string"
    },
    "subscript": {
      "type": "boolean"
    },
    "superscript": {
      "type": "boolean"
    },
    "underline": {
      "type": "boolean"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (doc_commands through @kition/[email protected], built from KitionAI/kition-doc@41e14a8). As data: commands.jsonl.