TX Sheet Control

DocumentFontSource Interface

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

PropertyDescription
familyFont family used by the workbook; styles retain this name.
base64Base64-encoded TrueType-outline font bytes, limited to 32 MiB per face.
boldBold face; omitted infers the font metadata.
italicItalic face; omitted infers the font metadata.
aliasesAdditional workbook family names that this font face can resolve.
fallbackUse 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.