+2006-01-25 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/lyric-engraver.cc (get_voice_to_lyrics): use NPOS everywhere.
+
2006-01-25 Jan Nieuwenhuizen <janneke@gnu.org>
* flower/include/std-string.hh: String/std::string compatibility:
2006-01-25 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * scm/layout-page-layout.scm (write-page-breaks): write
+ \spacingTweaks #ALIST. Handle grace timing.
+
* scm/: more imports.
* scm/page.scm (make-page): add footer/header.
* scm/layout-page-layout.scm (write-page-breaks): preliminary
version of the system/spacing/linebreak hack writing to the output
- * lily/prob-scheme.cc (LY_DEFINE): take optional 'key val args in ly:make-prob.
+ * lily/prob-scheme.cc (LY_DEFINE): take optional 'key val args in
+ ly:make-prob.
- * lily/grob-scheme.cc (LY_DEFINE): ly:spanner-get-bound -> ly:spanner-bound
+ * lily/grob-scheme.cc (LY_DEFINE): ly:spanner-get-bound ->
+ ly:spanner-bound
2006-01-24 Han-Wen Nienhuys <hanwen@xs4all.nl>
String ps_name;
if (!ps_name_str0
&& file_name != ""
- && (file_name.index (".otf") >= 0
- || file_name.index (".cff") >= 0))
+ && (file_name.index (".otf") != NPOS
+ || file_name.index (".cff") != NPOS))
{
/* UGH: kludge a PS name for OTF/CFF fonts. */
name = name.left_string (idx);
int slash_idx = name.index_last ('/');
- if (slash_idx >= 0)
+ if (slash_idx != NPOS)
name = name.right_string (name.length () - slash_idx - 1);
String initial = name.cut_string (0, 1);
(append
(list chain-grob-member-functions `(,cons 0 0))
(check-slope-callbacks comp))))))
-
+
+
parallelMusic =
#(def-music-function (parser location voice-ids music) (list? ly:music?)
"Define parallel music sequences, separated by '|' (bar check signs),
'elements voice)))
voice-ids voices))
;; Return an empty sequence. this function is actually a "void" function.
- (make-music 'SequentialMusic 'void #t))
\ No newline at end of file
+ (make-music 'SequentialMusic 'void #t))
+
+
+
+
+%% this is a stub. Write your own to suit the spacing tweak output.
+spacingTweaks =
+#(def-music-function (parser location parameters) (list?)
+ (make-music 'SequentialMusic 'void #t))
(set! tweaks
(acons when property-pairs
tweaks)))
-
+ (define (graceless-moment mom)
+ (ly:make-moment
+ (ly:moment-main-numerator mom)
+ (ly:moment-main-denominator mom)
+ 0 0))
+
(define (moment->skip mom)
- (format "s1*~a/~a"
- (ly:moment-main-numerator mom)
- (ly:moment-main-denominator mom)))
-
+ (let*
+ ((main (if (> (ly:moment-main-numerator mom) 0)
+ (format "\\skip 1*~a/~a"
+ (ly:moment-main-numerator mom)
+ (ly:moment-main-denominator mom))
+ ""))
+ (grace (if (< (ly:moment-grace-numerator mom) 0)
+ (format "\\grace { \\skip 1*~a/~a }"
+ (- (ly:moment-grace-numerator mom))
+ (ly:moment-grace-denominator mom))
+ "")))
+
+ (format "~a~a" main grace)))
+
(define (dump-tweaks out-port tweak-list last-moment)
(if (not (null? tweak-list))
(let*
(diff (ly:moment-sub now last-moment))
(these-tweaks (cdar tweak-list))
(skip (moment->skip diff))
-
- (base (format "\\overrideProperty
- #\"Score.NonMusicalPaperColumn\"
- #'line-break-system-details
- #'~a" these-tweaks))
+ (line-break-str (if (assoc-get 'line-break these-tweaks #f)
+ "\\break\n"
+ ""))
+ (page-break-str (if (assoc-get 'page-break these-tweaks #f)
+ "\\pageBreak\n"
+ ""))
+ (space-tweaks (format "\\spacingTweaks #'~a\n"
+ (with-output-to-string
+ (lambda ()
+ (pretty-print
+
+ (assoc-get 'spacing-parameters these-tweaks '()))))
+ ))
+ (base (format "~a~a~a"
+ line-break-str
+ page-break-str
+ space-tweaks))
)
- (format out-port "\\skip ~a\n~a\n" skip base)
- (dump-tweaks out-port (cdr tweak-list) now)
- )
-
- ))
+ (format out-port "~a\n~a\n" skip base)
+ (dump-tweaks out-port (cdr tweak-list) (graceless-moment now))
+ )))
(define (handle-page page)
+ (define index 0)
(define (handle-system sys)
(let*
- ((props '((line-break . #t))))
+ ((props `((line-break . #t)
+ (spacing-parameters
+ . ((system-Y-extent . ,(paper-system-extent sys Y))
+ (system-refpoint-Y-extent . ,(paper-system-staff-extents sys))
+ (system-index . ,index)
+ (page-system-count . ,(length (page-lines page)))
+ (page-printable-height . ,(page-printable-height page))
+ (page-space-left . ,(page-property page 'space-left))))
+ )))
(if (equal? (car (page-lines page)) sys)
(set! props (cons '(page-break . #t)
props)))
-
(if (not (ly:prob-property? sys 'is-title))
(record (ly:grob-property (ly:spanner-bound (ly:prob-property sys 'system-grob) LEFT) 'when)
props))
+
+ (set! index (1+ index))
))
(for-each handle-system (page-lines page)))