From: Han-Wen Nienhuys Date: Fri, 11 Oct 2002 23:02:55 +0000 (+0000) Subject: * lily/parser.yy (sup_quotes): use '\'' for sup_quotes. X-Git-Tag: release/1.7.3~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1296d158c06543204f863a09855147c843d78377;p=lilypond.git * lily/parser.yy (sup_quotes): use '\'' for sup_quotes. * lily/break-align-interface.cc (do_alignment): right-edge spacing key adds space at the end of line. --- diff --git a/ChangeLog b/ChangeLog index 7c4bd76ae0..43ce953973 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-10-12 Han-Wen Nienhuys + + * lily/parser.yy (sup_quotes): use '\'' for sup_quotes. + + * lily/break-align-interface.cc (do_alignment): right-edge spacing + key adds space at the end of line. + 2002-10-11 Jan Nieuwenhuizen * scm/sketch.scm: Fix beams. @@ -26,7 +33,7 @@ cloning from lexer. * scm/music-functions.scm (make-multi-measure-rest): move mmrest - logic out of the parser. + logic out of the parser. Add bar checks on both ends. * Documentation/user/refman.itely (Multi measure rests): add more notes about mm rests. diff --git a/Documentation/user/invoking.itexi b/Documentation/user/invoking.itexi index eeba2e1737..b6d34c0a33 100644 --- a/Documentation/user/invoking.itexi +++ b/Documentation/user/invoking.itexi @@ -297,7 +297,8 @@ Show the warranty with which GNU LilyPond comes. (It comes with @subsection Titling layout Ly2dvi extracts the following header fields from the LY files to -generate titling: +generate titling. An example demonstrating all these fields is in +@file{input/test/ly2dvi-testpage.ly}. @table @code @item title diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 9e05bb9b1e..787d21dcd4 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -4472,6 +4472,8 @@ example of those is in @file{input/test/cue-notes.ly}. @cindex cue notes @cindex font size @cindex size +@cindex symbol size +@cindex glyph size The font used for printing a object can be selected by setting @code{font-name}, e.g. @@ -4715,6 +4717,8 @@ are chosen whenever the page gets full. @cindex distance between staves @cindex staff distance @cindex between staves, distance +@cindex staffs per page + The height of each system is determined automatically by lilypond, to keep systems from bumping into each other, some minimum distances are diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 36540af6d5..00754151b4 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1691,6 +1691,16 @@ will be at the left. @} @end example +TODO: +@example + +scoreA = \score @{ \deelA @} +scoreB = \score @{ \deelA @} + +% \score @{ \scoreA @} +\score @{ \scoreB @} + +@end example @separate @example diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index 9bf4e4503a..edcc77c730 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -76,14 +76,16 @@ Break_align_interface::do_alignment (Grob *me) = Pointer_group_interface__extract_grobs (me, (Grob*)0, "elements"); Array extents; - + + int last_nonempty = -1; for (int i=0; i < elems.size (); i++) { Interval y = elems[i]->extent (elems[i], X_AXIS); extents.push (y); + if (!y.empty_b()) + last_nonempty = i; } - int idx = 0; while (idx < extents.size () && extents[idx].empty_b ()) idx++; @@ -94,27 +96,36 @@ Break_align_interface::do_alignment (Grob *me) offsets[i] = 0.0; + Real extra_right_space = 0.0; int edge_idx = -1; - while (idx < elems.size() - 1) + while (idx < elems.size()) { int next_idx = idx+1; while (next_idx < elems.size() && extents[next_idx].empty_b() - && next_idx != elems.size() -1 ) + ) next_idx++; Grob *l = elems[idx]; - Grob *r = elems[next_idx]; + Grob *r = 0; + + if (next_idx < elems.size()) + r = elems[next_idx]; SCM alist = SCM_EOL; + + /* + Find the first grob with a space-alist entry. + */ for (SCM s= l->get_grob_property ("elements"); gh_pair_p (s) ; s = gh_cdr (s)) { Grob *elt = unsmob_grob (gh_car (s)); if (edge_idx < 0 - && elt->get_grob_property ("break-align-symbol") == ly_symbol2scm( "left-edge")) + && elt->get_grob_property ("break-align-symbol") + == ly_symbol2scm( "left-edge")) edge_idx = idx; SCM l =elt->get_grob_property ("space-alist"); @@ -125,25 +136,21 @@ Break_align_interface::do_alignment (Grob *me) } } - SCM rsym = SCM_EOL; + SCM rsym = r ? SCM_EOL : ly_symbol2scm ("right-edge"); /* We used to use #'cause to find out the symbol and the spacing table, but that gets icky when that grob is suicided for some reason. */ - for (SCM s = r->get_grob_property ("elements"); - gh_pair_p (s); s = gh_cdr (s)) - { - Grob * elt =unsmob_grob(gh_car (s)); + for (SCM s = r ? r->get_grob_property ("elements") : SCM_EOL; + !gh_symbol_p (rsym) && gh_pair_p (s); s = gh_cdr (s)) + { + Grob * elt =unsmob_grob(gh_car (s)); - SCM sym = elt->get_grob_property ("break-align-symbol"); - if (gh_symbol_p (sym)) - { - rsym = sym; - break; - } - } + rsym = elt->get_grob_property ("break-align-symbol"); + } + if (rsym == ly_symbol2scm("left-edge")) edge_idx = next_idx; @@ -178,15 +185,21 @@ Break_align_interface::do_alignment (Grob *me) type = gh_car (entry) ; } - if (type == ly_symbol2scm ("extra-space")) - offsets[next_idx] = extents[idx][RIGHT] + distance; - else if (type == ly_symbol2scm("minimum-space")) - offsets[next_idx] = extents[idx][RIGHT] >? distance; + if (r) + { + if (type == ly_symbol2scm ("extra-space")) + offsets[next_idx] = extents[idx][RIGHT] + distance; + else if (type == ly_symbol2scm("minimum-space")) + offsets[next_idx] = extents[idx][RIGHT] >? distance; + } + else + { + extra_right_space = distance; + } idx = next_idx; } - Real here = 0.0; Interval total_extent; @@ -201,7 +214,9 @@ Break_align_interface::do_alignment (Grob *me) if (item->break_status_dir () == LEFT) - alignment_off = -total_extent[RIGHT]; + { + alignment_off = - total_extent[RIGHT] - extra_right_space; + } else if (edge_idx < 0) alignment_off = -total_extent[LEFT]; diff --git a/lily/lexer.ll b/lily/lexer.ll index ab2f85714f..88dd1a9ac1 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -154,7 +154,7 @@ HYPHEN -- } \"[^"]*\" { /* got the version number */ String s (YYText ()+1); - s = s.left_string (s.index_last ('"')); + s = s.left_string (s.index_last ('\"')); yy_pop_state (); if (!valid_version_b (s)) @@ -701,7 +701,7 @@ scan_fraction (String frac) int d = String_convert::dec2int (right); return gh_cons (gh_int2scm (n), gh_int2scm (d)); } - +#if 0 /* avoid silly flex induced gcc warnings */ static void yy_push_state (int) {;} static void yy_pop_state () {;} @@ -718,3 +718,4 @@ avoid_silly_flex_induced_gcc_warnings () yy_top_state (); avoid_silly_flex_induced_gcc_warnings (); } +#endif diff --git a/lily/parser.yy b/lily/parser.yy index f65f428162..9bb82de271 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1436,10 +1436,10 @@ verbose_event: ; sup_quotes: - "'" { + '\'' { $$ = 1; } - | sup_quotes "'" { + | sup_quotes '\'' { $$ ++; } ; @@ -2146,7 +2146,7 @@ void My_lily_parser::set_yydebug (bool ) { #if 0 - yydebug = b; + yydebug = 1; #endif } @@ -2155,7 +2155,6 @@ extern My_lily_parser * current_parser; void My_lily_parser::do_yyparse () { - current_parser = this;; yyparse ((void*)this); } diff --git a/scm/grob-description.scm b/scm/grob-description.scm index 3a36728971..0c45295e21 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -78,6 +78,7 @@ (custos . (minimum-space . 2.0)) (clef . (minimum-space . 1.0)) (first-note . (extra-space . 1.3)) + (right-edge . (extra-space . 0.0)) )) ;; @@ -252,6 +253,7 @@ (font-family . ancient) (space-alist . ( (first-note . (minimum-space . 0.0)) + (right-edge . (extra-space . 0.1)) )) (meta . ((interfaces . (custos-interface staff-symbol-referencer-interface @@ -332,6 +334,7 @@ (breathing-sign . (minimum-space . 0.0)) (clef . (extra-space . 1.0)) (first-note . (extra-space . 1.0)) + (right-edge . (extra-space . 0.0)) (key-signature . (extra-space . 0.0)) )) (meta . ((interfaces . (break-aligned-interface item-interface )))) @@ -1076,6 +1079,7 @@ (break-visibility . ,all-visible) (space-alist . ( (first-note . (extra-space . 2.0)) + (right-edge . (extra-space . 0.8)) (staff-bar . (minimum-space . 2.0)) )) (breakable . #t) diff --git a/scm/translator-property-description.scm b/scm/translator-property-description.scm index 9d55aa3ce7..51798c329a 100644 --- a/scm/translator-property-description.scm +++ b/scm/translator-property-description.scm @@ -114,7 +114,7 @@ file @file{lyrics-multi-stanza.ly}. ") (translator-property-description 'automaticMelismata boolean? " If -set, \addlyrics will assume that beams, slurs and ties signal +set, \\addlyrics will assume that beams, slurs and ties signal melismata, and align lyrics accordingly. ") @@ -188,7 +188,7 @@ Staff.defaultBarType will have no effect. @table @samp @item (), or unset Behave in normal way: remove one set of grobs when in unisolo. -@item allways: +@item always: Remove any grob that comes along. @item never: Do nothing. @@ -198,7 +198,7 @@ Do nothing. @table @samp @item (), or unset Behave in normal way: remove spanners when in unisolo. -@item allways: +@item always: Remove any spanners that come along. @item never: Do nothing.