Next Prev Up Top Contents Index

4.4 Text Style Binding Forms

CLIM provides several forms with which you can establish a binding of a text style or a text-style component. The extent of the binding is the dynamic extent of the particular binding form.

with-text-style [Macro]	

Arguments: (medium text-style) &body body

Summary: Binds the current text style of the medium medium to correspond to the new text style. text-style may either be a text style object or a style spec (that is, a list of a family, a face, 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 expands into a call to invoke-with-text-style and supplies a function that executes body as the continuation argument to invoke-with-text-style .

invoke-with-text-style [Generic Function]

Arguments: medium continuation text-style

Summary: Binds the current text style of the medium medium to correspond to the new text style, and calls the function continuation with the new text style in effect. textstyle may either be a text style object or a style spec (that is, a list of a family, a face, and a size). continuation is a function of one argument, the medium; it has dynamic extent.

medium can be a medium, a sheet that supports the sheet output protocol, or a stream that outputs to such a sheet. All classes that obey the medium protocol implement a method for invoke-with-text-style .

The following macros are "convenience" forms of with-text-style that expand into calls to invoke-with-text-style .

The medium argument of these macros 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-face[Macro]	

Arguments: (medium face) &body body

Summary: Binds the current text face of medium to correspond to the new text face face, within the body. face is one of :roman , :bold , :italic , ( :bold :italic ), or nil .

with-text-family[Macro]	

Arguments: (medium family) &body body

Summary: Binds the current text family of medium to correspond to the new text family family, within the body. family is one of :fix , :serif , :sans-serif , or nil .

with-text-size[Macro]	

Arguments: (medium size) &body body

Summary: Binds the current text size of medium to correspond to the new text size size, within the body.


CommonLisp Interface Manager 2.0 User's Guide - 8 Aug 2003

Next Prev Up Top Contents Index