3.1 Generic properties

3.1.3 Fonts

The CAPI interface supports the use of other fonts for text in title panes and other CAPI objects, such as buttons, through the use of the :font keyword. If the CAPI cannot find the specified font it reverts to the default font. The:font keyword applies to data following the:text keyword, and uses the graphics port package commandgf. The weight of the lettering can be one of :bold, :medium, :demibold, and :light. The slant of the lettering can be :roman, :italic, :oblique, :reverse-oblique and :reverse-italic.

On Unix thexlsfonts command can be used to list which fonts are available. Such fonts can be explicitly passed to the:font argument which will convert them. For example, here is a title pane with an explicit font.

(contain (make-instance 'title-pane
                        :text "A title pane"
                        :font "*times-medium-r-normal--8*"))

Here is an example of using:font to produce a title pane with larger lettering. Note that the CAPI automatically resized the pane to fit around the text.

(contain (make-instance 'title-pane
                        :text "A large piece of text"
                        :font (gp:gf nil
                                     "times"
                                     :medium
                                     :roman
                                     34)))


CAPI User Guide, Liquid Common Lisp Version 5.0 - 2 OCT 1997

Generated with Harlequin WebMaker