# Javascript: InputFormat.getSupportedFontSizes Method

> Gets an array of strings specifying all possible font sizes for the font at the text input position. If the font is free scalable, standard sizes are returned. The return value is the list of possible font sizes. Null is returned, if the specified font is not supported or if text is selected and the selection contains several different fonts.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: InputFormat.getSupportedFontSizes Method
- **490 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getsupportedfontsizes-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getsupportedfontsizes-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getsupportedfontsizes-method/llms-full.txt

---

### Description

Gets an array of strings specifying all possible font sizes for the font at the text input position. If the font is free scalable, standard sizes are returned. The return value is the list of possible font sizes. Null is returned, if the specified font is not supported or if text is selected and the selection contains several different fonts.

### Syntax

```javascript
<void> InputFormat.getSupportedFontSizes(<RequestNumbersCallback> callback, [<string> fontFamily], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives all possible font sizes as parameter. |
| fontFamily | Optional. Specifies a font family for the possible sizes of which are returned. It must be a font in the list of supported fonts which are returned through the [getFontFamilies](https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getsupportedfontfamilies-method/llms-full.txt) method. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `InputFormat.getSupportedFontSizes` in a practical document-editing workflow. It gets an array of strings specifying all possible font sizes for the font at the text input position. If the font is free scalable, standard sizes are returned. The return value is the list of possible font sizes. Null is returned, if the specified font is not supported or if text is selected and the selection contains several different fonts.

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

TXTextControl.inputFormat.getSupportedFontSizes(
    function(result) {
        console.log("get supported font sizes result:", result);
    },
    "Arial",
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: InputFormat.getSupportedFontFamilies Method](https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getsupportedfontfamilies-method/llms-full.txt)
- **Next:** [Javascript: InputFormat.getSupportedUnderlineStyles Method](https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getsupportedunderlinestyles-method/llms-full.txt)
