Page 89 Table of Contents Index Page 91
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

mediums and output sheets; the trampolines will simply call the method for the port.

=> text-style-fixed-width-p text-style port [Generic Function]
Returns true if the text styles text-style will map to a fixed-width font on any medium on the
port port, otherwise returns false. text-style must be a fully specified text style.

The methods for this generic function will typically specialize both the text-style and port argu-
ments. Implementations should also provide a "trampoline" for this generic function for mediums
and output sheets; the trampoline will simply call the method for the port.

Minor issue: Discuss baselines? Kerning? | SWM

=> text-size medium string &key text-style (start 0) end [Generic Function]
Computes the "cursor motion" in device units that would take place if string (which may be
either a string or a character) were output to the medium medium starting at the position (0;0).
Five values are returned: the total width of the string in device units, the total height of the
string in device units, the final x cursor position (which is the same as the width if there are no
#\Newline characters in the string), the final y cursor position (which is 0 if the string has no
#\Newline characters in it, and is incremented by the line height of medium for each #\Newline
character in the string), and the string's baseline.

text-style specifies what text style is to be used when doing the output, and defaults to medium-
merged-text-style
of the medium. text-style must be a fully specified text style. start and end
may be used to specify a substring of string.

If a programmer needs to account for kerning or the ascent or descent of the text style, he should
measure the size of the bounding rectangle of the text rendered on medium.

All mediums and output sheets must implement a method for this generic function.

11.2 Text Style Binding Forms

=> with-text-style (medium text-style) &body body [Macro]
Binds the current text style of the medium designated by medium to correspond to the new text
style. text-style may either a text style object or a style spec (that is, a list of the a family, a
face code, and a size). body is executed with the new text style in effect.

The medium argument is not evaluated, and must be a symbol that is bound to a sheet or
medium. If medium is t, *standard-output* is used. body may have zero or more declarations
as its first forms.

with-text-style must be implemented by expanding into a call to invoke-with-text-style,
supplying a function that executes body as the continuation argument to invoke-with-text-
style
.


Page 89 Table of Contents Index Page 91
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