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 (which can depend on screen resolution). - 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<%>.
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 : (integer-in 1 1024)
family :
(or/c 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system) style : (or/c 'normal 'italic 'slant) = 'normal weight : (or/c 'normal 'bold 'light) = 'normal underline? : any/c = #f
smoothing :
(or/c 'default 'partly-smoothed 'smoothed 'unsmoothed) = 'default size-in-pixels? : any/c = #f hinting : (or/c 'aligned 'unaligned) = '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 :
(or/c 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system) style : (or/c 'normal 'italic 'slant) = 'normal weight : (or/c 'normal 'bold 'light) = 'normal underline? : any/c = #f
smoothing :
(or/c 'default 'partly-smoothed 'smoothed 'unsmoothed) = 'default size-in-pixels? : any/c = #f hinting : (or/c 'aligned 'unaligned) = 'aligned
See font% for information about family, style, weight, smoothing, size-in-pixels?, and hinting. font-name-directory<%>.
See also make-font.
method
(send a-font get-family)
→
(or/c 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system)
method
(send a-font get-font-id) → exact-integer?
method
(send a-font get-hinting) → (or/c 'aligned 'unaligned)
method
(send a-font get-point-size) → (integer-in 1 1024)
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.
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)
→ (or/c 'default 'partly-smoothed 'smoothed 'unsmoothed)
method
(send a-font get-underlined) → boolean?
method
(send a-font get-weight) → (or/c 'normal 'bold 'light)
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.