Lisp HUG Maillist Archive

rotated string

Hello,

I tried to write a version 'draw-rotated-string' of 'draw-string'  
which rotates a given string on a pinboard by a given angle n. After  
having read the docs and the examples I tried something like


(defun draw-rotated-string (pane str x y color font size angle)
    (let ((font font) (size size))
     (setf str (format nil "~a" str))
     (let ((font (gp:find-best-font pane (gp:make-font- 
description :family font :size size :weight :normal))))
      (gp:with-graphics-rotation (pane angle)
       (gp:draw-string pane str x y :font font :foreground (give- 
color color))))))


(defun give-color (num)
   (let ((a '(:black :blue :red :green :cyan
           :magenta :yellow :pink :purple :white)))
     (nth num a)))


It displays the given strings but doesn't rotate them. I seem to  
completely misunderstand the documentation and don't know where to  
start again.

Thanks in advance for any hint.

Max


Re: rotated string

Max Haas wrote:

> I tried to write a version 'draw-rotated-string' of 'draw-string'
> which rotates a given string on a pinboard by a given angle n.

We had a small thread about this three years ago.  See
http://thread.gmane.org/gmane.lisp.lispworks.general/1669

At that time, there was no support for drawing rotated strings.  But
maybe the situation has improved by now?

Arthur Lemmens


Updated at: 2020-12-10 08:46 UTC