Font - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Maplets[Elements]

  

Font

  

specify a font

 

Calling Sequence

Parameters

Description

Examples

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.

withMapletsElements:

mapletMapletLabelThis is Serif,font=FontSerif,LabelThis is SansSerif,font=FontSansSerif,LabelThis is Monospaced,font=FontMonospaced,LabelThis is Dialog,font=FontDialog,LabelThis is DialogInput,font=FontDialogInput,ButtonOK,Shutdown:

MapletsDisplaymaplet

A Maplet application that displays various physical fonts.

maplet2MapletLabelItalic 12 point Helvetica,font=FontHelvetica,italic,12,LabelBold 14 point Times,font=FontTimes,bold,14,LabelRegular 10 point Courier,font=FontCourier,10,LabelRegular 12 point Symbol,font=FontSymbol,12,ButtonOK,Shutdown:

MapletsDisplaymaplet2

This Maplet application has an unrecognized family specified.

maplet3MapletLabelThis is the Null font.,font=FontNull,bold,14,ButtonOK,Shutdown:

MapletsDisplaymaplet3

See Also

Maplets/OtherElements

Maplets[Display]

Maplets[Elements]

Maplets[Elements][Label]

Maplets[Elements][Maplet]

Maplets[Elements][SetOption]

Maplets[Elements][Shutdown]

Maplets[Tools][Get]

Maplets[Tools][Set]

Overview of Maplet Applications