The size of the text, either in points (the default) or logical drawing units, depending on the “size-in-pixels?” property (see below).
A platform- and device-independent font designation. The families are:
'system (similar to the font to draw control labels, but see normal-control-font)
The terminology “family” and “face” is mangled relative to its usual meaning. A font% “face” is really used more like a font family in the usual terminology or more generally as a face-description string that is combined with other font% attributes to arrive at a face. A font% “family” is a kind of abstract font family that is mapped to a particular font family on a given platform.
A string face name, such as "Courier". 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:
#t for underlined, #f for plain.
- smoothing —
Amount of anti-alias smoothing, one of:
#t if the size of the font is in logical drawing units (i.e., pixels for an unscaled screen or bitmap drawing context), #f if the size of the font is in points (which can depend on screen resolution).
- hinting —
Whether font metrics should be rounded to integers:
See also font-name-directory<%>.
(make-object font% size family [ style weight underline? smoothing size-in-pixels? hinting]) → (is-a?/c font%) size : (integer-in 1 1024) family : font-family/c style : font-style/c = 'normal weight : font-weight/c = 'normal underline? : any/c = #f smoothing : font-smoothing/c = 'default size-in-pixels? : any/c = #f hinting : font-hinting/c = 'aligned
(make-object font% size face family [ style weight underline? smoothing size-in-pixels? hinting]) → (is-a?/c font%) size : (integer-in 1 1024) face : string? family : font-family/c style : font-style/c = 'normal weight : font-weight/c = 'normal underline? : any/c = #f smoothing : font-smoothing/c = 'default size-in-pixels? : any/c = #f hinting : font-hinting/c = 'aligned
See also make-font.
Due to space included in a font by a font designer, a font tends to generate text that is slightly taller than the nominal size.
For a size in points and a screen or bitmap drawing context, the logical height depends on the resolution of the screen.
(send a-font screen-glyph-exists? c [ for-label?]) → boolean? c : char? for-label? : any/c = #f
If the second argument is true, the result indicates whether the glyph is available for control labels. Otherwise, it indicates whether the glyph is available for dc<%> drawing.
For dc<%> drawing, due to automatic font substitution when drawing or measuring text, the result of this method does not depend on this font’s attributes (size, face, etc.). The font’s attributes merely provide a hint for the glyph search.