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 six 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 "Times" (under
Windows and Mac OS) or "-*-times" (under X). 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
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)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
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)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
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-style
get-underlined
get-weight