]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'jneeman'
authorJoe Neeman <joeneeman@gmail.com>
Tue, 10 Jul 2007 00:24:25 +0000 (10:24 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Tue, 10 Jul 2007 00:24:25 +0000 (10:24 +1000)
input/manual/font-table.ly
lily/include/constrained-breaking.hh
lily/lexer.ll
lily/page-breaking.cc
lily/parser.yy

index 74f0ef978a58f508a89e9370a23052fb1a6376a4..dae8fd4597580fff1de2b0cfda50aa8142cf92fe 100644 (file)
@@ -9,9 +9,10 @@
   evenFooterMarkup = \markup {}
   }
 
-\version "2.11.20"
+\version "2.11.27"
 
-#(define (doc-char name)
+#(define-markup-command (doc-char layout props name) (string?)
+  (interpret-markup layout props
    (let* ((n (string-length name)))
      (if (> n 24)
         ;; split long glyph names near the middle at dots
                               left-dot-pos))
                (left (substring name 0 split-pos))
                (right (substring name split-pos)))
-          (make-line-markup
-           (list
-            (make-pad-to-box-markup
-             '(0 . 36)
-             '(-2 . 2)
-             (make-column-markup
-              (list
-               (make-typewriter-markup left)
-               (make-typewriter-markup
-                (make-concat-markup
-                 (list "  " right))))))
-            (make-pad-to-box-markup
-             '(-2 . 4)
-             '(-3.5 . 3.5)
-             (make-huge-markup (make-musicglyph-markup name))))))
-        (make-line-markup
-         (list
-          (make-pad-to-box-markup
-           '(0 . 36)
-           '(-2 . 2)
-           (make-typewriter-markup name))
-          (make-pad-to-box-markup
-           '(-2 . 4)
-           '(-3.5 . 3.5)
-           (make-huge-markup (make-musicglyph-markup name))))))))
-
-#(define (min-length lst n)
-   "(min        (length lst) n)"
-   (if (or (null? lst) (<= n 0))
-       0
-       (1+ (min-length (cdr lst) (1- n)))))
-
-#(define (doc-chars names acc)
-   (let*
-       ((n (min-length names 2))
-       (head (take names n))
-       (tail (drop names n)))
-     (if (null? head)
-        acc
-        (doc-chars tail
-                   (cons
-                    (make-line-markup (map doc-char head))
-                    acc)))))
-
-#(define (group-lines lines)
-   (let*
-       ((n (min-length lines 25))
-       (head (take lines n))
-       (tail (drop lines n)))
-     (cons
-      (make-column-markup head)
-      (if (null? tail)
-         '()
-         (group-lines tail)))))
-
-#(let*
-     ((glyphs (delete ".notdef"
-                     (ly:otf-glyph-list
-                      (ly:font-load "emmentaler-20"))))
-      (lines (doc-chars glyphs '()))
-      (pages (group-lines (reverse lines))))
-  (collect-scores-for-book
-   parser
-   (map (lambda (x)
-         (make-override-markup '(word-space . 4) x))
-    pages)))
+          (markup
+            #:pad-to-box '(0 . 36) '(-2 . 2) #:column (#:typewriter left
+                                                       #:typewriter #:concat ("  " right))
+            #:pad-to-box '(-2 . 4) '(-3.5 . 3.5) #:huge #:musicglyph name))
+        (markup
+          #:pad-to-box '(0 . 36) '(-2 . 2) #:typewriter name
+          #:pad-to-box '(-2 . 4) '(-3.5 . 3.5) #:huge #:musicglyph name)))))
+
+#(define-markup-list-command (doc-chars layout props names) (list?)
+   (define (min-length lst n)
+     "(min      (length lst) n)"
+     (if (or (null? lst) (<= n 0))
+        0
+        (1+ (min-length (cdr lst) (1- n)))))
+   (define (doc-chars-aux names acc)
+     (let* ((n (min-length names 2))
+           (head (take names n))
+           (tail (drop names n)))
+       (if (null? head)
+          (reverse! acc)
+          (doc-chars-aux tail
+                        (cons (make-line-markup (map make-doc-char-markup head))
+                              acc)))))
+   (interpret-markup-list layout props (doc-chars-aux names (list))))
+
+\markuplines \override-lines #'(word-space . 4)
+             \doc-chars #(delete ".notdef"
+                          (ly:otf-glyph-list (ly:font-load "emmentaler-20")))
index 2d93ff2a8d9a28f5d985d55dfe07ad947702b66f..9aa5862761e4a4b78c5256524696721ac369b3da 100644 (file)
@@ -50,9 +50,9 @@ struct Line_details {
   {
     force_ = 0;
     extent_ = unsmob_stencil (pb->get_property ("stencil")) ->extent (Y_AXIS);
-    padding_ = 0;
+    padding_ = robust_scm2double (pb->get_property ("next-padding"), 0);
     bottom_padding_ = 0;
-    space_ = 1.0;
+    space_ = robust_scm2double (pb->get_property ("next-space"), 1.0);
     inverse_hooke_ = 1.0;
     break_permission_ = ly_symbol2scm ("allow");
     page_permission_ = pb->get_property ("page-break-permission");
index 71fb56b385c6d86205a735ed18c2ff0d75afb95c..71fb2479eec8596df6d390f989aa0b46f9176782 100644 (file)
@@ -551,6 +551,8 @@ BOM_UTF8    \357\273\277
                        SCM tag = scm_cdr(s2);
                        if (tag == ly_symbol2scm("empty"))
                                return MARKUP_LIST_HEAD_EMPTY;
+                       else if (tag == ly_symbol2scm ("scheme0"))
+                               return MARKUP_LIST_HEAD_SCM0;
                        else if (tag == ly_symbol2scm ("markup-list0"))
                                return MARKUP_LIST_HEAD_LIST0;
                        else if (tag == ly_symbol2scm ("scheme0-markup-list1"))
@@ -558,7 +560,7 @@ BOM_UTF8    \357\273\277
                        else if (tag == ly_symbol2scm ("scheme0-scheme1-markup-list2"))
                                return MARKUP_LIST_HEAD_SCM0_SCM1_LIST2;
                        else {
-                               programming_error ("no parser tag defined for this markup signature"); 
+                               programming_error ("no parser tag defined for this markup list signature"); 
                                ly_display_scm (s);
                                assert(false);
                        }
index 709ee52cb3eb433a9d9ead01143f12e49a07d9f2..270337da7d306255e932dcfd90597461971c6300 100644 (file)
@@ -549,7 +549,9 @@ Page_breaking::cache_line_details (vsize configuration_index)
            {
              assert (div[i] == 1);
              uncompressed_line_details_.push_back (Line_details (system_specs_[sys].prob_));
-             uncompressed_line_details_.back ().padding_ = padding;
+             uncompressed_line_details_.back ().padding_ =
+                robust_scm2double (system_specs_[sys].prob_->get_property ("next-padding"),
+                                   padding);
            }
        }
       cached_line_details_ = compress_lines (uncompressed_line_details_);
index 7ded9b737792b741947be52f450523df55ffd7b6..8fc0a89c1b417a394c9f027eb0f756baf4d49dca 100644 (file)
@@ -284,6 +284,7 @@ If we give names, Bison complains.
 %token <scm> MARKUP_HEAD_SCM0_SCM1_SCM2
 %token <scm> MARKUP_LIST_HEAD_EMPTY
 %token <scm> MARKUP_LIST_HEAD_LIST0
+%token <scm> MARKUP_LIST_HEAD_SCM0
 %token <scm> MARKUP_LIST_HEAD_SCM0_LIST1
 %token <scm> MARKUP_LIST_HEAD_SCM0_SCM1_LIST2
 %token <scm> MARKUP_IDENTIFIER
@@ -2276,6 +2277,9 @@ markup_command_list:
        | MARKUP_LIST_HEAD_LIST0 markup_list    {
                $$ = scm_list_2 ($1, $2);
        }
+       | MARKUP_LIST_HEAD_SCM0 embedded_scm    {
+               $$ = scm_list_2 ($1, $2);
+       }
        | MARKUP_LIST_HEAD_SCM0_LIST1 embedded_scm markup_list  {
                $$ = scm_list_3 ($1, $2, $3);
        }