[mcclim-devel] international text help

Hazen Babcock hbabcockos1 at mac.com
Thu Aug 24 03:18:36 UTC 2006


Hello,

I'd like to display some chinese characters in my mcclim application,  
but I'm not sure how to go about this. I've loaded :mcclim-freetype  
and tried to follow: http://common-lisp.net/pipermail/mcclim-devel/ 
2005-August/004136.html since I have a truetype font that includes  
chinese characters.

(defmethod display-some-pane ((frame translator-frame) stream)
   (declare (ignore stream))
   (let ((pane (get-frame-pane *application-frame* 'some-pane)))
     (window-clear pane)
     (with-text-style (pane (make-device-font-text-style
			      (port *application-frame*)
			      "/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBd.ttf"))
       (draw-text* pane "foo" 10 10))))

gives:

The value "/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBd.ttf"
is not of type
   MCCLIM-FREETYPE::FREETYPE-DEVICE-FONT-NAME.
    [Condition of type TYPE-ERROR]


If I use a function that I don't think I'm supposed to use directly:

(defmethod display-some-pane ((frame translator-frame) stream)
   (declare (ignore stream))
   (let ((pane (get-frame-pane *application-frame* 'some-pane)))
     (window-clear pane)
     (with-text-style (pane (make-device-font-text-style
			      (port *application-frame*)
			      (mcclim-freetype::make-freetype-device-font-name
			       :font-file "/usr/share/fonts/truetype/ttf-bitstream-vera/ 
VeraBd.ttf"
			       :size 12)))
       (draw-text* pane "foo" 10 10))))

then it works, but I imagine that this is not the right/supported way.

thanks,
-Hazen




More information about the mcclim-devel mailing list