TX Sheet Control

SaveOptions.embedUsedFonts Property

Property

Include resolved font files, including default fonts, when saving TXWB, XLSX or ODS with TX Sheet Control.

Syntax

embedUsedFonts?: boolean;

Defaults to false. Set true on an editor or server control to collect document font bytes from its configured catalog and document font sources. The exported snapshot includes them; the live workbook, font picker and styles do not change. An unavailable or restricted font, an unsupported output format, cancellation or a document change during collection rejects saving.

TXWB and ODS retain font resources. XLSX uses the TX font extension; Microsoft Excel does not provide this embedding option. If Arial resolves to Liberation Sans, the saved resource is Liberation Sans with a mapping from the original workbook name. PDF already embeds rendering fonts and does not need this setting. A standalone Workbook has no font catalog host: supply fonts.sources directly there.

Example

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

async function exportPortableInvoice(editor: ServerSheetControl) {
    return editor.save(StreamType.InternalWorkbookFormat, { embedUsedFonts: true });
}