Maplets[Elements] - Maple Programming Help

Home : Support : Online Help : Programming : Maplets : Elements : Other Elements : Maplets/Elements/Font

Maplets[Elements]

 Font
 specify a font

 Calling Sequence Font(opts) Font[refID](opts)

Parameters

 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

Description

 • 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 x italic x reference x size x

 • 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.

Examples

A Maplet application that displays the logical fonts.

 > $\mathrm{with}\left(\mathrm{Maplets}[\mathrm{Elements}]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left[\mathrm{Label}\left("This is Serif",'\mathrm{font}'=\mathrm{Font}\left("Serif"\right)\right)\right],\left[\mathrm{Label}\left("This is SansSerif",'\mathrm{font}'=\mathrm{Font}\left("SansSerif"\right)\right)\right],\left[\mathrm{Label}\left("This is Monospaced",'\mathrm{font}'=\mathrm{Font}\left("Monospaced"\right)\right)\right],\left[\mathrm{Label}\left("This is Dialog",'\mathrm{font}'=\mathrm{Font}\left("Dialog"\right)\right)\right],\left[\mathrm{Label}\left("This is DialogInput",'\mathrm{font}'=\mathrm{Font}\left("DialogInput"\right)\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\right)\right)\right]\right]\right):$
 > $\mathrm{Maplets}[\mathrm{Display}]\left(\mathrm{maplet}\right)$

A Maplet application that displays various physical fonts.

 > $\mathrm{maplet2}≔\mathrm{Maplet}\left(\left[\left[\mathrm{Label}\left("Italic 12 point Helvetica",'\mathrm{font}'=\mathrm{Font}\left("Helvetica",\mathrm{italic},12\right)\right)\right],\left[\mathrm{Label}\left("Bold 14 point Times",'\mathrm{font}'=\mathrm{Font}\left("Times",\mathrm{bold},14\right)\right)\right],\left[\mathrm{Label}\left("Regular 10 point Courier",'\mathrm{font}'=\mathrm{Font}\left("Courier",10\right)\right)\right],\left[\mathrm{Label}\left("Regular 12 point Symbol",'\mathrm{font}'=\mathrm{Font}\left("Symbol",12\right)\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\right)\right)\right]\right]\right):$
 > $\mathrm{Maplets}[\mathrm{Display}]\left(\mathrm{maplet2}\right)$

This Maplet application has an unrecognized family specified.

 > $\mathrm{maplet3}≔\mathrm{Maplet}\left(\left[\left[\mathrm{Label}\left("This is the Null font.",'\mathrm{font}'=\mathrm{Font}\left("Null",\mathrm{bold},14\right)\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\right)\right)\right]\right]\right):$
 > $\mathrm{Maplets}[\mathrm{Display}]\left(\mathrm{maplet3}\right)$