Page 88 Table of Contents Index Page 90
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 11. TEXT STYLES

Specifies the family of the text style text-style.

=> :text-face [Option]
=> text-style-face text-style [Generic Function]
Specifies the face of the text style text-style.

=> :text-size [Option]
=> text-style-size text-style [Generic Function]
Specifies the size of the text style text-style.

=> parse-text-style style-spec [Function]
Returns a text style object. style-spec may be a text-style object or a device font, in which
case it is returned as is, or it may be a list of the family, face, and size (that is, a "style spec"),
in which case it is "parsed" and a text-style object is returned. This function is for efficiency,
since a number of common functions that take a style object as an argument can also take a
style spec, in particular draw-text.

=> merge-text-styles style1 style2 [Generic Function]
Merges the text styles style1 with style2, that is, returns a new text style that is the same as
style1, except that unspecified components in style1 are filled in from style2. For convenience,
the two arguments may be also be style specs.

When merging the sizes of two text styles, if the size from style1 is a relative size, the resulting
size is either the next smaller or next larger size than is specified by style2. The ordering of sizes,
from smallest to largest, is :tiny, :very-small, :small, :normal, :large, :very-large, and
:huge.

Minor issue: Need to describe face-merging properly. For example, merging a bold face with
an italic one can result in a bold-italic face. | SWM

=> text-style-ascent text-style port [Generic Function]
=> text-style-descent text-style port [Generic Function]
=> text-style-height text-style port [Generic Function]
=> text-style-width text-style port [Generic Function]
Returns the ascent, descent, height, and width (respectively) of the font corresponding to the
text style text-style as it would be rendered on any medium on the port port. text-style must be
a fully specified text style.

The ascent of a font is the distance between the top of the tallest character in that font and the
font's baseline. The descent of a font is the distance between the baseline and the bottom of the
lowest descending character (usually "g", "p", "q", or "y"). The height of a font is the sum of
the ascent and the descent of the font. The width of a font is the width of some representative
character in the font.

The methods for these generic functions will typically specialize both the text-style and port
arguments. Implementations should also provide "trampoline" for these generic function for


Page 88 Table of Contents Index Page 90
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E