From: Carl Sorensen Date: Tue, 22 Mar 2011 22:10:46 +0000 (-0600) Subject: Fix 1569: Bad behavior of NoteNames context X-Git-Tag: release/2.13.56-1~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;ds=sidebyside;h=a3b2f9e04d71a7d9748aa2d824a16058fd84461b;p=lilypond.git Fix 1569: Bad behavior of NoteNames context Changed default value of 'staff-affinity to #UP Changed default spacing parameters to be the same as for Lyrics context Added some documentation about spacing of nonstaff lines to help users better understand nonstaff line spacing. Added regression test file --- diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index 8c2edce2d5..00901e7e2e 100644 --- a/Documentation/notation/spacing.itely +++ b/Documentation/notation/spacing.itely @@ -1967,9 +1967,9 @@ set to @code{UP} should not immediately follow one that is set to @code{DOWN}; those at the bottom should use @code{UP}. Setting @code{staff-affinity} for a staff causes it to be treated as a non-staff line. Setting @code{staff-affinity} to @code{#f} causes -a non-staff line to be treated as a staff. - -@c TODO: verify last clause below ("even if other...") +a non-staff line to be treated as a staff. Setting +@code{staff-affinity} to @code{UP}, @code{CENTER}, or @code{DOWN} +causes a staff to be spaced as a non-staff line. @item nonstaff-relatedstaff-spacing The distance between the current non-staff line and the nearest @@ -1979,7 +1979,12 @@ either @code{UP} or @code{DOWN}. If @code{staff-affinity} is @code{CENTER}, then @code{nonstaff-relatedstaff-spacing} is used for the nearest staves on @emph{both} sides, even if other non-staff lines appear between the current one and either of the -staves. +staves. This means that the placement of a non-staff line depends +on both the surrounding staves and the surrounding non-staff lines. +Setting the @code{stretchability} of one of these types of spacing to +a small value will make that spacing dominate. Setting the +@code{stretchability} to a large value will make that spacing have +little effect. @item nonstaff-nonstaff-spacing The distance between the current non-staff line and the next diff --git a/input/regression/note-names.ly b/input/regression/note-names.ly index 2c756679a3..615b37a3c8 100644 --- a/input/regression/note-names.ly +++ b/input/regression/note-names.ly @@ -1,27 +1,37 @@ -\version "2.13.38" +\version "2.13.56" \header { - texidoc = "Various languages are supported for note names input. -Selecting another language within a music expression is possible, -and doesn't break point-and-click abilities. -" -} + texidoc = " + NoteNames context should be close to the related notes, + and should not collide with the tempo markings. + " +} -%% Old syntax. -\include "english.ly" +\paper { + system-system-spacing + #'basic-distance = #10 % increase this value for more space +} -\relative c'' { - g4 bf d c +notes = \relative c { + c'4 c c c +} - %% Manual override of the pitchnames variable - %% and the parser note names: - #(begin - (set! pitchnames (ly:assoc-get 'nederlands language-pitch-names)) - (ly:parser-set-note-names parser pitchnames)) - bes4 a g fis +mylyrics = \lyricmode { + \tempo "Allegro" + ly -- ric ly -- ric +} - %% The \language command acts in the same way: - \language "italiano" - sol4 fa mib re +\score { + << + \new Voice = "voice" { + \repeat unfold 13 \notes + } + \context NoteNames { + \repeat unfold 13 \notes + } + \new Lyrics \lyricsto "voice" { + \repeat unfold 13 \mylyrics + } + >> } diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 5a73bbb9cd..8cfd9db44c 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -465,8 +465,18 @@ printing of a single line of lyrics." \description "A context for printing the names of notes." \consists "Axis_group_engraver" - % FIXME: not sure what the default should be here. - \override VerticalAxisGroup #'staff-affinity = #DOWN + \override VerticalAxisGroup #'staff-affinity = #UP + \override VerticalAxisGroup #'nonstaff-nonstaff-spacing = + #'((basic-distance . 0) + (minimum-distance . 2.8) + (padding . 0.2) + (stretchability . 0)) + \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing = + #'((basic-distance . 5.5) + (padding . 0.5) + (stretchability . 1)) + \override VerticalAxisGroup + #'nonstaff-unrelatedstaff-spacing #'padding = 1.5 \consists "Tie_engraver" \consists "Note_name_engraver"