TX Text Control .NET for WPF

AdaptFontEventArgs Class

Class|Introduced in 15.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Inherits
  1. EventArgs
  2. AdaptFontEventArgs

Description

The AdaptFontEventArgs class provides data for the TextControl.AdaptFont, WPF.TextControl.AdaptFont and ServerTextControl.AdaptFont events.

Syntax

public class AdaptFontEventArgs : EventArgs

Examples

The following example uses AdaptFontEventArgs.FontName while handling AdaptFont.

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

Members

Properties

PropertyDescription
AdaptedFontNameGets or sets the adapted font. When the event occurs the property contains the name of the font which replaces the original font. If the property is changed, TextControl uses the changed font to replace the original font. The font must be one of the fonts listed in the array of supported fonts. This array can be obtained with the AdaptFontEventArgs.SupportedFonts property.
FontNameGets the name of the original font which must be adapted.
SupportedFontsGets a list of all fonts currently supported.