I got some help from libgd mailing list, so when I put Pierre's sample to lisp here is what I got (solves my problem):<br><br> (with-image (new width height t)<br> (setf (alpha-blending-p new) nil)<br> (draw-rectangle* 0 0 width height :image new :filled t :color (allocate-color 0 0 0 :image new :alpha 127))
<br> (draw-freetype-string 0 0<br> text<br> :image new<br> :anti-aliased t<br> :font-name font<br> :angle 0<br> :point-size font-size
<br> :color (allocate-color 0 0 255 :image new))<br> (setf (save-alpha-p :image new) t)<br> (write-image-to-file file-name :image new :if-exists :supersede)))<br><br>Thank you,<br>Andrew<br><br><div>
<span class="gmail_quote">On 3/17/07, <b class="gmail_sendername">Andrei Stebakov</b> <<a href="mailto:lispercat@gmail.com">lispercat@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ah, it looks like make-anti-aliased is only for brushes, for drawing lines... I wonder what technique works for the text?<br><br>Thanks!<div><span class="e" id="q_1116044a42d78636_1"><br>Andrew<br><br><div><span class="gmail_quote">
On 3/17/07, <b class="gmail_sendername">
Andrei Stebakov</b> <<a href="mailto:lispercat@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">lispercat@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I tred to use the (make-anti-aliased) function:<br> (draw-freetype-string 0 0<span><br> text<br> :anti-aliased t<br> :font-name font<br> :angle 0
<br> :point-size font-size
<br></span> :color (make-anti-aliased (allocate-color 0 0 255)))<br><br>But the lisp gives me the error:<br><br>The value of CL-GD::COLOR is #S(CL-GD::ANTI-ALIASED-COLOR<br> :COLOR 255
<br> :DO-NOT-BLEND NIL), which is not of type INTEGER.<br> [Condition of type SIMPLE-TYPE-ERROR]<br><br>Restarts:<br> 0: [STORE-VALUE] Supply a new value of CL-GD::COLOR.<br> 1: [ABORT] Return to SLIME's top level.
<br> 2: [ABORT] Return to Top-Level.<br><br>Backtrace:<br> 0: (LISP::CHECK-TYPE-ERROR CL-GD::COLOR<br> #S(CL-GD::ANTI-ALIASED-COLOR<br> :COLOR 255<br> :DO-NOT-BLEND NIL)
<br> INTEGER<br> NIL)<br><br>Thank you,<br>Andrew<div><span><br><br><div><span class="gmail_quote">On 3/17/07, <b class="gmail_sendername">
Andrei Stebakov</b> <<a href="mailto:lispercat@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
lispercat@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Here is what I've got: <a href="http://www.greenpixeldesign.com/cphandler/tmp-img/test.png" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.greenpixeldesign.com/cphandler/tmp-img/test.png</a> <br>I'd like to remove the black outline from the anti-aliased text (I need RGB true color image). I know I am missing some stupid thing, but I experimented with different backgrounds, just doesn't make it right. My current setup is gdlib
2.0.33 on debian, and here is the code;<br><br>(defun create-text-image (text font font-size file-name)<br> (multiple-value-bind (width height horizont-shift vertical-shift)<br> (get-bounding-rect text font font-size)
<br> (with-image* (width height t)<br> (let* ((white (allocate-color 255 255 255))<br> (black (allocate-color 0 0 0))<br> (red (allocate-color 255 0 0))<br> (green (allocate-color 0 255 0))
<br> (blue (allocate-color 0 0 255)))<br> (setf (transparent-color) black)<br> (draw-freetype-string (- 0 horizont-shift) (- height vertical-shift) <br> text<br> :anti-aliased t
<br> :font-name font<br> :angle 0<br> :point-size font-size<br> :color (allocate-color 0 0 255))<br> <br> ;;(true-color-to-palette)<br> (write-image-to-file file-name :if-exists :supersede)))))
<br>
</blockquote></div><br>
</span></div></blockquote></div><br>
</span></div></blockquote></div><br>