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”, where a “point” is equal to 1 pixel on Mac OS X and (/ 96 72) pixels on Windows and Unix
- hinting —
Whether font metrics should be rounded to integers:
See also font-name-directory<%>.
Changed in version 1.2 of package draw-lib: Defined “points” as (/ 96 72) pixels on Windows, independent of the screen resolution.
(make-object font% size family [ style weight underline? smoothing size-in-pixels? hinting]) → (is-a?/c font%) size : (real-in 0.0 1024.0) 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 : (real-in 0.0 1024.0) 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.
Changed in version 1.4 of package draw-lib: Changed size to allow non-integer and zero values.
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.
Added in version 1.4 of package draw-lib.
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.