anchor.diff:  			    (subseq string start (or end (length string)))
   			    res)
   	(cffi:with-foreign-slots
  -	    ((width height x_advance y_advance) res cairo_text_extents)
  -	  (values (ceiling width)
  -		  (ceiling height)
  +	    ((x_advance height y_bearing) res cairo_text_extents)
  +	  (values
  +	   ;; use x_advance instead of width, since CLIM wants to trailing
  +	   ;; spaces to be taken into account.
  +	   (ceiling x_advance)
  +	   (ceiling height)
  +	   ;; Sames values again here: The CLIM spec states that these
  +	   ;; values differ only for multi-line text.  And y_advance is 0
  +	   ;; for european text, which is not what we want. --DFL
  +	   (ceiling x_advance)
  +	   (ceiling height)
  +	   ;; This used to be TEXT-STYLE-ASCENT, but see comment there.
  +	   (abs (ceiling y_bearing))))))))
  +
  +(defmethod climi::text-bounding-rectangle*
  +    ((medium metrik-medium) string &key text-style (start 0) end)
  +  (with-cairo-medium (medium)
  +    ;; -> left ascent right descent
  +    (when (characterp string) (setf string (string string)))
  +    (setf text-style (or text-style (make-text-style nil nil nil)))
  +    (setf text-style
  +	  (merge-text-styles text-style (medium-default-text-style medium)))
  +    (with-slots (cr) medium
  +      (cairo_identity_matrix cr)
  +      (sync-text-style medium text-style t)
  +      (cffi:with-foreign-object (res 'cairo_text_extents)
  +	(cairo_text_extents cr
  +			    (subseq string start (or end (length string)))
  +			    res)
  +	;; This used to be a straight call to TEXT-SIZE.  Looking at
  +	;; what CLIM-CLX does, this looks better to me, but I'm not sure
  +	;; whether it's 100% right:
  +	;;   --DFL
  +	(cffi:with-foreign-slots
  +	    ((height x_advance y_advance x_bearing y_bearing)
  +	     res cairo_text_extents)
  +	  (values (ceiling x_bearing)
  +		  (ceiling y_bearing)
   		  (ceiling x_advance)
  -		  (ceiling y_advance)
  -		  ;; baseline?
  -		  (ceiling (text-style-ascent text-style medium))))))))
  -
  -(defmethod climi::text-bounding-rectangle*
  -    ((medium gtkairo-medium) string &key text-style (start 0) end)
  -  (text-size medium string :text-style text-style :start start :end end))
  +		  (ceiling (+ height y_bearing))))))))
   
   ;;;; ------------------------------------------------------------------------
   ;;;;  General Designs
  
positive.code: 	 (cairo_font_extents cr res)
  	 ;; ### let's hope that cairo respects
  	 ;; height = ascent + descent.
  	 (slot res 'cairo_font_extents 'height))))))
  
  
  
negative.code:        (sync-sheet medium)
         (cairo_identity_matrix cr)
         (sync-text-style medium text-style t)
         ;; This didn't work well for Climacs. --DFL
  ;;;       (cffi:with-foreign-object (res 'cairo_text_extents)
  ;;;         (cairo_text_extents cr "m" res)
  ;;;         (slot res 'cairo_text_extents 'width))
         (cffi:with-foreign-object (res 'cairo_font_extents)
  	 (cairo_font_extents cr res)
  	 (slot res 'cairo_font_extents 'max_x_advance))))))
  
  
  ;;; TEXT-STYLE-FIXED-WIDTH-P
  