![[index]](../icons/index.gif)
Next: get-face
Up: Drawing Class Reference
Previous: try-color
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-indepedent font
designation. The families are:
- 'default
- 'decorative
- 'roman
- 'script
- 'swiss
- 'modern (fixed width)
- 'symbol (Greek letters)
- 'system (used to draw control labels)
- face -- A string face name, such as "Times" (under
Windows and MacOS) 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:
- 'normal
- 'slant (Windows, MacOS: same as 'italic; X: tries 'italic if 'slant font does not exist)
- 'italic (X: tries 'slant if 'italic font does not exist)
- 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 = #f : boolean
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 = #f : boolean
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 availaable, the
family is used to draw text.
Methods
![[index]](../icons/index.gif)
Next: get-face
Up: Drawing Class Reference
Previous: try-color
PLT