Utils

Utils class

Provides utility functions for loading font data, ICU data, and exception message handling.

Methods

MethodDescription
static loadICUData(string)Loads ICU data from a local file path.
static loadICUData(Uint8Array)Loads ICU data from Uint8Array.
static loadFonts(Uint8Array[])Loads multiple font data from Uint8Array array.
static loadFont(Uint8Array)Loads font data from Uint8Array.
static fetchWasmError(number)Fetches the error message from WebAssembly by the exception address.

loadICUData(string)

Loads ICU data from a local file path.

static loadICUData(dataFilePath: string) : void;

Parameters:

ParameterTypeDescription
dataFilePathstringThe ICU data file path.

loadICUData(Uint8Array) {loadICUData-uint8array-}

Loads ICU data from Uint8Array.

static loadICUData(stream: Uint8Array): void;

Parameters:

ParameterTypeDescription
streamUint8ArrayA stream that contains the ICU data.

loadFonts(Uint8Array[]) {loadFonts-uint8array-array-}

Loads multiple font data from Uint8Array array.

static loadFonts(sources: Uint8Array[]): void;

Parameters:

ParameterTypeDescription
sourcesUint8Array[]An array of sources that contain TrueType fonts.

loadFont(Uint8Array) {loadFont-uint8array-}

Loads font data from Uint8Array.

static loadFont(stream: Uint8Array): void;

Parameters:

ParameterTypeDescription
streamUint8ArrayA stream that contains the font data.

fetchWasmError(number) {fetchWasmError-number-}

Fetches the error message from WebAssembly by the exception address.

static fetchWasmError(err: number): string;

Parameters:

ParameterTypeDescription
errnumberThe exception address in WebAssembly.