Fonts

data_font = “text”

listboxes, tables, textboxes, windows

label_font = “text”

buttons, listboxes, OLE controls, static text, tables, textboxes, windows

title_font = “text”

tables, windows

caption_font = “text”

windows

Fonts may be specified for the display of all text displayed in a Sculptor window.

Default fonts for the display of data, label text and table titles can be defined at window level. Any of these values can be overridden for any individual control in the window. Clauses are also available to define the font for display of all captions in a window, and the ambient font for an OLE control.

Whichever the clause, the structure of the font definition is the same.


Structure of a font definition

The “text” must be one of the following:

font_family

font_family, style

font_family@size

font_family, style@size

“,*style*”

“@*size*”

“,*style*@size

The font_family is the font family name, such as “courier”, or “helvetica”. If the requested font is not available on the system, the default is used. Certain font names are defined in $SCULPTOR/include/sculptor.h. See Font names for a list of the fonts currently defined. Note however that all the native installed fonts are also available.

The size is the size in points, e.g. 10, 12. If this is not stated, Sculptor calculates the point size which will best fit the display resolution.

The style may be any combination of the following characters:

None

Normal (default)

b

Bold

i

Italic

u

Underline

o

Outline

s

Shadow

v

Inverse

l

Blink

t

Strikeout

Note the difference between assigning to a control a font in the form (a) “font_family@size” and (b) “font_family,@size”. In (a), the style component is missing altogether and so the style is inherited from the parent window. For example, if this is a data_font clause and the parent window specifies bold style in its data_font definition, the control inherits this style. In (b), the comma, without any accompanying style characters, specifies the normal font style.

Environment variables can be embedded in font strings. Examples:

label_font = “$MYFONT@12

data_font = “$MYFONT@$MYFONT_SIZE

An environment variable name must be terminated by a punctuation character or end of string. Use $$ if $ is required.


Default font

A default window font can be defined in Section 1, Entry 1[4] of the terminal parameter file. If none is defined, the following defaults are used:

640 x 480 resolution

“Courier New@8”

higher resolution

“Courier New@10

Courier New is a fixed pitch font, suitable for use with character windows programs that are being converted to GUI. For new programs, a proportional font is generally more suitable, and a commonly used one is “MS Sans Serif@8”


NOTES

  • When a proportional font (such as MS Sans Serif) is used with a control whose default width is the label width (such as a push button), it is recommended that the control’s width = clause is used.


EXAMPLES

title_font = “helvetica,b@12”

Helvetica, bold, 12

label_font = “@8”

current font, 8 pt

data_font = “arial,iu”

Arial, italic, underline

data_font = COURIER

Courier, fixed size


RELATED TOPICS

Property clauses

fontmetrics()

setfont()

textlength()

Fonts predefined by Sculptor

Terminal parameter files

sys.FontName, sys.FontSize

sys.FontFlags

Printing with proportional fonts