# Javascript: Selection.setCapitals Method

> Sets values specifying wheather lowercase letters are displayed with capital letters. Lowercase letters are displayed either with capital letters of the same size or with capital letters which have a smaller size. The smaller size is either the size of the lowercase 'x' (petite caps) or the size of the lowercase 'x' + 10% (small caps).

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 30.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: Selection.setCapitals Method
- **434 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/selection/setcapitals-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/selection/setcapitals-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/selection/setcapitals-method/llms-full.txt

---

### Description

Sets values specifying wheather lowercase letters are displayed with capital letters. Lowercase letters are displayed either with capital letters of the same size or with capital letters which have a smaller size. The smaller size is either the size of the lowercase 'x' (petite caps) or the size of the lowercase 'x' + 10% (small caps).

### Syntax

```javascript
<void> Selection.setCapitals(<Capitals> capitals, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

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

### Examples

The following example demonstrates `Selection.setCapitals` in a practical document-editing workflow. It sets values specifying wheather lowercase letters are displayed with capital letters. Lowercase letters are displayed either with capital letters of the same size or with capital letters which have a smaller size. The smaller size is either the size of the lowercase 'x' (petite caps) or the size of the lowercase 'x' + 10% (small caps).

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

TXTextControl.selection.setCapitals(
    TXTextControl.Capitals.Capitals,
    function() {
        console.log("set capitals completed.");
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: Selection.setBounds Method](https://docs.textcontrol.com/ds-server/reference/javascript/selection/setbounds-method/llms-full.txt)
- **Next:** [Javascript: Selection.setCharacterScaling Method](https://docs.textcontrol.com/ds-server/reference/javascript/selection/setcharacterscaling-method/llms-full.txt)
