TX Text Control .NET Server

Javascript: Selection.shrinkFont Method

Method|Introduced in 24.0

Description

Decreases the font size of each font contained in the current text selection. If no text is selected, this method decreases the font size at the text input position.

Syntax

<void> Selection.shrinkFont([<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates Selection.shrinkFont in a practical document-editing workflow. Decreases the font size of each font contained in the current text selection. If no text is selected, this method decreases the font size at the text input position.

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

TXTextControl.selection.shrinkFont(
    function() {
        console.log("shrink font completed.");
    },
    onTxError
);