# Javascript: FormattingStyle.setCharacterScaling Method

> Sets or sets the style's character scaling, in percent of the average character width.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 30.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: FormattingStyle.setCharacterScaling Method
- **383 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/setcharacterscaling-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/setcharacterscaling-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/setcharacterscaling-method/llms-full.txt

---

### Description

Sets or sets the style's character scaling, in percent of the average character width.

### Syntax

```javascript
<void> FormattingStyle.setCharacterScaling(<number> characterScaling, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| characterScaling | The new value. |
| 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.setCharacterScaling` in a practical document-editing workflow. It sets or sets the style's character scaling, in percent of the average character width.

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

function configureCharacterScaling(formattingStyle) {
    formattingStyle.setCharacterScaling(
        80,
        function() {
            console.log("set character scaling completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FormattingStyle.setCapitals Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/setcapitals-method/llms-full.txt)
- **Next:** [Javascript: FormattingStyle.setCharacterSpacing Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/setcharacterspacing-method/llms-full.txt)
