FANDOM


Specifies the font of text in an object. Syntax:

set the textFont of [<chunk> of] <field> to <fontName> [, <language>]

Examples:

set the textFont of button "Hello" to "Courier"
set the textFont of the foundChunk to "Comic Sans"
set the textFont of field "Input" to "Arial,Japanese"
set the textFont of field "Text" to "Japanese"
set the textFont of button "Themed" to "(System UI Font - Messages)"
set the textFont of word 3 of field 1 to "Charcoal"

Use the textFont property to change the appearance of text.

Setting the textFont of an object to empty allows the textFont of the object's owner to show through. Use the effective keyword to find out what font is used for the object, even if its own textFont is empty.

If the chunk contains more than one font, the chunk's textFont property reports "mixed".

On Mac OS systems, if the specified font isn't available, the system font (which is set in the Appearance control panel and specifies the font used for menus) is used. On Unix systems, if the specified font isn't available, Helvetica is used. On Windows systems, if the specified font isn't available, the current Windows font is used.

To get the list of available fonts, use the fontNames function.

Some special font names can be used to request the themed fonts used for drawing UI elements. These are documented in the fontNames function.

Setting the textFont to `(Default)` causes the control to use the default font for that type of control rather than inheriting the font from a parent object.

See also: printTextFont (property),owner (property),printFontTable (property),allowInlineInput (property),HTMLText (property),