anchor.diff:                 (vector-push-extend width widths))
                 (object
                  (multiple-value-bind (w)
  -                   (text-size stream object
  +                   (font-replacement-text-size stream object
                       :text-style text-style)
                    (incf width w)
                    (vector-push-extend width widths)))
                 (t
                  (multiple-value-bind (w)
  -                   (text-size stream stroke-string
  +                   (font-replacement-text-size stream stroke-string
                       :start start :end end
                       :text-style text-style)
                    (incf width w)
  
positive.code: 	    do (return (aref (stroke-widths stroke) next))
  	  when (<= start pos end)
  	    do (return (+ width
  			  (text-size stream string
  				     :start start
  				     :end pos
  				     :text-style (merge-text-styles
  						  (face-style
  						   (drawing-options-face
  						    (stroke-drawing-options stroke)))
  						  (medium-merged-text-style (sheet-medium stream)))))))))
  
  (defgeneric offset-to-screen-position (pane view offset)
    (:documentation "Returns the position of offset as a screen
  
negative.code: ;;; utilities needed for the Drei redisplay engine
  
  (in-package :drei)
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;  Wrapper around DRAW-TEXT* and TEXT-SIZE that
  ;;;  handles font replacement
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  (defun iterate-font-replacement (stream string start end text-style fn)
    (let* ((blocks (mcclim-font:find-replacement-text-styles stream (subseq string start end) :text-style text-style))
           (text-style (or text-style (clim:medium-text-style stream)))
           (size (clim:text-style-size text-style)))
      (loop
        with curr-x = 0
        for (string family style) in blocks
        for new-text-style = (if family (clim:make-text-style family style size) text-style)
        do (progn
             (funcall fn string curr-x new-text-style)
             (multiple-value-bind (width)
                 (clim:text-size stream string :text-style text-style)
               (incf curr-x width)))
        finally (return curr-x))))
  
  (defun font-replacement-draw-text* (stream string x y
                                      &key
                                        (start 0) (end (length string))
                                        text-style ink (align-y :baseline))
    (iterate-font-replacement stream string start end text-style
                              (lambda (string curr-x new-text-style)
                                (clim:draw-text* stream string (+ x curr-x) y :text-style new-text-style :ink ink :align-y align-y))))
  
  (defun xfont-replacement-draw-text* (stream string x y
                                      &key
                                        (start 0) (end (length string))
                                        text-style ink (align-y :baseline))
    (let* ((blocks (mcclim-font:find-replacement-text-styles stream (subseq string start end) :text-style text-style))
           (text-style (or text-style (clim:medium-text-style stream)))
           (size (clim:text-style-size text-style)))
      (loop
        with curr-x = x
        for (string family style) in blocks
        for new-text-style = (if family (clim:make-text-style family style size) text-style)
        do (progn
             (clim:draw-text* stream string curr-x y :text-style new-text-style :ink ink :align-y align-y)
             (multiple-value-bind (width)
                 (clim:text-size stream string :text-style text-style)
              (incf curr-x width))))))
  
  (defun font-replacement-text-size (stream string &key (start 0) (end (length string)) text-style)
    (iterate-font-replacement stream string start end text-style (lambda (string curr-x new-text-style)
                                                                   (declare (ignore string curr-x new-text-style))
                                                                   nil)))
  
  (defun xfont-replacement-text-size (stream string &key (start 0) (end (length string)) text-style)
    (let* ((blocks (mcclim-font:find-replacement-text-styles stream (subseq string start end) :text-style text-style))
           (text-style (or text-style (clim:medium-text-style stream)))
           (size (clim:text-style-size text-style)))
      (loop
        with curr-width = 0
        for (string family style) in blocks
        for new-text-style = (if family (clim:make-text-style family style size) text-style)
        do (multiple-value-bind (width)
               (clim:text-size stream string :text-style text-style)
             (incf curr-width width))
        finally (return curr-width))))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;
  