font%A font is an object which determines the appearance of text, primarily when drawing text to a device context. A font is determined by seven properties:
size -- The size of the text in logical drawing units (usually points, 1/72 inch).
family -- A platform- and device-independent font designation. The families are:
face -- A string face name, such as "Courier" (under
Windows and Mac OS), "-*-courier" (under
X), or " Luxi Sans" (under X with
FreeType/fontconfig/Xft; note the leading space). The
format and meaning of a face name is platform- and
device-specific. If a font's face name is #f,
then the font's appearance depends only on the
family. If a face is provided but no mapping is
available for the face name (for a specific platform
or device), then the face name is ignored and the
family is used. See
font-name-directory<%> for information about how face names are mapped for
drawing text.
style -- The slant style of the font, one of:
weight -- The weight of the font, one of:
underlining -- #t for underlined, #f for plain
smoothing -- Amount of anti-alias smoothing, one of:
'partly-smoothed (Windows: TrueType when available;
Mac OS X: 4-bit, pixel-aligned smoothing;
X: FreeType/fontconfig/Xft when available)
'smoothed (Windows: ClearType when available, XP and up;
Mac OS X: Quartz smoothing;
X: FreeType/fontconfig/Xft when available)
Special case: 'default corresponds to
'partly-smoothed when used with the 'modern family
and a font size between 9 and 13 (inclusive).
To avoid creating multiple fonts with the same characteristics, use
the global font-list% object the-font-list.
See also
font-name-directory<%>.
(make-object font%) -> font% object
Creates an instance of the default font.
(make-object font% -> size family style weight underline smoothing)font% object
size : exact integer in [1, 255]
family : symbol in '(default decorative roman script swiss modern symbol system)
style : symbol in '(normal italic slant)
weight : symbol in '(normal bold light)
underline = : boolean
#f
smoothing = : symbol in 'default'(default partly-smoothed smoothed unsmoothed)
Creates a font with a family, but no face name.
See
font% for information about family, style, and
weight.
font-name-directory<%>.
(make-object font% -> size face family style weight underline smoothing)font% object
size : exact integer in [1, 255]
face : string
family : symbol in '(default decorative roman script swiss modern symbol system)
style : symbol in '(normal italic slant)
weight : symbol in '(normal bold light)
underline = : boolean
#f
smoothing = : symbol in 'default'(default partly-smoothed smoothed unsmoothed)
See
font% for information about family, style, and weight. See
also
font-name-directory<%> for information about the way face is interpreted for drawing
text on various platforms and devices. When a platform- or
device-specific interpretation of face is not available, the
family is used to draw text.
Methods
get-face
get-family
get-font-id
get-point-size
get-smoothing
get-style
get-underlined
get-weight