DocumentFontOptions Class
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
Configure document-local TrueType font resources and substitutions for TX Sheet Control loading and saving without installing operating-system fonts.
Members
| Member | Description |
|---|---|
| Sources | Document-local font bytes supplied at load/save time. |
| Substitutions | Original family to deployed or supplied family; cell formatting names are preserved. |
| Constructor | Create document font settings. |
Constructor
Create settings with an object initializer before loading or saving a workbook.
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);
}