DocumentFontSource Interface
Supply a document-scoped TrueType font face with base64 bytes, weight, style and fallback aliases for TX Sheet Control loading and saving.
Package: @txtextcontrol/tx-sheet-control/angular. This is a type-only contract.
Properties
| Property | Description |
|---|---|
| family | Font family used by the workbook; styles retain this name. |
| base64 | Base64-encoded TrueType-outline font bytes, limited to 32 MiB per face. |
| bold | Bold face; omitted infers the font metadata. |
| italic | Italic face; omitted infers the font metadata. |
| aliases | Additional workbook family names that this font face can resolve. |
| fallback | Use this face only for missing characters while retaining an available primary embedded face. |
Example
import { StreamType, type Spreadsheet, type DocumentFontSource } from '@txtextcontrol/tx-sheet-control';
async function loadInvoice(editor: Spreadsheet, inputBytes: Uint8Array, fontBase64: string) {
const face: DocumentFontSource = { family: 'Invoice Sans', base64: fontBase64 };
await editor.load(inputBytes, StreamType.OpenDocumentSpreadsheet, { fonts: { sources: [face] } });
}
Font registration is scoped to the loaded document. The shared renderer uses the same faces for editor layout and PDF output. A load failure or cancellation retains the existing workbook.