---
title: "SetCharStyleCmd | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/SetCharStyleCmd/"
---

# SetCharStyleCmd

> The command to set the character style for the current cursor position or selected text.

## Classes

### SetCharStyleCmd

#### Remarks

only properties specified in the expected style are set.

#### Implements

- [`ICommand`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommand.md#icommand)

#### Constructors

##### Constructor

```ts
new SetCharStyleCmd(
   textManager, 
   fontRegistry, 
   initData): SetCharStyleCmd;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `textManager` | [`ITextManager`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ITextManager.md#itextmanager) |
| `fontRegistry` | [`IFontRegistry`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IFontRegistry.md#ifontregistry) |
| `initData` | [`SetCharStyleCmdData`](#setcharstylecmddata) |

###### Returns

[`SetCharStyleCmd`](#setcharstylecmd)

#### Methods

##### execute()

```ts
execute(): boolean;
```

Executes the command.

###### Returns

`boolean`

true if changes were made, false otherwise.

###### Implementation of

[`ICommand`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommand.md#icommand).[`execute`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommand.md#execute)

***

### SetCharStyleCmdData

Data required to initialize the command.

#### Constructors

##### Constructor

```ts
new SetCharStyleCmdData(): SetCharStyleCmdData;
```

###### Returns

[`SetCharStyleCmdData`](#setcharstylecmddata)

#### Properties

##### style

```ts
style: ICharStyle;
```

Character style.
