TX Sheet Control

FontResolutionRequest Interface

Interface

Inspect a requested font family, style and text coverage during asynchronous TX Sheet Control document loading, with cancellation support.

Package: @txtextcontrol/tx-sheet-control-server. This is a type-only contract.

Properties

PropertyDescription
familyOriginal family requested by the document.
boldWhether the requested text uses bold formatting.
italicWhether the requested text uses italic formatting.
textExisting text collected for this requested face; use it to choose a font with appropriate character coverage.
reasonMissing requests have no available full document/deployed face; coverage requests identify an incomplete embedded character set.
signalOptional cancellation signal for the current load operation.

Example

import { StreamType, type ServerSheetControl, type DocumentFontLoadOptions } from '@txtextcontrol/tx-sheet-control-server';

async function loadInvoice(editor: ServerSheetControl, inputBytes: Uint8Array, fontBase64: string) {
    const fonts: DocumentFontLoadOptions = {
        resolve: async request => ({
            family: request.family,
            bold: request.bold,
            italic: request.italic,
            base64: fontBase64
        })
    };
    await editor.load(inputBytes, StreamType.OpenDocumentSpreadsheet, { fonts });
}

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.