From b6b22a6efc6fe2f84c0b4f7cc4aa3550316bc89a Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 12 Jun 2004 23:01:43 +0000 Subject: [PATCH] (get_line): extract page-penalty from the left bound. --- ChangeLog | 9 ++++++++- Documentation/user/notation.itely | 14 +++++++++++--- lily/book.cc | 1 - lily/paper-book.cc | 10 +++++----- lily/system.cc | 30 +++++++----------------------- scm/document-markup.scm | 3 +-- 6 files changed, 32 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1a649e501..70190456c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-06-13 Han-Wen Nienhuys + + * lily/system.cc (get_line): extract page-penalty from the left + bound. + + * scm/fret-diagrams.scm (fret-diagram): use @table for documentation + 2004-06-12 Han-Wen Nienhuys * scm/framework-ps.scm: don't load output-XXX from framework-XXX @@ -66,7 +73,7 @@ * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): remove override of Beam::position-callbacks. Why would grace beams not be - quantized? Fixes: weird-stem-size-grace. Backportme. + quantized? Fixes: weird-stem-size-grace. * lily/new-lyric-combine-music-iterator.cc (find_voice): issue warning only once. Backportme. diff --git a/Documentation/user/notation.itely b/Documentation/user/notation.itely index e14580f87f..bae708cb0e 100644 --- a/Documentation/user/notation.itely +++ b/Documentation/user/notation.itely @@ -233,6 +233,8 @@ note with the @code{\rest} keyword appended. This makes manual formatting in polyphonic music easier. Rest collision testing will leave these rests alone +@cindex @code{\rest} + @lilypond[quote,raggedright,verbatim] a'4\rest d'4\rest @end lilypond @@ -292,6 +294,9 @@ Program reference: @internalsref{SkipEvent}, @internalsref{SkipMusic}. @cindex duration +@cindex @code{\longa} +@cindex @code{\breve} +@cindex @code{\maxima} In Note, Chord, and Lyrics mode, durations are designated by numbers @@ -1086,6 +1091,8 @@ indicating how much of the measure has passed at this point. @node Unmetered music @subsection Unmetered music +@cindex @code{\bar} + Bar lines and bar numbers are calculated automatically. For unmetered music (e.g. cadenzas), this is not desirable. By setting @code{Score.timing} to false, this automatic timing can be switched @@ -1099,7 +1106,6 @@ off. Empty bar lines, indicate where line breaks can occur. - @refcommands @cindex @code{\cadenzaOn} @@ -1211,6 +1217,8 @@ The easiest way to enter fragments with more than one voice on a staff is to split chords using the separator @code{\\}. You can use it for small, short-lived voices or for single chords +@cindex @code{\\} + @lilypond[quote,verbatim,fragment] \context Staff \relative c'' { c4 << { f d e } \\ { b c2 } >> @@ -1268,8 +1276,8 @@ Similarly, you can merge half note heads with eighth notes, by setting c8 c4. } \\ { c2 c2 } >> @end lilypond -LilyPond also vertically shifts rests that are opposite of a stem - +LilyPond also vertically shifts rests that are opposite of a stem, +for example @lilypond[quote,raggedright,fragment,verbatim] \context Voice << c''4 \\ r4 >> diff --git a/lily/book.cc b/lily/book.cc index 267b5a6fac..789c368078 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -69,7 +69,6 @@ Paper_book * Book::process (String outname, Output_def *default_def) { Paper_book *paper_book = new Paper_book (); - Real scale = ly_scm2double (bookpaper_->c_variable ("outputscale")); Output_def * scaled_bookdef = scale_output_def (bookpaper_, scale); diff --git a/lily/paper-book.cc b/lily/paper-book.cc index 9836726869..39c3f5f7aa 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -420,11 +420,11 @@ Paper_book::pages () SCM all = lines (); SCM proc = paper->c_variable ("page-breaking"); SCM pages = scm_apply_0 (proc, scm_list_n (all, - self_scm (), - scm_make_real (text_height), - scm_make_real (-copy_height), - scm_make_real (-tag_height), - SCM_UNDEFINED)); + self_scm (), + scm_make_real (text_height), + scm_make_real (-copy_height), + scm_make_real (-tag_height), + SCM_UNDEFINED)); SCM *page_tail = &pages_; diff --git a/lily/system.cc b/lily/system.cc index caab3a2bb5..401cca393a 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -339,7 +339,6 @@ System::get_line () SCM exprs = SCM_EOL; SCM *tail = &exprs; - Real penalty = 0; for (int i = LAYER_COUNT; i--;) for (SCM s = all; ly_c_pair_p (s); s = ly_cdr (s)) { @@ -366,31 +365,10 @@ System::get_line () *tail = scm_cons (st.expr (), SCM_EOL); tail = SCM_CDRLOC(*tail); - /* - UGH. back-end should extract this info from the System? - */ - if (g->original_) - { - /* - Huh ? penalties from all columns are added ??!! --hwn - */ - if (Item *it = dynamic_cast (g)) - { - Grob *col = it->get_column (); - SCM s = col->get_property ("page-penalty"); - - // FIXME; page breaking is not discrete at +-10000 - if (ly_c_number_p (s)) // && fabs (ly_scm2double (s)) < 10000) - penalty += ly_scm2double (s); - } - } } - /* - TODO: fix user penalties. - - */ + Interval x (extent (this, X_AXIS)); Interval y (extent (this, Y_AXIS)); Stencil sys_stencil (Box (x,y), @@ -399,6 +377,12 @@ System::get_line () Paper_line *pl = new Paper_line (sys_stencil, false); + + + Item * break_point =this->get_bound(LEFT); + pl->penalty_ = + robust_scm2double (break_point->get_property ("page-penalty"), 0.0); + return scm_gc_unprotect_object (pl->self_scm ()); } diff --git a/scm/document-markup.scm b/scm/document-markup.scm index 77c5d5228a..ad02d4f3ed 100644 --- a/scm/document-markup.scm +++ b/scm/document-markup.scm @@ -7,8 +7,7 @@ (define (doc-markup-function func) (let* - ( - (doc-str (procedure-documentation func) ) + ((doc-str (procedure-documentation func) ) (f-name (symbol->string (procedure-name func))) (c-name (regexp-substitute/global #f "-markup$" f-name 'pre "" 'post)) (sig (object-property func 'markup-signature)) -- 2.39.5