From b839975aca74e791f0a733266a1fbb24a0b6e92a Mon Sep 17 00:00:00 2001 From: hanwen Date: Wed, 18 Aug 2004 20:40:37 +0000 Subject: [PATCH] * scm/documentation-generate.scm (string-append): add version. * scm/define-markup-commands.scm (box): add box-padding and thickness props for the box command. * Documentation/user/changing-defaults.itely (Text encoding): elucidate use of \encoding for \header strings. * lily/parser.yy (lyric_element): use \encoding for lyrics strings. * lily/score.cc (LY_DEFINE): check if length of music > 0. Fixes: staff-change.ly --- ChangeLog | 13 +++++++++++++ Documentation/user/changing-defaults.itely | 21 ++++++++++++++++++++- lily/parser.yy | 2 ++ lily/score.cc | 10 +++++++--- scm/define-grobs.scm | 4 ++-- scm/define-markup-commands.scm | 10 ++++++---- scm/documentation-generate.scm | 6 +++++- scm/page-layout.scm | 3 +-- scripts/convert-ly.py | 9 +++++++++ 9 files changed, 65 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e5b077589..2adf99ec09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,6 +40,19 @@ 2004-08-18 Han-Wen Nienhuys + * scm/documentation-generate.scm (string-append): add version. + + * scm/define-markup-commands.scm (box): add box-padding and + thickness props for the box command. + + * Documentation/user/changing-defaults.itely (Text encoding): + elucidate use of \encoding for \header strings. + + * lily/parser.yy (lyric_element): use \encoding for lyrics strings. + + * lily/score.cc (LY_DEFINE): check if length of music > 0. Fixes: + staff-change.ly + * lily/output-def.cc (assign_context_def): use set_variable(). * lily/text-item.cc (interpret_string): accept string input diff --git a/Documentation/user/changing-defaults.itely b/Documentation/user/changing-defaults.itely index 710a996f1c..907e3140cc 100644 --- a/Documentation/user/changing-defaults.itely +++ b/Documentation/user/changing-defaults.itely @@ -1794,7 +1794,8 @@ file can be set with @code{\encoding}. @end example This command may be placed anywhere in the input file. The current -encoding is passed as an extra argument to @code{\markup} commands. +encoding is passed as an extra argument to @code{\markup} commands, +and is passed similarly to lyric syllables. If no @code{\encoding} has been specified, then the encoding is taken from the @code{\paper} block (or @code{\bookpaper}, if @code{\paper} @@ -1807,6 +1808,24 @@ set to a string or symbol specifying the encoding, e.g. } @end verbatim +Normal strings, are unaffected by @code{\encoding}. This means that +the following will usually not produce ba@ss{}tuba in the title. + +@verbatim + \header { + title = "Grazing cow" + instrument = "Baßtuba" + } +@end verbatim + +Rather, you should say +@verbatim + instrument = \markup { Baßtuba } +@end verbatim + +@noindent +or set @code{inputencoding} in the @code{\bookpaper} block. + There is a special encoding, called @code{TeX}. This encoding does not reencode text for the font used. Rather, it tries to guess the width of @TeX{} commands, such as @code{\"}. Strings encoded with @code{TeX} diff --git a/lily/parser.yy b/lily/parser.yy index 085aca71c6..0d8f000b12 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -2262,8 +2262,10 @@ simple_element: lyric_element: /* FIXME: lyric flavoured markup would be better */ full_markup { + $$ = $1; } | LYRICS_STRING { + $$ = make_simple_markup (THIS->lexer_->encoding (), $1); } ; diff --git a/lily/score.cc b/lily/score.cc index fa6c6fc384..9964818760 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -94,9 +94,13 @@ LY_DEFINE (ly_run_translator, "ly:run-translator", Output_def *odef = unsmob_output_def (output_def); Music *music = unsmob_music (mus); - if (!music) - return SCM_BOOL_F; - + if (!music + || !music->get_length ().to_bool ()) + { + warning (_ ("Need music in a score")); + return SCM_BOOL_F; + } + SCM_ASSERT_TYPE (music, mus, SCM_ARG1, __FUNCTION__, "Music"); SCM_ASSERT_TYPE (odef, output_def, SCM_ARG2, __FUNCTION__, "Output definition"); diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 26143927d4..e6b2e00b41 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -665,8 +665,8 @@ (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (self-alignment-X . 0) (direction . 1) - (padding . 1.5) - (staff-padding . 1.5) + (padding . 0.2) + (staff-padding . 0.25) (meta . ((interfaces . (side-position-interface multi-measure-interface self-alignment-interface font-interface spanner-interface text-interface)))) )) (NoteCollision diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index a578c38b7b..a89a968da9 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -604,11 +604,13 @@ any sort of property supported by @internalsref{font-interface} and (def-markup-command larger (markup?) bigger-markup) + (def-markup-command (box paper props arg) (markup?) - "Draw a box round @var{arg}" - - (let ((th 0.1) - (pad 0.2) + "Draw a box round @var{arg}. Looks at @code{thickness} and +@code{box-padding} to determine line thickness and padding around the +markup." + (let ((th (chain-assoc-get props 'thickness 0.1)) + (pad (chain-assoc-get props 'box-padding 0.2)) (m (interpret-markup paper props arg))) (box-stencil m th pad))) diff --git a/scm/documentation-generate.scm b/scm/documentation-generate.scm index ccaa6d00ef..efb76d62ed 100644 --- a/scm/documentation-generate.scm +++ b/scm/documentation-generate.scm @@ -140,7 +140,11 @@ @end ignore -") out-port) +" + + "This is the program reference for LilyPond version " (lilypond-version) + + ) out-port) (define top-node (make diff --git a/scm/page-layout.scm b/scm/page-layout.scm index 4afd58b713..fd03aba91a 100644 --- a/scm/page-layout.scm +++ b/scm/page-layout.scm @@ -333,8 +333,7 @@ DONE." (ly:paper-system-number (car (node-lines node)))) (let* ((best-break-node (walk-lines '() '() lines)) - (break-nodes (get-path best-break-node '())) - ) + (break-nodes (get-path best-break-node '()))) (if (ly:get-option 'verbose) (begin diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 49a9985b99..76e5d78b93 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -2144,6 +2144,15 @@ def conv (str): conversions.append (((2, 3, 10), conv, '''\\addlyrics -> \\oldaddlyrics, \\newlyrics -> \\addlyrics''')) +def conv (str): + str = re.sub (r'\\setMmRestFermata\s+(R[0-9.*/]*)', + r'\1^\\fermataMarkup', str) + return str + +conversions.append (((2, 3, 11), conv, + '''\\setMmRestFermata -> ^\\fermataMarkup''')) + + def conv_mode_experiment (str): -- 2.39.5