# ServerTextControl.OnAdaptFont Method

> Raises the AdaptFont event.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 15.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Server.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.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 Server > Reference > TXTextControl > ServerTextControl.OnAdaptFont Method
- **503 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/onadaptfont-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/onadaptfont-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/onadaptfont-method/llms-full.txt

---

### Description

Raises the AdaptFont event.

### Syntax

```csharp
protected virtual void OnAdaptFont(AdaptFontEventArgs e);
```

```vbnet
Protected Overridable Sub OnAdaptFont(e As AdaptFontEventArgs)
```

### Parameters

| Parameter | Description |
|---|---|
| e | Specifies an [AdaptFontEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/adaptfonteventargs/llms-full.txt) object that contains the event data. |

### Examples

The following example extends Server Text Control and performs custom processing when On Adapt Font is invoked.

```csharp
class CustomServerTextControl : ServerTextControl
{
    protected override void OnAdaptFont(AdaptFontEventArgs e)
    {
        // Add custom processing before registered event handlers run.
        base.OnAdaptFont(e);
    }
}
```

```vbnet
Class CustomServerTextControl
    Inherits ServerTextControl

    Protected Overrides Sub OnAdaptFont(e As AdaptFontEventArgs)
        ' Add custom processing before registered event handlers run.
        MyBase.OnAdaptFont(e)
    End Sub
End Class
```

---

## Nearby

- **Previous:** [ServerTextControl.MisspelledWords Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/misspelledwords-property/llms-full.txt)
- **Next:** [ServerTextControl.OnBarcodeCreated Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/onbarcodecreated-method/llms-full.txt)
