DescriptionSUMMARY: DynamicTexts, TextScripts and many other grobs use aligned_on_parent, which makes their behaviour consitent, predictable and thus more user-friendly.
Consists of 3 commits:
Clean up DynamicText horizontal alignment.
Until now, DynamicText alignment was messy, as there were 3 different
callbacks involved - some of them interacting in a confusing way:
- in define-grobs.scm, X-offset property was initialized to
ly:self-alignment-interface::x-aligned-on-self,
- Dynamic_engraver called set_center_parent on every DynamicText
attached to a note, so that half a NoteHead width was always added
to its X-offset (producing confusing results for example when
user requested dynamics to be left-aligned),
- DynamicTexts living in a Dynamics context used a completely
different offset callback, which aligned them on NoteColumns.
Since aligned_on_parent is now able to correctly align grobs
with PaperColumn parents (issue 3254), we can use it for all
DynamicTexts and have a single interface for the job.
Expected changes in output: DynamicTexts in Dynamics context
aligned to suspended noteheads may be placed up to 1/4 NoteHead
width further to the right. This shouldn't be a problem.
Replace XY-offset closures with aligned_on_parent where possible
It doesn't make sense to specify placement using multiple added
callbacks or closures when we can use aligned_on_parent. What's
more, aligned_on_parent should expose more consistent interface
for the users - affected grobs should now behave similarly to
LyricTexts and DynamicTexts. For example, this
\relative c'' \context Voice {
\compressFullBarRests
\override MultiMeasureRestNumber.self-alignment-X = #RIGHT
R1*100
}
will result in right edge of the MultiMeasureRestNumber being
aligned on the right edge of the MultiMeasureRest.
Affected grobs:
- Fingering
- AccidentalSuggestion
- ClefModifier
- DoublePercentRepeatCounter
- GridLine
- MultiMeasureRestNumber
- MultiMeasureRestText
- PercentRepeatCounter
- StemTremolo
Expected changes in output: none.
TextScript, CombineTextScript: use aligned_on_parent
I think this makes more sense than just using "self-alignment".
It makes these grobs consistent with Lyrics and Dynamics, and
allows users to override their alignment more predictably.
Expected changes in output: TextScripts and CombineTextScripts
will be aligned slightly different when the user sets self-alignment-X
explicitly (parent notehead will be included in alignment, as in Lyrics).
Default placement should remain the same.
I'm also changing one regtest, just to make sure that despite slightly
changed alignment the markups will stick out far enough to the left.
Patch Set 1 #Patch Set 2 : rebase on master, don't include aligned_on_parent refactoring #Patch Set 3 : keep old value for TextScript alignment (fix fingering diagrams) #Patch Set 4 : rebase on master, slightly adjust one regtest #Patch Set 5 : whitespace fixes and property reordering (shouldn't affect countdown) #
MessagesTotal messages: 8
|