[mcclim-cvs] CVS mcclim/Experimental/freetype

ahefner ahefner at common-lisp.net
Tue Jan 15 09:06:52 UTC 2008


Update of /project/mcclim/cvsroot/mcclim/Experimental/freetype
In directory clnet:/tmp/cvs-serv15462

Modified Files:
	freetype-fonts.lisp 
Log Message:
Fix busted text size calculation in the fixed-width path. Typed
(length string), meant (- end start). Could happen to anyone.


--- /project/mcclim/cvsroot/mcclim/Experimental/freetype/freetype-fonts.lisp	2008/01/13 23:02:34	1.17
+++ /project/mcclim/cvsroot/mcclim/Experimental/freetype/freetype-fonts.lisp	2008/01/15 09:06:52	1.18
@@ -252,15 +252,15 @@
          ;; out of here, but I doubt it would shave more than a few percent
          ;; off a draw-text benchmark.
          (macrolet ((compute ()
-                      `(loop with cache = (slot-value font 'glyph-width-cache)
+                      `(loop with width-cache = (slot-value font 'glyph-width-cache)
                           for i from start below end
                           as char = (aref string i)
                           as code = (char-code char)
-                          sum (or (gcache-get cache code)
-                                  (gcache-set cache code (clim-clx::font-glyph-width font char)))
+                          sum (or (gcache-get width-cache code)
+                                  (gcache-set width-cache code (clim-clx::font-glyph-width font char)))
                             #+NIL (clim-clx::font-glyph-width font char))))
            (if (numberp (slot-value font 'fixed-width))
-               (* (slot-value font 'fixed-width) (length string))
+               (* (slot-value font 'fixed-width) (- end start))
                (typecase string 
                  (simple-string 
                   (locally (declare (type simple-string string))




More information about the Mcclim-cvs mailing list