Javascript: TXTextControl.AutoBaseline Enumeration
Description
Specifies how text is automatically sub- or superscripted.
Members
| Member | Description |
|---|---|
| Superscript | Text is moved above the baseline. |
| Subscript | Text is moved below the baseline. |
| SuperscriptUpperEdge | Text 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. |
| SubscriptBaseline | Text is scaled, but is not moved below the baseline. This can be used for denominators of diagonal fractions. |
| None | Text 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
);
}