From 80c029b079858c3278f30f6ff268ba350bf74e48 Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Thu, 25 Apr 2013 21:16:57 -0700 Subject: [PATCH] Better break-align settings for marks Issues 1150 712 and 1263 --- .../notation/changing-defaults.itely | 20 +++++++++---------- input/regression/key-clefs.ly | 6 ++++-- .../metronome-marking-break-align.ly | 19 ++++++++++++------ scm/define-grobs.scm | 6 ++++-- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/Documentation/notation/changing-defaults.itely b/Documentation/notation/changing-defaults.itely index bad22d3e84..03727fedd6 100644 --- a/Documentation/notation/changing-defaults.itely +++ b/Documentation/notation/changing-defaults.itely @@ -3844,11 +3844,11 @@ objects other than bar lines. These objects include @code{ambitus}, @code{left-edge}, @code{key-cancellation}, @code{key-signature}, and @code{time-signature}. -By default, rehearsal marks and bar numbers will be horizontally -centered above the object: +Each type of object has its own default reference point, to which +rehearsal marks are aligned: @lilypond[verbatim,quote,relative=1] -% The rehearsal mark will be centered above the Clef +% The rehearsal mark will be aligned to right edge of the Clef \override Score.RehearsalMark.break-align-symbols = #'(clef) \key a \major \clef treble @@ -3881,13 +3881,13 @@ line is invisible the object is aligned to the place where the bar line would be. @lilypond[verbatim,quote,relative=1] -% The rehearsal mark will be centered above the Key Signature +% The rehearsal mark will be aligned to the right edge of the Key Signature \override Score.RehearsalMark.break-align-symbols = #'(key-signature clef) \key a \major \clef treble \mark "↓" e1 -% The rehearsal mark will be centered above the Clef +% The rehearsal mark will be aligned to the right edge of the Clef \set Staff.explicitKeySignatureVisibility = #all-invisible \override Score.RehearsalMark.break-align-symbols = #'(key-signature clef) \key a \major @@ -3909,20 +3909,20 @@ can be changed, as shown in the following example. In a score with multiple staves, this setting should be done for all the staves. @lilypond[verbatim,quote,relative=1] -% The RehearsalMark will be centered above the Key Signature +% The RehearsalMark will be aligned with the right edge of the Key Signature \override Score.RehearsalMark.break-align-symbols = #'(key-signature) \key a \major \clef treble \time 4/4 \mark "↓" e1 -% The RehearsalMark will be aligned with the left edge of the Key Signature -\once \override Score.KeySignature.break-align-anchor-alignment = #LEFT +% The RehearsalMark will be centered above the Key Signature +\once \override Score.KeySignature.break-align-anchor-alignment = #CENTER \mark "↓" \key a \major e1 -% The RehearsalMark will be aligned with the right edge of the Key Signature -\once \override Score.KeySignature.break-align-anchor-alignment = #RIGHT +% The RehearsalMark will be aligned with the left edge of the Key Signature +\once \override Score.KeySignature.break-align-anchor-alignment = #LEFT \key a \major \mark "↓" e1 diff --git a/input/regression/key-clefs.ly b/input/regression/key-clefs.ly index ec18bc00be..cef2ac4b52 100644 --- a/input/regression/key-clefs.ly +++ b/input/regression/key-clefs.ly @@ -25,11 +25,13 @@ and @code{flat-positions}." } \clef bass \key cis \major cis \key ces \major ces \break R1 - \tempo "B-sharp on top" + \override Score.RehearsalMark.self-alignment-X = #LEFT + \override Score.RehearsalMark.font-size = #0 + \mark "B-sharp on top" \override Staff.KeySignature.sharp-positions = #'(6 0 1 2 3 4 5) \override Staff.KeyCancellation.sharp-positions = #'(6 0 1 2 3 4 5) \key cis \major R - \tempo "Flats throughout the staff" + \mark "Flats throughout the staff" \override Staff.KeySignature.flat-positions = #'((-5 . 5)) \override Staff.KeyCancellation.flat-positions = #'((-5 . 5)) \key ces \major R diff --git a/input/regression/metronome-marking-break-align.ly b/input/regression/metronome-marking-break-align.ly index 81e2599f03..90e99212b8 100644 --- a/input/regression/metronome-marking-break-align.ly +++ b/input/regression/metronome-marking-break-align.ly @@ -2,13 +2,14 @@ \header { texidoc = "@code{\\tempo} marks are aligned with the time signature -or first musical element unless the first element is a multi-measure -rest: in this case, the tempo mark is aligned with the bar line. +or the position of the first note. By overriding @code{break-align-symbols} the default alignment can be -changed, as shown by the final metronome mark in this snippet, aligned -with a key signature. -" +changed. If no symbol in @code{break-align-symbols} is present, the +property @code{non-break-align-symbols} determines the alignment. If +the alignment object is a multi-measure rest, the tempo mark is aligned +with the preceding bar line. +" } \layout { @@ -23,7 +24,7 @@ with a key signature. c1 \break \tempo "T-break" c1 - \tempo "T-rest" + \tempo "T-phantom" R1 \break \time 8/8 \tempo "T-time" @@ -31,5 +32,11 @@ with a key signature. \override Score.MetronomeMark.break-align-symbols = #'(key-signature) \key as \major \tempo "T-key" + c1 \break + \override Score.MetronomeMark.non-break-align-symbols = + #'(note-column-interface multi-measure-rest-interface) + \tempo "T-rest" + R1 + \tempo "T-rest" R1 } diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 31d431c7e1..81e4377ff4 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -539,6 +539,7 @@ . ( (avoid-slur . inside) (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor) + (break-align-anchor-alignment . ,RIGHT) (break-align-symbol . clef) (break-visibility . ,begin-of-line-visible) (extra-spacing-height . ,pure-from-neighbor-interface::extra-spacing-height-at-beginning-of-line) @@ -1180,6 +1181,7 @@ . ( (avoid-slur . inside) (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor) + (break-align-anchor-alignment . ,RIGHT) (break-align-symbol . key-signature) (break-visibility . ,begin-of-line-visible) (glyph-name-alist . ,standard-alteration-glyph-name-alist) @@ -1433,7 +1435,7 @@ (list ly:self-alignment-interface::x-aligned-on-self))))) (self-alignment-X . ,LEFT) (break-align-symbols . (time-signature)) - (non-break-align-symbols . (multi-measure-rest-interface)) + (non-break-align-symbols . (paper-column-interface)) (Y-extent . ,grob::always-Y-extent-from-stencil) (meta . ((class . Item) (interfaces . (break-alignable-interface @@ -1781,7 +1783,7 @@ . ( (after-line-breaking . ,ly:side-position-interface::move-to-extremal-staff) (baseline-skip . 2) - (break-align-symbols . (staff-bar clef)) + (break-align-symbols . (staff-bar key-signature clef)) (break-visibility . ,end-of-line-invisible) (direction . ,UP) (extra-spacing-width . (+inf.0 . -inf.0)) -- 2.39.5