# Javascript: FormattingStyle.setFontName Method

> Sets the font of the style.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FormattingStyle.setFontName Method
- **253 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setfontname-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setfontname-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setfontname-method/llms-full.txt

---

### Description

Sets the font of the style.

### Syntax

```javascript
<void> FormattingStyle.setFontName(<String> fontName, <EmptyRequestCallback> callback)
```

### Parameters

| Parameter | Description |
|---|---|
| fontName | The font's name of the style. |
| callback | Is called when the operation completed. |

### Examples

The following example demonstrates `FormattingStyle.setFontName` in a practical document-editing workflow. It sets the font of the style.

```javascript
function configureFontName(formattingStyle) {
    formattingStyle.setFontName(
        "Arial",
        function() {
            console.log("set font name completed.");
        }
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FormattingStyle.setCulture Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setculture-method/llms-full.txt)
- **Next:** [Javascript: FormattingStyle.setFontSize Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setfontsize-method/llms-full.txt)
