# Javascript: InputFormat.getFontFamily Method

> Gets the font family at the current input position.

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

---

### Description

Gets the font family at the current input position.

### Syntax

```javascript
<void> InputFormat.getFontFamily(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the font family at the current input position. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `InputFormat.getFontFamily` in a practical document-editing workflow. It gets the font family at the current input position.

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

TXTextControl.inputFormat.getFontFamily(
    function(result) {
        console.log("get font family result:", result);
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: InputFormat.getCentered Method](https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getcentered-method/llms-full.txt)
- **Next:** [Javascript: InputFormat.getFontSize Method](https://docs.textcontrol.com/ds-server/reference/javascript/inputformat/getfontsize-method/llms-full.txt)
