Javascript: Selection.setFontName Method
Description
Sets the font's name of the selected text.
Syntax
<void> Selection.setFontName(<string> fontName, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| fontName | The font's name of the selected text. |
| 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.setFontName in a practical document-editing workflow. It sets the font's name of the selected text.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.selection.setFontName(
"Arial",
function() {
console.log("set font name completed.");
},
onTxError
);