TextSetFontFace @Command (Formula Language)

Displays selected or subsequently entered text using the specified typeface.

Syntax

@Command( [TextSetFontFace] ; typeface )

Parameters

typeface

Text. The name of the font you want. The list of available typefaces depends upon the platform you are using, and whether you are using any add-in typeface software. Click the left-most tab on the status bar for a list of available typefaces.

Usage

  • A document must be open in Edit mode with the insertion point in a rich text field

    or

  • A form, subform, or page must be open in Design mode

It is most convenient to use a toolbar button to invoke this command if the text is already selected.

This command does not work on the Web.

Examples

  1. This formula sets the font to Courier.
    @Command([TextSetFontFace]; "Courier")
  2. This formula, when added to the "Apply font" hotspot button, applies the font a user selects from the "fonts" Dialog list field (which derives its list of fonts by choosing to Use formula for choices and entering @FontList as the formula) to the text the user enters or highlights in the "Body" Rich Text field. If no font was selected from the dialog list, an error message displays which tells the user to select one.
    @Command([EditGoToField]);"Body");
    @Command([EditSelectAll]);
    result := @Command([TextSetFontSize];size);
    @If(@IsError(result);Prompt([Ok];"Error encountered";"You must enter a font size first");result)