# TextControl.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 TextControl.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.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > TextControl.AdaptFont Event
- **463 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/adaptfont-event/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/adaptfont-event/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/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 [TextControl.FormattingPrinter](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/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:** [TextControl.AcceptsTabChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/acceptstabchanged-event/llms-full.txt)
- **Next:** [TextControl.AddSymbolDialog Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/addsymboldialog-method/llms-full.txt)
