DS Server

Javascript: TXTextControl.AutoBaseline Enumeration

Enumeration|Introduced in 30.0

Description

Specifies how text is automatically sub- or superscripted.

Members

MemberDescription
SuperscriptText is moved above the baseline.
SubscriptText is moved below the baseline.
SuperscriptUpperEdgeText is scaled und moved above the baseline. The moved text does not extend above the upper edge of capital letters. This can be used for nominators of diagonal fractions.
SubscriptBaselineText is scaled, but is not moved below the baseline. This can be used for denominators of diagonal fractions.
NoneText is scaled, but is not moved below the baseline. This can be used for denominators of diagonal fractions.

Examples

The following example uses TXTextControl.AutoBaseline.Superscript (text is moved above the baseline.) in a document-editing workflow.

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

function applyAutoBaseline(formattingStyle) {
    formattingStyle.setAutoBaseline(
        TXTextControl.AutoBaseline.Superscript,
        function() {
            console.log("set auto baseline completed.");
        },
        onTxError
    );
}