6.10 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, either in points (the default) or logical drawing units, depending on the ``size-in-pixels?'' property (see below).
family -- A platform- and device-independent font designation. The families are:
The
'moderndesignation is special under Mac OS X and X with fontconfig/Xft; characters in the ``ASCII'' range 0-255 are converted to Unicode characters that match Adobe symbols. For example, ``a'' is converted to the Greek letter alpha.face -- A string face name, such as
"Courier"(under Windows and Mac OS X),"-*-courier"(under X), or" Luxi Sans"(under X with 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. Seefont-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:
underline? --
#tfor underlined,#ffor plain.smoothing -- Amount of anti-alias smoothing, one of:
'partly-smoothed(Windows: TrueType when available; Mac OS X: 4-bit, pixel-aligned smoothing; X: fontconfig/Xft when available)'smoothed(Windows: ClearType when available, XP and up; Mac OS X: Quartz smoothing; X: fontconfig/Xft when available)
Special case:
'defaultcorresponds to'partly-smoothedwhen used with the'modernfamily and a font size between 9 and 13 (inclusive).size-in-pixels? --
#tif the size of the font is in logical drawing units (i.e., pixels for an unscaled screen or bitmap drawing context),#fif the size of the font is in points (which can depend on screen resolution).
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%objectCreates an instance of the default font.
(make-object font%->sizefamilystyleweightunderline?smoothingsize-in-pixels?)font%object
size: exact integer in [1, 255]
family: symbol in'(default decorative roman script swiss modern symbol system)
style=: symbol in'normal'(normal italic slant)
weight=: symbol in'normal'(normal bold light)
underline?=#f: boolean
smoothing=: symbol in'default'(default partly-smoothed smoothed unsmoothed)
size-in-pixels?=#f: booleanCreates a font with a family, but no face name.
See
font%for information aboutfamily,style, andweight.font-name-directory<%>.
(make-object font%->sizefacefamilystyleweightunderline?smoothingsize-in-pixels?)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'(normal italic slant)
weight=: symbol in'normal'(normal bold light)
underline?=#f: boolean
smoothing=: symbol in'default'(default partly-smoothed smoothed unsmoothed)
size-in-pixels?=#f: booleanSee
font%for information aboutfamily,style, andweight. See alsofont-name-directory<%>for information about the wayfaceis interpreted for drawing text on various platforms and devices. When a platform- or device-specific interpretation offaceis not available, thefamilyis used to draw text.
Methods
get-face
get-family
get-font-id
get-point-size
get-size-in-pixels
get-smoothing
get-style
get-underlined
get-weight
screen-glyph-exists?