Index: lily/include/stencil.hh
===================================================================
RCS file: /sources/lilypond/lilypond/lily/include/stencil.hh,v
retrieving revision 1.24
diff -p -u -r1.24 stencil.hh
--- lily/include/stencil.hh	6 Jan 2006 09:13:24 -0000	1.24
+++ lily/include/stencil.hh	3 May 2006 15:40:24 -0000
@@ -73,6 +73,7 @@ public:
 		    Real minimum);
   void add_stencil (Stencil const &m);
   void translate (Offset);
+  void rotate (Real);
   void align_to (Axis a, Real x);
   void translate_axis (Real, Axis);
 
Index: lily/stencil-interpret.cc
===================================================================
RCS file: /sources/lilypond/lilypond/lily/stencil-interpret.cc,v
retrieving revision 1.5
diff -p -u -r1.5 stencil-interpret.cc
--- lily/stencil-interpret.cc	6 Jan 2006 09:13:24 -0000	1.5
+++ lily/stencil-interpret.cc	3 May 2006 15:40:24 -0000
@@ -56,6 +56,21 @@ interpret_stencil_expression (SCM expr,
 
 	  return;
 	}
+      else if (head == ly_symbol2scm ("rotate-stencil"))
+	{
+	  SCM args = scm_cadr (expr);
+	  double angle = scm_to_double (scm_car (args));
+	  Offset tmp = o + robust_scm2offset (scm_cadr (args), Offset (0.0, 0.0));
+	  SCM offset = ly_offset2scm (tmp);
+	  SCM x = scm_car (offset);
+	  SCM y = scm_cdr (offset);
+
+	  (*func) (func_arg, scm_list_4 (ly_symbol2scm ("rotate"), scm_from_double (angle), x, y));
+	  interpret_stencil_expression (scm_caddr (expr), func, func_arg, o);
+	  (*func) (func_arg, scm_list_4 (ly_symbol2scm ("rotate"), scm_from_double (-angle), x, y));
+
+	  return;
+	}
       else
 	{
 	  (*func) (func_arg,
Index: lily/stencil-scheme.cc
===================================================================
RCS file: /sources/lilypond/lilypond/lily/stencil-scheme.cc,v
retrieving revision 1.53
diff -p -u -r1.53 stencil-scheme.cc
--- lily/stencil-scheme.cc	6 Jan 2006 09:13:24 -0000	1.53
+++ lily/stencil-scheme.cc	3 May 2006 15:40:24 -0000
@@ -319,6 +319,22 @@ LY_DEFINE (ly_bracket, "ly:bracket",
 			  0.95 * scm_to_double (t)).smobbed_copy ();
 }
 
+LY_DEFINE (ly_rotate_stencil, "ly:stencil-rotate",
+	   2, 0, 0, (SCM stil, SCM angle),
+	   "Return a @var{stil}, "
+	   "rotated by @var{angle} degrees.")
+{
+  Stencil *s = unsmob_stencil (stil);
+  SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
+  SCM_ASSERT_TYPE (scm_is_number (angle), angle, SCM_ARG2, __FUNCTION__, "number");
+  Real a = scm_to_double (angle);
+
+  SCM new_s = s->smobbed_copy ();
+  Stencil *q = unsmob_stencil (new_s);
+  q->rotate (a);
+  return new_s;
+}
+
 LY_DEFINE (ly_filled_box, "ly:round-filled-box",
 	   3, 0, 0,
 	   (SCM xext, SCM yext, SCM blot),
Index: lily/stencil.cc
===================================================================
RCS file: /sources/lilypond/lilypond/lily/stencil.cc,v
retrieving revision 1.51
diff -p -u -r1.51 stencil.cc
--- lily/stencil.cc	19 Feb 2006 12:38:02 -0000	1.51
+++ lily/stencil.cc	3 May 2006 15:40:24 -0000
@@ -78,6 +78,19 @@ Stencil::origin () const
   return origin_;
 }
 
+/*
+ * Rotate stencil around origin
+ */
+void
+Stencil::rotate (Real a)
+{
+/* FIXME: just a hack */
+  expr_ = scm_list_n (ly_symbol2scm ("rotate-stencil"),
+		      scm_list_2 (scm_from_double (a),
+				  ly_offset2scm (extent_box ().center ())),
+		      expr_, SCM_UNDEFINED);
+}
+
 void
 Stencil::translate (Offset o)
 {
Index: scm/output-ps.scm
===================================================================
RCS file: /sources/lilypond/lilypond/scm/output-ps.scm,v
retrieving revision 1.168
diff -p -u -r1.168 output-ps.scm
--- scm/output-ps.scm	4 Apr 2006 10:18:59 -0000	1.168
+++ scm/output-ps.scm	3 May 2006 15:40:24 -0000
@@ -18,26 +18,26 @@
 
   ;; JUNK this -- see lily.scm: ly:all-output-backend-commands
   #:export (unknown
-	    blank
+	    bezier-sandwich
+	    char
 	    circle
-	    dot
+	    comment
+	    dashed-line
 	    dashed-slur
-	    char
-	    setcolor
-	    resetcolor
+	    dot
+	    draw-line
+	    embedded-ps
 	    named-glyph
-	    dashed-line
-	    zigzag-line
-	    comment
-	    repeat-slash
+	    no-origin
 	    placebox
-	    bezier-sandwich
-	    embedded-ps
+	    polygon
+	    repeat-slash
+	    resetcolor
+	    rotate
 	    round-filled-box
+	    setcolor
 	    text
-	    polygon
-	    draw-line
-	    no-origin))
+	    zigzag-line))
 
 
 (use-modules (guile)
@@ -247,6 +247,14 @@
 ;; restore color from stack
 (define (resetcolor) "setrgbcolor\n")
 
+;; rotate around the point [x,y]
+(define (rotate ang x y)
+;; FIXME: This is probably not good PS code
+  (format "~a translate ~a rotate ~a translate\n"
+    (numbers->string4 (list x y))
+    (number->string ang)
+    (numbers->string4 (list (* -1 x) (* -1 y)))))
+
 (define (round-filled-box left right bottom top blotdiam)
   (let* ((halfblot (/ blotdiam 2))
 	 (x (- halfblot left))
Index: scm/define-markup-commands.scm
===================================================================
RCS file: /sources/lilypond/lilypond/scm/define-markup-commands.scm,v
retrieving revision 1.142
diff -p -u -r1.142 define-markup-commands.scm
--- scm/define-markup-commands.scm	20 Mar 2006 14:45:44 -0000	1.142
+++ scm/define-markup-commands.scm	3 May 2006 15:40:24 -0000
@@ -118,6 +118,12 @@ circle of diameter 0 (ie sharp corners).
   (ly:round-filled-box
    xext yext blot))
 
+(define-markup-command (rotate layout props ang arg) (number? markup?)
+  "Rotate object with @var{ang} degrees."
+  (let* ((stil (interpret-markup layout props arg)))
+    (ly:stencil-rotate stil ang)))
+
+
 (define-markup-command (whiteout layout props arg) (markup?)
   "Provide a white underground for @var{arg}"
   (let* ((stil (interpret-markup layout props

