font

Create and inspect fonts.

SYNOPSIS

(font option ?arg arg ...?)

DESCRIPTION

The font procedure provides several facilities for dealing with fonts, such as defining named fonts and inspecting the actual attributes of a font. The procedure has several different forms, determined by the first argument. The following forms are currently supported:

(font 'actual font {? B:displayof} { Iwindow R?} {? Ioption R?)}

(font 'configure fontname ?option? ?value option value ...?)

(font 'create ?fontname? ?option value ...?)

(font 'delete fontname ?fontname ...?)

(font 'families)
(font 'families { B:displayof} { Iwindow R?)}

(font 'measure font {? B:displayof} { Iwindow R?} { Itext R)}

(font 'metrics font {? B:displayof} { Iwindow R?} {? Ioption R?)}

(font 'names)
The return value is a list of all the named fonts that are currently defined.

FONT DESCRIPTION

The following formats are accepted as a font description anywhere font is specified as an argument above; these same forms are also permitted when specifying the :font option for widgets.

{[1]} fontname

{[2]} systemfont

{[3]} family ?size? ?style? ?style ...?

{[4]} X-font names (XLFD)

{[5]} option value ?option value ...?

When font description font is used, the system attempts to parse the description according to each of the above five rules, in the order specified. Cases [1] and [2] must match the name of an existing named font or of a system font. Cases [3], [4], and [5] are accepted on all platforms and the closest available font will be used. In some situations it may not be possible to find any close font (e.g., the font family was a garbage value); in that case, some system-dependant default font is chosen. If the font description does not match any of the above patterns, an error is generated.

FONT METRICS

:ascent

:descent

:linespace

:fixed

FONT OPTIONS

The following options are supported on all platforms, and are used when constructing a named font or when specifying a font using style [5] as above:

:family name

:size size

:weight weight

:slant slant
The amount the characters in the font are slanted away from the vertical. Valid values for slant are roman and italic. A roman font is the normal, upright appearance of a font, while an italic font is one that is tilted some number of degrees from upright. The closest available slant to the one specified will be chosen. The default slant is roman.

:underline boolean
The value is a boolean flag that specifies whether characters in this font should be underlined. The default value for underline is #f.

:overstrike boolean
The value is a boolean flag that specifies whether a horizontal line should be drawn through the middle of characters in this font. The default value for overstrike is #f.

PLATFORM-SPECIFIC ISSUES

The following named system fonts are supported:

X Windows:
All valid X font names, including those listed by xlsfonts(1), are available.

MS Windows:
system	ansi	device
systemfixed	ansifixed	oemfixed
Macintosh:
system	application

Back to the STk main page