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: '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.
face —
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: underline? —
#t for underlined, #f for plain. - smoothing —
Amount of anti-alias smoothing, one of: size-in-pixels? —
#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 and (/ 96 72) pixels on Windows and Unix - hinting —
Whether font metrics should be rounded to integers:
To avoid creating multiple fonts with the same characteristics, use the global font-list% object the-font-list.
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.
constructor
(make-object font%) → (is-a?/c font%)
(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 font% for information about family, style, weight, smoothing, size-in-pixels?, and hinting. font-name-directory<%>.
See also make-font.
Changed in version 1.4 of package draw-lib: Changed size to allow non-integer and zero values.
method
(send a-font get-family) → font-family/c
method
(send a-font get-font-id) → exact-integer?
method
(send a-font get-hinting) → font-hinting/c
method
(send a-font get-point-size) → (integer-in 1 1024)
See get-size, instead. The get-point-size method is provided for backward compatibility.
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.
method
(send a-font get-size-in-pixels) → boolean?
For a size in points and a screen or bitmap drawing context, the logical height depends on the resolution of the screen.
method
(send a-font get-smoothing) → font-smoothing/c
method
(send a-font get-style) → font-style/c
method
(send a-font get-underlined) → boolean?
method
(send a-font get-weight) → font-weight/c
method
(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.