CLIM mail archive



    Date: Thu, 3 Dec 1992 14:23 EST
    From: Mark Nahabedian <>

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

	    Date: Thu, 3 Dec 1992 08:25+0100

	    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 

    The question is about what should happen when a text style specifying
    the face :bold is merged with a text style specifying the face :italic.
    What berni expects is a text style with a face of :bold.  That is what I
    would expect since the face of :bold that he asked for is fully
    specified (i.e. not NIL).  That's what I would expect.  What he is
    getting is a text face of (:bold :italic).

Another way to look at this is that there is a text face :bold-italic,
and Berni did NOT want that one, he wanted some text in :italic and
some in :bold.  Both interpretations (to merge or not to merge) are
possible and each makes sense in some contexts.  I think Markus's
suggestion of a keyword bears looking into.

	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

	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 ?

	(defmacro with-unmerged-text-style ((text-style stream) &body body)
	  `(clim-utils:letf-globally (((medium-text-style ,stream) (medium-default-text-style ,stream)))
	     (with-text-style (,text-style ,stream)

	Then your test case is as follows:

	(let ((stream *standard-output*))
	       ((clim:make-text-style :sans-serif :roman :large) stream)
	    (format stream "~%Here is text with sans-serif normal large")
	       ((clim:make-text-style :sans-serif :italic :large) stream)
	      (format stream "~%Here is text with sans-serif italic large")
		   ((clim:make-text-style :sans-serif :bold :large) stream)
		(format stream "~%This text is sans-serif, bold AND ITALIC, large,



Main Index | Thread Index