TX Sheet Control

ServerSheetControl.getFontFile Method

Method

Reads a catalogued font for HTTP hosting without exposing trusted server paths.

Owner: ServerSheetControl. Package: @txtextcontrol/tx-sheet-control-server. Version: 2.0.0.

Syntax

await owner.getFontFile(fileName, hash)

Parameters

ParameterTypeOptionalDescription
fileNamestringNoThe unescaped basename from a catalog face URL.
hashstringNoSHA-256 content version from that URL; stale versions fail instead of changing bytes.

Return Value

Promise<Uint8Array<ArrayBufferLike>>.

Owned TrueType bytes identical to those used for PDF export.

Exceptions

Error if the file is unavailable, unsupported or no longer matches the requested version.

Examples

Pass an existing ServerSheetControl from the owning document. Related handles and input bytes must belong to the intended document and application; the function applies the operation and inspects its result.

async function inspectServerSheetControlGetFontFile(sheetControl, hash) {
    const result = await sheetControl['getFontFile']('LiberationSans-Regular.ttf', hash);
    console.log(result);
}

Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

See Also