CLIM mail archive

[Prev][Next][Index][Thread]

Buggy WITH-TEXT-STYLE Macro??




    Date: Thu, 3 Dec 1992 09:08 EST
    From: Markus Fischer <MF@sun4.sger>

	Date: Thu, 3 Dec 1992 08:25+0100
	From: berni@iml.fhg.de

	I'm using CLIM 1.1 with MCL 2.0
	and CLIM 1.1 under Genera 8.1.

	If I'm using a text style with :bold face inside an enviromnent of 
	:italic face, the text gets formatted in (:bold :italic) face.
	As all text-styles are fully specified, I assume it's a bug.
	If I misunderstand the Documentation and it's a feature, 
	how can I do what I want (i.e. formatting the
	text :bold, but NOT :italic??

    The problem is that WITH-TEXT-STYLE always merges the new text style with
    the existing one. The exact behavior is documented for the function 
    MERGE-TEXT-STYLES.

    However, you seem to want NO merging at all, since your test code
    always specifies the text-style completely. I wrote a kludge to get
    the behavior you're probably looking for. It temporarliy (for the extent
    of the body) binds the medium's text-style to the medium's default text
    style. 

    But maybe it would be desirable to have an additional keyword like
    (:MERGE-P T) in the WITH-TEXT-XXX macros of CLIM 2.0 ?

Actually, there is a work-around.  You can specify an explicit text
face of :ROMAN around your attempt to switch to :BOLD.  The :ROMAN
will override the :ITALIC (not merge with it), and then the :BOLD will
override the :ROMAN.

This loses:

> (with-text-style ('(:fix :italic :normal) win)
    (with-text-face (:bold win)
      (stream-merged-text-style win)))
#<CLIM::TEXT-STYLE :FIX.(:BOLD :ITALIC).:NORMAL 15BC7E6>

This wins:

> (with-text-style ('(:fix :italic :normal) win)
    (with-text-face (:roman win)
      (with-text-face (:bold win)
	(stream-merged-text-style win))))
#<CLIM::TEXT-STYLE :FIX.:BOLD.:NORMAL 15BB44E>
> 

0,,


Main Index | Thread Index