TX Sheet Control

FontRegistry Class

Class

Resolves document font faces and shapes glyph runs identically in browser and server rendering.

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

Related workbook object-model type, returned through the server control. Obtain it from its owning workbook or collection; it is not a required browser-package import.

Constructor

new FontRegistry()

This overload has no parameters.

Returns: FontRegistry.

Members

Properties

PropertyDescription
revisionMonotonic face-catalog revision, updated only when a face is registered.

Methods

MethodDescription
addAdd/replace a TrueType-outline font face.
hasCheck a family/weight/style face.
measureRead text width/ascent/descent.
shapeShape text into glyphs using a CSS font string.
snapshotCopy registered font faces.

Examples

Pass the FontRegistry value obtained from its owning control, collection, callback or operation. The function reads that value without constructing a replacement document object.

'use strict';

function inspectFontRegistryRevision(fontRegistry) {
    const value = fontRegistry['revision'];
    console.log('FontRegistry.revision', value);
}

See Also