# Javascript: FormattingStyle.getCharacterSpacing Method

> Gets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 30.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FormattingStyle.getCharacterSpacing Method
- **380 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/getcharacterspacing-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/getcharacterspacing-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/getcharacterspacing-method/llms-full.txt

---

### Description

Gets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended.

### Syntax

```javascript
<void> FormattingStyle.getCharacterSpacing([<RequestNumberCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `FormattingStyle.getCharacterSpacing` in a practical document-editing workflow. It gets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectCharacterSpacing(formattingStyle) {
    formattingStyle.getCharacterSpacing(
        function(result) {
            console.log("get character spacing result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FormattingStyle.getCharacterScaling Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/getcharacterscaling-method/llms-full.txt)
- **Next:** [Javascript: FormattingStyle.getCulture Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/getculture-method/llms-full.txt)
