I'm new to lisp, so perhaps I just don't know how to use libraries
correctly. Anyway, I'm trying to using the cl-gd package. I installed
the cl-gd debian package and am using sbcl. I'm trying to run the
example program on the cl-gd website, but I keep getting a font-not
found error.
Here's the error I get:
#P"/usr/lib/cl-gd/cl-gd-glue.so"
debugger invoked on a SIMPLE-ERROR in thread 8467:
Error in FreeType library: Could not find/open font
And here's the program I'm trying to run:
(require "cl-gd")
(cl-gd:with-image* (200 200) ; create 200x200 pixel image
(cl-gd:allocate-color 68 70 85) ; background color
(let ((beige (cl-gd:allocate-color 222 200 81))
(brown (cl-gd:allocate-color 206 150 75))
(green (cl-gd:allocate-color 104 156 84))
(red (cl-gd:allocate-color 163 83 84))
(white (cl-gd:allocate-color 255 255 255))
(two-pi (* 2 pi)))
;; move origin to center of image
(cl-gd:with-transformation (:x1 -100 :x2 100 :y1 -100 :y2 100 :radians t)
;; draw some 'pie slices'
(cl-gd:draw-arc 0 0 130 130 0 (* .6 two-pi)
:center-connect t :filled t :color beige)
(cl-gd:draw-arc 0 0 130 130 (* .6 two-pi) (* .8 two-pi)
:center-connect t :filled t :color brown)
(cl-gd:draw-arc 0 0 130 130 (* .8 two-pi) (* .95 two-pi)
:center-connect t :filled t :color green)
(cl-gd:draw-arc 0 0 130 130 (* .95 two-pi) two-pi
:center-connect t :filled t :color red)
(cl-gd:with-default-color (white)
(cl-gd:with-default-font (:small)
(cl-gd:draw-string -8 -30 "60%")
(cl-gd:draw-string -20 40 "20%")
(cl-gd:draw-string 20 30 "15%"))
(cl-gd:draw-freetype-string -90 75 "Global Revenue"
;; this assumes that 'DEFAULT_FONTPATH'
;; is set correctly
:font-name "verdanab"))))
(cl-gd:write-image-to-file "chart.png"
:compression-level 6 :if-exists :supersede))
All tips are welcome.
TIA
From: Edi Weitz
Subject: Re: cl-gd package and namespace question
Date:
Message-ID: <ufyzw43ti.fsf@agharta.de>
See the answer I just sent to the cl-gd-devel mailing list.
Edi.
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq ·········@agharta.de" 5) "edi")