FontResolutionRequest 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
| Property | Description |
|---|---|
| family | Original family requested by the document. |
| bold | Whether the requested text uses bold formatting. |
| italic | Whether the requested text uses italic formatting. |
| text | Existing text collected for this requested face; use it to choose a font with appropriate character coverage. |
| reason | Missing requests have no available full document/deployed face; coverage requests identify an incomplete embedded character set. |
| signal | Optional 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.