]> git.donarmstrong.com Git - lilypond.git/commitdiff
(calc_direction): take dir from visible stem in
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 31 Jan 2006 14:42:32 +0000 (14:42 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 31 Jan 2006 14:42:32 +0000 (14:42 +0000)
degenerate case.

ChangeLog
Documentation/topdocs/NEWS.tely
THANKS
lily/beam.cc
scm/define-markup-commands.scm
scm/output-ps.scm
scm/stencil.scm

index 3a02ed749f892970fa880b87900abd364c9b9f30..1fada840c7cf9ba18cfcd35bef26dd02845d40e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-31  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/beam.cc (calc_direction): take dir from visible stem in
+       degenerate case.
+
 2006-01-31  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/melody-spanner.cc (spanner::calc_neutral_stem_direction):
index 89ccdb9556f598e0beee9a4d2deb442f0203f23a..0e5ad978e76382a074978581cbeef83f01532201 100644 (file)
@@ -213,8 +213,7 @@ This feature was sponsored by Trent Johnston.
 This rewrite was sponsored by Trent Johnston.
 
 @item String arguments for music functions may be specified without
-@code{#} marks. This allows syntactical constructs (like \clef and
-\bar) to be expressed in generic music functions.
+@code{#} marks. Now, \clef and \bar are also music functions.
 
 @item Ties in chords are also formatted using a scoring based
 formatting. This reduces the number of collisions for ties in chords,
diff --git a/THANKS b/THANKS
index 42ac0b46e4b196228042a9c7785f1d0df6b59356..c5f752f008a4ac6f58d9c52b131bd4e2d3a28020 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -67,6 +67,7 @@ Joe Neeman
 Jukka Akkanen
 Lambros Lambrou
 Laura Conrad
+Mark Steinhauser
 Matevž Jekovec
 Michael Welsh Duggan
 Milan Zamazal
index 712c4d5c04f87fbd29e62f043d58df22031a2ea6..bb48a4572db7fa08ab7ed702a2cc301b6115b044 100644 (file)
@@ -140,16 +140,18 @@ Beam::calc_direction (SCM smob)
          me->suicide ();
          return SCM_UNSPECIFIED;
        }
-      else
+      else 
        {
-         d = to_dir (stems[0]->get_property ("default-direction"));
+         Grob *stem = first_visible_stem (me);
+         d = to_dir (stem->get_property ("default-direction"));
        }
     }
 
-  
   if (count >= 1)
     {
-      d = get_default_dir (me);
+      if (!d)
+       d = get_default_dir (me);
+      
       consider_auto_knees (me);
     }
 
index 6d9d03cf16a2532e53692cb807246854963b032f..8d327c003409031ec360caf71753f9958a1b56c0 100644 (file)
@@ -195,39 +195,9 @@ normally inserted before elements on a line.
 @var{size}."
 
   (if (ly:get-option 'safe)
-      (interpret-markup layout props "not allowed in safe") 
-      (let*
-         ((contents (ly:gulp-file file-name))
-          (bbox (get-postscript-bbox contents))
-          (bbox-size (if (= axis X)
-                         (- (list-ref bbox 2) (list-ref bbox 0))
-                         (- (list-ref bbox 3) (list-ref bbox 1))
-                         ))
-          (factor (exact->inexact (/ size bbox-size)))
-          (scaled-bbox
-           (map (lambda (x) (* factor x)) bbox)))
-
-       (if bbox
-           (ly:make-stencil
-            (list
-             'embedded-ps
-             (format
-
-              "BeginEPSF
-~a ~a scale
-%%BeginDocument: ~a
-~a
-%%EndDocument
-EndEPSF"
-              factor factor
-              file-name
-              contents))
-            (cons (list-ref scaled-bbox 0) (list-ref scaled-bbox 2))
-            (cons (list-ref scaled-bbox 1) (list-ref scaled-bbox 3)))
-           
-           (ly:make-stencil "" '(0 . 0) '(0 . 0)))
-       )))
-
+      (interpret-markup layout props "not allowed in safe")
+      (eps-file->stencil axis size file-name)
+      ))
 
 (def-markup-command (postscript layout props str) (string?)
   "This inserts @var{str} directly into the output as a PostScript
index 04de883e6a78d75a65e7b1afa6718e78cba9b1a0..f7d0ee5b44a5ba0890f3c5e686890498ef5da70d 100644 (file)
    (ly:number->string y2) " lineto stroke"))
 
 (define (embedded-ps string)
+  (display (list "len " (string-length string) "\n"))
   string)
 
-
 (define (glyph-string
         postscript-font-name
         size cid?
index d0e220d26b03b16629db45cb01a63be65e75e4e8..1bfa43a74557f5e897daa2794c4fa445c97eb31e 100644 (file)
@@ -215,3 +215,38 @@ encloses the contents.
                           (ly:stencil-extent annotation X)
                           (cons 10000 -10000)))
     annotation))
+
+
+(define-public (eps-file->stencil axis size file-name)
+  (let*
+      ((contents (ly:gulp-file file-name))
+       (bbox (get-postscript-bbox contents))
+       (bbox-size (if (= axis X)
+                     (- (list-ref bbox 2) (list-ref bbox 0))
+                     (- (list-ref bbox 3) (list-ref bbox 1))
+                     ))
+       (factor (exact->inexact (/ size bbox-size)))
+       (scaled-bbox
+       (map (lambda (x) (* factor x)) bbox)))
+
+    (if bbox
+       (ly:make-stencil
+        (list
+         'embedded-ps
+         (string-append
+          (format
+          "BeginEPSF
+~a ~a scale
+%%BeginDocument: ~a
+"         factor factor
+          file-name
+          )
+          contents
+          "%%EndDocument
+EndEPSF"))
+       
+        (cons (list-ref scaled-bbox 0) (list-ref scaled-bbox 2))
+        (cons (list-ref scaled-bbox 1) (list-ref scaled-bbox 3)))
+       
+       (ly:make-stencil "" '(0 . 0) '(0 . 0)))
+    ))