# ServerTextControl.AdaptFont Event

> Occurs for each font that must be adapted, because it is not supported. The event can occur if another printer is set with the ServerTextControl.FormattingPrinter property, if a document is loaded that contains a font which is not supported or if fonts have been restricted with the FontSettings.EmbeddableFontsOnly or the FontSettings.TrueTypeFontsOnly property. The event occurs only, if the FontSettings.AdaptFontEvent property has been set to true. The event handler receives an argument of type AdaptFontEventArgs containing data related to this event.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Event
- **Introduced:** 15.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > ServerTextControl.AdaptFont Event
- **465 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/adaptfont-event/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/adaptfont-event/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/adaptfont-event/llms-full.txt

---

### Description

Occurs for each font that must be adapted, because it is not supported. The event can occur if another printer is set with the [ServerTextControl.FormattingPrinter](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/formattingprinter-property/llms-full.txt) property, if a document is loaded that contains a font which is not supported or if fonts have been restricted with the [FontSettings.EmbeddableFontsOnly](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/fontsettings/embeddablefontsonly-property/llms-full.txt) or the [FontSettings.TrueTypeFontsOnly](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/fontsettings/truetypefontsonly-property/llms-full.txt) property. The event occurs only, if the [FontSettings.AdaptFontEvent](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/fontsettings/adaptfontevent-property/llms-full.txt) property has been set to true. The event handler receives an argument of type [AdaptFontEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/adaptfonteventargs/llms-full.txt) containing data related to this event.

### Syntax

```csharp
public event AdaptFontEventHandler AdaptFont;
```

```vbnet
Public Event AdaptFont As AdaptFontEventHandler
```

### Examples

The following example records useful context when adapt font occurs.

```csharp
textControl.AdaptFont += (sender, e) =>
{
    Console.WriteLine($"Font Name: {e.FontName}");
};
```

```vbnet
AddHandler textControl.AdaptFont,
    Sub(sender, e)
        Console.WriteLine($"Font Name: {e.FontName}")
    End Sub
```

---

## Nearby

- **Previous:** [ServerTextControl Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/llms-full.txt)
- **Next:** [ServerTextControl.Append Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/append-method/llms-full.txt)
