TX Text Control .NET for WPF

AdaptFont Event

Event|Introduced in 15.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.Server.dll from the private NuGet feed or Text Control Offline Packages

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 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.

Syntax

public event AdaptFontEventHandler AdaptFont;

Examples

The following example records useful context when adapt font occurs.

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