TX Sheet Control

DocumentFontSource.Family Property

Property
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server as TXTextControl.TXSheetControl.Api.dll from the private NuGet feed or the supplied NuGet folder
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll

Original font family.

Syntax

public required string Family { get; init; }

Example

using TXTextControl.TXSheetControl.Server;

static async Task ConfigureInvoiceFontsAsync(ServerSheetControl control, byte[] workbookBytes, string fontPath)
{
    var options = new LoadOptions
    {
        Fonts = new DocumentFontOptions
        {
            Sources = [new DocumentFontSource
            {
                Family = "Invoice Sans",
                Base64 = Convert.ToBase64String(await File.ReadAllBytesAsync(fontPath))
            }]
        }
    };
    await control.LoadAsync(workbookBytes, StreamType.OpenDocumentSpreadsheet, options);
}