DS Server

Javascript: InputFormat.getFontSize Method

Method|Introduced in 28.0

Description

Gets the font's size, in points, at the current input position.

Syntax

<void> InputFormat.getFontSize(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the font size. Is null when the text selection contains multiple characters with mixed font sizes.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates InputFormat.getFontSize in a practical document-editing workflow. It gets the font's size, in points, at the current input position.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.inputFormat.getFontSize(
    function(result) {
        console.log("get font size result:", result);
    },
    onTxError
);