[gsharp-cvs] CVS update: gsharp/sdl.lisp

Christophe Rhodes crhodes at common-lisp.net
Mon Feb 16 18:50:20 UTC 2004

Update of /project/gsharp/cvsroot/gsharp
In directory common-lisp.net:/tmp/cvs-serv11405

Modified Files:
Log Message:
add *FONTS-DIRECTORY* to allow running GSharp when not in the gsharp
directory; essentially, we address the path relative to the path of
sdl.lisp or sdl.fasl (note: may break if this is subjected to Debian's

One remaining LOOP BY -1 that slipped through the net

Date: Mon Feb 16 13:50:20 2004
Author: crhodes

Index: gsharp/sdl.lisp
diff -u gsharp/sdl.lisp: gsharp/sdl.lisp:1.2
--- gsharp/sdl.lisp:	Mon Feb 16 10:46:21 2004
+++ gsharp/sdl.lisp	Mon Feb 16 13:50:20 2004
@@ -1,5 +1,9 @@
 (in-package :sdl)
+(defvar *fonts-directory*
+  (merge-pathnames (make-pathname :directory '(relative "Fonts"))
+		   (make-pathname :directory (pathname-directory *load-truename*))))
 (defgeneric glyph (font glyph-no))
 (defgeneric glyph-offsets (font glyph-no))
 (defgeneric staff-line-distance (font))
@@ -113,7 +117,7 @@
 					:element-type '(unsigned-byte 8)
 					:initial-element 16))
 	(loop for r from 0 below (car (array-dimensions matrix))
-	      for y from (gf-char-max-n gf-char) by -1 do
+	      for y downfrom (gf-char-max-n gf-char) by 1 do
 	      (loop for c from 0 below (cadr (array-dimensions matrix))
 		    for x from (gf-char-min-m gf-char) do
 		    (decf (aref pixmap
@@ -159,7 +163,9 @@
     (- notehead-right-x-offset notehead-left-x-offset)))
 (defun load-font (staff-line-distance)
-  (let* ((gf-font (parse-gf-file (format nil "Fonts/sdl~a.gf" staff-line-distance)))
+  (let* ((gf-font (parse-gf-file (merge-pathnames
+				  (format nil "sdl~a.gf" staff-line-distance)
+				  *fonts-directory*)))
 	 (maxchar (reduce #'max (gf-font-chars gf-font) :key #'gf-char-no))
 	 (glyphs (make-array (list (1+ maxchar)) :initial-element nil)))
     (loop for char in (gf-font-chars gf-font) do

More information about the Gsharp-cvs mailing list