Maplets[Elements]
Font
specify a font
Calling Sequence
Parameters
Description
Examples
Font(opts)
Font[refID](opts)
opts
-
equation(s) of the form option=value where option is one of bold, family, italic, reference, or size; specify options for the Font element
refID
name or string; reference to the element
The Font element specifies a font for an element, for example, a Window element or TextBox element.
The Font element features can be modified by using options. To simplify specifying options in the Maplets package, certain options and contents can be set without using an equation. The following table lists elements, symbols, and types (in the left column) and the corresponding option or content (in the right column) to which inputs of this type are, by default, assigned.
Elements, Symbols, or Types
Assumed Option or Content
positive integer
size option
string or symbol
family option
A Font element cannot contain other elements.
A Font element can be contained in a Maplet element, in a font option equation, and as a parameter in an element that accepts a font. For example, a Button, CheckBox, ComboBox, DropDownBox, Label, ListBox, Menu, RadioButton, Table, TextBox, TextField, and ToggleButton all accept a font as an option equation.
The following table describes the control and use of the Font element options.
An x in the I column indicates that the option can be initialized, that is, specified in the calling sequence (element definition).
An x in the R column indicates that the option is required in the calling sequence.
An x in the G column indicates that the option can be read, that is, retrieved by using the Get tool.
An x in the S column indicates that the option can be written, that is, set by using the SetOption element or the Set tool.
Option
I
R
G
S
bold
x
family
italic
reference
size
The opts argument can contain one or more of the following equations that set Maplet application options.
bold = true or false
If this option is set to true, the font is displayed in boldface. By default, the value is false.
family = string or symbol
The font family, for example, Serif.
Two types of font families are available: logical fonts and physical fonts. The logical fonts are defined as Serif, SansSerif, Monospaced, Dialog, and DialogInput. These are not actual font names, but are instead functional definitions for different font styles for the specific platform on which the Maplet is running. Physical fonts are the actual font names. The physical fonts Courier, Helvetica, Symbol, and Times are always available. Check your operating system for other available fonts.
If no font family is specified, then the default font family used to display a label is applied. This value is operating system dependent.
Note: If the family specified is not recognized, the Unrecognized Font message dialog displays. To view the Maplet application using the default font, click OK. To determine which font families are recognized, click Valid fonts...
italic = true or false
If this option is set to true, the font is italicized. By default, the value is false.
reference = name or string
A reference for the Font element.
If the reference is specified by both an index, for example, Font[refID], and a reference in the calling sequence, the index reference takes precedence.
size = posint
The font size. If no font size is specified, then the default font size used to display a label is applied. This value is operating system dependent, and allows a font specification to scale up if the relevant accessibility option is adjusted. In general, the default value is usually 12.
Notes:
Specification of a Font element may prevent the Maplet from working correctly with operating system specified accessibility options (if a point size is specified), or may look inconsistent with other applications on a platform. To partially alleviate this, it should be used with a minimum number of options, and logical font names should be used when possible.
For example, if a bold font is needed, then Font(bold=true) should be used, allowing the default point size and font family to be used. As another example, if a fixed width font is required to display code, then Font(family="Monospaced") should be used.
A Maplet application that displays the logical fonts.
with⁡MapletsElements:
maplet≔Maplet⁡Label⁡This is Serif,font=Font⁡Serif,Label⁡This is SansSerif,font=Font⁡SansSerif,Label⁡This is Monospaced,font=Font⁡Monospaced,Label⁡This is Dialog,font=Font⁡Dialog,Label⁡This is DialogInput,font=Font⁡DialogInput,Button⁡OK,Shutdown⁡:
MapletsDisplay⁡maplet
A Maplet application that displays various physical fonts.
maplet2≔Maplet⁡Label⁡Italic 12 point Helvetica,font=Font⁡Helvetica,italic,12,Label⁡Bold 14 point Times,font=Font⁡Times,bold,14,Label⁡Regular 10 point Courier,font=Font⁡Courier,10,Label⁡Regular 12 point Symbol,font=Font⁡Symbol,12,Button⁡OK,Shutdown⁡:
MapletsDisplay⁡maplet2
This Maplet application has an unrecognized family specified.
maplet3≔Maplet⁡Label⁡This is the Null font.,font=Font⁡Null,bold,14,Button⁡OK,Shutdown⁡:
MapletsDisplay⁡maplet3
See Also
Maplets/OtherElements
Maplets[Display]
Maplets[Elements][Label]
Maplets[Elements][Maplet]
Maplets[Elements][SetOption]
Maplets[Elements][Shutdown]
Maplets[Tools][Get]
Maplets[Tools][Set]
Overview of Maplet Applications
Download Help Document