The 'font' property
A character vector or nested vector
Valid for: Document, Static, Label, Grid, Edit, RichEdit, Button, ToolButton, Radio, Check, List, Combo, Page, Selector, Frame, ChooseFont (Windows and Linux only), Printer, Chart
The font in which text objects display their text is set by the font property. In general, this is a nested vector of four elements, but you do not have to supply all four, and if you supply a simple character vector it will be taken as the font name. The four elements are:
1. Font name as a character vector. If you specify an empty vector, the font is unchanged. Otherwise you can specify the name of the font you want to use. If you specify a font which is not installed, or which is not compatible with the other characteristics you specify, the system will choose an alternative font for you. To select the APL font, you can specify either 'APLX Mac' or 'APLX Upright'.
2. Font size, in the current units of the object (see the scale property).
3. Font style as an integer scalar, from one of the following:
0 Plain 1 Bold 2 Italic 4 Underlined 8 Hollow (supported under MacOS only) 16 Strikeout (not supported under MacOS)
You can also specify the sum of these, for example 3 for Bold and Italic.
4. The name of the font character set, as a character vector. On the Macintosh, this is always 'mac'. Under Windows or Linux, this is one of 'ansi' 'default', 'symbol' 'mac' 'greek' 'turkish' 'baltic' 'easteurope' and 'oem'. The character set is used to select a version of the font capable of displaying characters appropriate to the chosen locale.
For example, if the scale property is currently set to 3 (points), and you want a particular object to display in 16-point Helvetica italic, you might enter:
Win19.Subtitle.font←'Helvetica' 16 2
Note: Remember that the default scale is in character units, so that if you have not changed the scale property the above example would give a font 16 times the default size, or 256 points.
The default font depends on the system and the user's default settings.
For a Chart object, the Size parameter of the font property is ignored. The property is used to determine the base font of the Chart, which by default is used to draw each text element of the Chart at a size which depends on the window size.
Under Windows or Linux, you can ask the user to select a font using the ChooseFont pre-defined dialog. Before showing the dialog using the Show method, you can set the font property to choose the initial selection which will be displayed when it appears. When the user has made the selection, read back the font property to retrieve the selected font and style.
Copyright © 1996-2010 MicroAPL Ltd