# FormattingStyle.FontName Property

> Gets or sets the font of the style.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 10.1
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > FormattingStyle.FontName Property
- **507 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstyle/fontname-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstyle/fontname-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstyle/fontname-property/llms-full.txt

---

### Description

Gets or sets the font of the style.

### Syntax

```csharp
public string FontName { get; set; }
```

```vbnet
Public Property FontName As String
```

### Examples

The following example creates a reusable emphasis style and adds it to the document by using `FormattingStyle.FontName`.

```csharp
FormattingStyle formattingStyle = new InlineStyle("Emphasis");

formattingStyle.FontName = "Arial";
if (!string.IsNullOrWhiteSpace(formattingStyle.FontName))
{
    Console.WriteLine($"Font Name: {formattingStyle.FontName}");
}

textControl.InlineStyles.Add((InlineStyle)formattingStyle);
```

```vbnet
Dim formattingStyle As FormattingStyle = New InlineStyle("Emphasis")

formattingStyle.FontName = "Arial"
If Not String.IsNullOrWhiteSpace(formattingStyle.FontName) Then
    Console.WriteLine($"Font Name: {formattingStyle.FontName}")
End If

textControl.InlineStyles.Add(DirectCast(formattingStyle, InlineStyle))
```

---

## Nearby

- **Previous:** [FormattingStyle.Culture Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstyle/culture-property/llms-full.txt)
- **Next:** [FormattingStyle.FontSize Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formattingstyle/fontsize-property/llms-full.txt)
