![[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 canvas or device context. A font is determined
by six properties:
- point size -- The size of the text in points (1/72 inch).
- face -- A string face name, such as ``Times.'' The format and
meaning of a face name is platform-specific.
- family -- a general catagory for a font, which provides a certain
amount of platform-indepedence for font specifications.
The end-user ultimately selects the mapping from
families to default face names. The families are:
- 'default
- 'decorative
- 'roman
- 'script
- 'swiss
- 'modern (should be fixed width)
- 'system (used to draw controls)
- style -- The slant 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 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.
font-name-directory<%>.
The font's face is the user-configured face for the given
family, but
get-facereturns #f for the font.
- (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 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 translated into a
font. The family is used as a guide; if the face is already
registered with the font directory, the registered family is used for
the returned font.
Methods
![[index]](../icons/index.gif)
Next: get-face
Up: Drawing Class Reference
Previous: try-color
PLT