]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
* scm/music-functions.scm (direction-polyphonic-grobs): Set
[lilypond.git] / scm / define-markup-commands.scm
index abcb7e33135eb47c529da350096308b9201a3982..a578c38b7b281f0ee9ff25a77c63c3b62067eac8 100644 (file)
 
 (def-markup-command (score paper props score) (ly:score?)
   (let*
-      ((systems (ly:score-embedded-format score paper))
-       (1st (vector-ref systems 0))
-       (stencil (ly:paper-system-stencil 1st)) )
+      ((systems (ly:score-embedded-format score paper)))
 
-    (ly:stencil-align-to! stencil Y CENTER)
-    stencil))
+    (if (= 0 (vector-length systems))
+       (begin
+         (ly:warn "No systems found in \\score markup. Did you forget \\paper?")
+         empty-markup)
+       (begin
+         (let*
+             ((stencil (ly:paper-system-stencil  (vector-ref systems 0)))) 
+
+           (ly:stencil-align-to! stencil Y CENTER)
+           stencil)))))
 
 (def-markup-command (simple paper props str) (string?)
   "A simple text string; @code{\\markup @{ foo @}} is equivalent with
@@ -35,6 +41,7 @@
   (Text_item::interpret_string paper
                               props sym str))
 
+
 ;; TODO: use font recoding.
 ;;                   (make-line-markup
 ;;                    (map make-word-markup (string-tokenize str)))))
 (define-public empty-markup
   (make-simple-markup ""))
 
+
+(def-markup-command (postscript paper props str) (string?)
+
+  "This inserts @var{str} directly into the output as a PostScript
+command string.  Due to technicalities of the output backends,
+different scales should be used for the @TeX{} and PostScript backend,
+selected with @code{-f}. 
+
+
+For the TeX backend, the following string prints a rotated text
+
+@cindex rotated text
+
+@verbatim
+0 0 moveto /ecrm10 findfont 
+1.75 scalefont setfont 90 rotate (hello) show
+@end verbatim
+
+@noindent
+The magical constant 1.75 scales from LilyPond units (staff spaces) to
+TeX dimensions.
+
+For the postscript backend, use the following
+
+@verbatim
+gsave /ecrm10 findfont 
+ 10.0 output-scale div 
+ scalefont setfont  90 rotate (hello) show grestore 
+@end verbatim
+"
+  ;; FIXME
+  
+  (ly:make-stencil
+   (list 'embedded-ps str)
+   '(0 . 0) '(0 . 0)  ))
+
 ;;(def-markup-command (fill-line paper props line-width markups)
 ;;  (number? markup-list?)
 ;; no parser tag -- should make number? markuk-list? thingy