Javascript: FormattingStyle.getCharacterSpacing Method
Description
Gets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended.
Syntax
<void> FormattingStyle.getCharacterSpacing([<RequestNumberCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates FormattingStyle.getCharacterSpacing in a practical document-editing workflow. It gets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectCharacterSpacing(formattingStyle) {
formattingStyle.getCharacterSpacing(
function(result) {
console.log("get character spacing result:", result);
},
onTxError
);
}