[cl-gd-devel] Error with draw-feetype-string
I am not sure if it's hunchentoot or gd because when I specify "arial" for the functon, it works. When the same string comes from (session-value 'text) I got following error: Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: "arial" is not of type (OR SIMPLE-BASE-STRING NULL (ALIEN:ALIEN (* (ALIEN:SIGNED 8)))) 0: (DEBUG:BACKTRACE 536870911 #<String-Output Stream>) 1: (HUNCHENTOOT:GET-BACKTRACE #<unused-arg>) 2: ("DEFUN PROCESS-REQUEST" #<TYPE-ERROR {58123B7D}>) 3: (SIGNAL #<TYPE-ERROR {58123B7D}>) 4: (ERROR TYPE-ERROR :FUNCTION-NAME CL-GD::GD-IMAGE-STRING-FT :DATUM "arial" :EXPECTED-TYPE (OR SIMPLE-BASE-STRING NULL (ALIEN:ALIEN (* (ALIEN:SIGNED 8))))) . . . 6: (KERNEL::INTERNAL-ERROR #.(SYSTEM:INT-SAP #x3FFFBF04) #<unused-arg>) 7: ("call_into_lisp+#x8C [#x805560C] /usr/bin/cmucl") 8: ("funcall2+#x2C [#x80553EE] /usr/bin/cmucl") 9: ("interrupt_internal_error+#xC3 [#x80506F1] /usr/bin/cmucl") 10: ("sigtrap_handler+#x187 [#x8055260] /usr/bin/cmucl") 11: (CL-GD::GD-IMAGE-STRING-FT #<Alien (* (ALIEN:STRUCT CL-GD::GD-IMAGE (CL-GD::PIXELS (* (* (ALIEN:UNSIGNED 8)))) (CL-GD::SX (ALIEN:SIGNED 32)) (CL-GD::SY (ALIEN:SIGNED 32)) (CL-GD::COLORS-TOTAL (ALIEN:SIGNED 32)) (CL-GD::RED (ARRAY (ALIEN:SIGNED 32) 256)) (CL-GD::GREEN (ARRAY (ALIEN:SIGNED 32) 256)) (CL-GD::BLUE (ARRAY (ALIEN:SIGNED 32) 256)) (OPEN (ARRAY (ALIEN:SIGNED 32) 256)) (CL-GD::TRANSPARENT (ALIEN:SIGNED 32)) (CL-GD::POLY-INTS (* (ALIEN:SIGNED 32))) (CL-GD::POLY-ALLOCATED (ALIEN:SIGNED 32)) (CL-GD::BRUSH (* (ALIEN:STRUCT CL-GD::GD-IMAGE))) (CL-GD::TILE (* (ALIEN:STRUCT CL-GD::GD-IMAGE))) (CL-GD::BRUSH-COLOR-MAP (ARRAY (ALIEN:SIGNED 32) 256)) (CL-GD::TILE-COLOR-MAP (ARRAY (ALIEN:SIGNED 32) 256)) (CL-GD::STYLE-LENGTH (ALIEN:SIGNED 32)) (CL-GD::STYLE-POS (ALIEN:SIGNED 32)) (CL-GD::STYLE (* (ALIEN:SIGNED 32))) (CL-GD::INTERFACE (ALIEN:SIGNED 32)) (CL-GD::THICK (ALIEN:SIGNED 32)) (CL-GD::ALPHA (ARRAY (ALIEN:SIGNED 32) 256)) (CL-GD::TRUE-COLOR (ALIEN:SIGNED 32)) (CL-GD::T-PIXELS (* (* (ALIEN:SIGNED 32)))) (CL-GD::ALPHA-BLENDING-FLAG (ALIEN:SIGNED 32)) (CL-GD::SAVE-ALPHA-FLAG (ALIEN:SIGNED 32)) (CL-GD::AA (ALIEN:SIGNED 32)) (CL-GD::AA-COLOR (ALIEN:SIGNED 32)) (CL-GD::AA-DO-NOT-BLEND (ALIEN:SIGNED 32)) (CL-GD::AA-OPACITY (* (* (ALIEN:UNSIGNED 8)))) (CL-GD::AA-POLYGON (ALIEN:SIGNED 32)) (CL-GD::AAL-X1 (ALIEN:SIGNED 32)) (CL-GD::AAL-Y1 (ALIEN:SIGNED 32)) (CL-GD::AAL-X2 (ALIEN:SIGNED 32)) (CL-GD::AAL-Y2 (ALIEN:SIGNED 32)) (CL-GD::AAL-BX-AX (ALIEN:SIGNED 32)) (CL-GD::AAL-BY-AY (ALIEN:SIGNED 32)) (CL-GD::AAL-LAB-2 (ALIEN:SIGNED 32)) (CL-GD::AAL-LAB SINGLE-FLOAT) (CL-GD::CX1 (ALIEN:SIGNED 32)) (CL-GD::CY1 (ALIEN:SIGNED 32)) (CL-GD::CX2 (ALIEN:SIGNED 32)) (CL-GD::CY2 (ALIEN:SIGNED 32)))) at #x00000000> #<Alien (* (ALIEN:SIGNED 32)) at #x0808D178> 0 "arial" 40.0d0 0.0d0 0 0 "555") 12: (CL-GD:DRAW-FREETYPE-STRING 0 0 "555" :ANTI-ALIASED T :POINT-SIZE 40 :ANGLE 0 :CONVERT-CHARS T :LINE-SPACING NIL :FONT-NAME "arial" :DO-NOT-DRAW T :COLOR 0 :IMAGE NIL)
On Fri, 23 Mar 2007 22:26:41 -0500, "Andrei Stebakov" <lispercat@gmail.com> wrote:
I am not sure if it's hunchentoot or gd because when I specify "arial" for the functon, it works. When the same string comes from (session-value 'text) I got following error:
Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: "arial" is not of type (OR SIMPLE-BASE-STRING NULL (ALIEN:ALIEN (* (ALIEN:SIGNED 8))))
Hmm, seems like a problem with the FFI of your Lisp. Try TYPE-OF to see what kind of object (SESSION-VALUE 'TEXT) actually is.
Looks like the value from (session-value) is BASE-STRING, and what the draw-freetype-string is looking for SIMPLE-BASE-STRING. Actually I setf the session value from the html form combo-box values. I wonder what can I do to make it right? Get latest FFI? Thank you, Andrew On 3/24/07, Edi Weitz <edi@agharta.de> wrote:
On Fri, 23 Mar 2007 22:26:41 -0500, "Andrei Stebakov" <lispercat@gmail.com> wrote:
I am not sure if it's hunchentoot or gd because when I specify "arial" for the functon, it works. When the same string comes from (session-value 'text) I got following error:
Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: "arial" is not of type (OR SIMPLE-BASE-STRING NULL (ALIEN:ALIEN (* (ALIEN:SIGNED 8))))
Hmm, seems like a problem with the FFI of your Lisp. Try TYPE-OF to see what kind of object (SESSION-VALUE 'TEXT) actually is. _______________________________________________ cl-gd-devel site list cl-gd-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-gd-devel
Now I did (coerce (session-value 'font) 'simple-base-string) seems to work. Thank you, Andrew On 3/24/07, Andrei Stebakov <lispercat@gmail.com> wrote:
Looks like the value from (session-value) is BASE-STRING, and what the draw-freetype-string is looking for SIMPLE-BASE-STRING. Actually I setf the session value from the html form combo-box values. I wonder what can I do to make it right? Get latest FFI?
Thank you, Andrew
On 3/24/07, Edi Weitz <edi@agharta.de> wrote:
On Fri, 23 Mar 2007 22:26:41 -0500, "Andrei Stebakov" < lispercat@gmail.com> wrote:
I am not sure if it's hunchentoot or gd because when I specify "arial" for the functon, it works. When the same string comes from (session-value 'text) I got following error:
Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: "arial" is not of type (OR SIMPLE-BASE-STRING NULL (ALIEN:ALIEN (* (ALIEN:SIGNED 8))))
Hmm, seems like a problem with the FFI of your Lisp. Try TYPE-OF to see what kind of object (SESSION-VALUE 'TEXT) actually is. _______________________________________________ cl-gd-devel site list cl-gd-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-gd-devel
On Sat, 24 Mar 2007 08:55:00 -0400, "Andrei Stebakov" <lispercat@gmail.com> wrote:
Looks like the value from (session-value) is BASE-STRING, and what the draw-freetype-string is looking for SIMPLE-BASE-STRING. Actually I setf the session value from the html form combo-box values. I wonder what can I do to make it right? Get latest FFI?
You mean UFFI? I think this is not a problem of UFFI but rather a limitation of SBCL: CL-USER> (sb-alien:define-alien-routine "strlen" sb-alien:int (str (sb-alien:c-string :external-format :latin-1))) STRLEN CL-USER> (defun make-foo (&key (simplep t)) (let ((array (make-array 3 :element-type 'character :initial-contents '(#\f #\o #\o) :fill-pointer (not simplep)))) array)) MAKE-FOO CL-USER> (typep (make-foo) 'simple-string) T CL-USER> (typep (make-foo :simplep nil) 'simple-string) NIL CL-USER> (strlen (make-foo)) 3 CL-USER> (strlen (make-foo :simplep nil)) ;; you'll get the same error here You might want to ask on the SBCL mailing list if this is expected behaviour if you want to pursue this further. HTH, Edi.
participants (2)
-
Andrei Stebakov -
Edi Weitz