Skip to main content
A newer version of this page is available. .

ChangeFontNameCommand.execute(fontName) Method

Executes the ChangeFontNameCommand command by applying the specified setting.

May result in taking no action if the command’s state does not allow command execution. Use the object’s getState method to check the command state.

Declaration

execute(
    fontName: string
): boolean

Parameters

Name Type Description
fontName string

A string specifying the font name.

Returns

Type Description
boolean

A Boolean value identifying whether method execution was successful or failed.

Remarks

The execute method checks the command state (obtained using the getState method) before executing, and decides whether the action can be performed.

You can get the full list of the supported fonts via calling the following command:


richEdit.commands.changeFontName.fontNames;

Usage example:


richEdit.commands.changeFontName.execute("Arial");
richEdit.commands.changeFontName.execute(richEdit.commands.changeFontName.fontNames[1]);
See Also