# Javascript: FormattingStyle.getCapitals Method

> Gets 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:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 30.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: FormattingStyle.getCapitals Method
- **494 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/getcapitals-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/getcapitals-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/getcapitals-method/llms-full.txt

---

### Description

Gets 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> FormattingStyle.getCapitals([<RequestCapitalsCallback> 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.getCapitals` in a practical document-editing workflow. It gets 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;
}

function inspectCapitals(formattingStyle) {
    formattingStyle.getCapitals(
        function(result) {
            if (!result) {
                console.warn("No capitals was returned.");
                return;
            }
            
            console.log("get capitals result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FormattingStyle.getBold Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/getbold-method/llms-full.txt)
- **Next:** [Javascript: FormattingStyle.getCharacterScaling Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattingstyle/getcharacterscaling-method/llms-full.txt)
