DocumentFontSource 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 |
|---|---|
| Family | Original font family. |
| Base64 | Base64 TrueType-outline bytes, limited to 32 MiB per face. |
| Bold | Bold face; omitted infers font metadata. |
| Italic | Italic face; omitted infers font metadata. |
| Aliases | Additional original workbook family names. |
| Fallback | Supply missing glyphs without replacing an available primary face. |
| 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);
}