Issue 5621: Improve rehearsal mark position at beginning of staff. (issue 553290043 by lemzwerg@googlemail.com)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 5621: Improve rehearsal mark position at beginning of staff. (issue 553290043 by lemzwerg@googlemail.com)

nine.fierce.ballads
I see many cases in the regression tests that this change fails to
improve, for example:

In input/regression/rehearsal-mark-formatters.ly, the new position of
the "H" mark is an improvement, but the new position of the "CC" mark
isn't.

In input/regression/rehearsal-mark-align-priority.ly, the marks over the
F clef didn't need to be shifted, and the mark over the G clef didn't
benefit from being shifted.

https://codereview.appspot.com/553290043/

Reply | Threaded
Open this post in threaded view
|

Re: Issue 5621: Improve rehearsal mark position at beginning of staff. (issue 553290043 by lemzwerg@googlemail.com)

Dev mailing list
Reviewers: Dan Eble,

Message:
> I see many cases in the regression tests that this
> change fails to improve, for example:

> In input/regression/rehearsal-mark-formatters.ly,
> the new position of the "H" mark is an improvement,
> but the new position of the "CC" mark isn't.

Yes.  This is unavoidable because the horizontal offset is statically
set to a fixed value optimized for a single rehearsal letter or a
double-digit rehearsal number (using LilyPond's default font settings).
To automatically improve the positioning of the "CC" mark, a dynamic
solution would be necessary which I'm not able to implement.  What I
could do is to update this regression test to adjust the position once,
but I think this is not a good idea.

> In input/regression/rehearsal-mark-align-priority.ly,
> the marks over the F clef didn't need to be shifted,
> and the mark over the G clef didn't benefit from being
> shifted.

Yes.  IMHO, there is nothing to 'improve'.  If you change the alignment
order of break elements you also have to adjust the anchors if
necessary.  The original value 'RIGHT' for aligning something to a
change clef is as unnatural as my proposed value 2.


Description:
Issue 5621: Improve rehearsal mark position at beginning of staff.

This tiny change positions the rehearsal mark farther to the left at the
beginning of a staff, thus no longer horizontally overlapping with the
clef
(which caused LilyPond to move the rehearsal mark up to avoid a
collision).

Please review this at https://codereview.appspot.com/553290043/

Affected files (+1, -1 lines):
   M scm/define-grobs.scm


Index: scm/define-grobs.scm
diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm
index  
5e29d9f8456d96644ad3dac9b98b868d2462e003..f86a8559b1bed376e30ac72d174b2e9f0ff14275  
100644
--- a/scm/define-grobs.scm
+++ b/scm/define-grobs.scm
@@ -551,7 +551,7 @@
       . (
          (avoid-slur . inside)
           
(break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor)
-        (break-align-anchor-alignment . ,RIGHT)
+        (break-align-anchor-alignment . 2)
          (break-align-symbol . clef)
          (break-visibility . ,begin-of-line-visible)
           
(extra-spacing-height . ,pure-from-neighbor-interface::extra-spacing-height-at-beginning-of-line)



Reply | Threaded
Open this post in threaded view
|

Re: Issue 5621: Improve rehearsal mark position at beginning of staff. (issue 553290043 by lemzwerg@googlemail.com)

nine.fierce.ballads
In reply to this post by nine.fierce.ballads
Doesn't this shift _everything_ that one might try to align relative to
a clef, not just rehearsal marks?

What about key signatures?  The break-align-symbols for RehearsalMark
are (staff-bar key-signature clef).  This change won't do anything for
the alignment of a rehearsal mark that attaches itself to a key
signature.

I think it would be better for a RehearsalMark to be center-aligned at a
bar line, but left-aligned at a key signature or clef (maybe generalized
to anything with break-align-anchor-alignment = RIGHT?).  I don't know
if it's currently possible to define that, but it's probably worth
thinking through what it would require.


https://codereview.appspot.com/553290043/

Reply | Threaded
Open this post in threaded view
|

Re: Issue 5621: Improve rehearsal mark position at beginning of staff. (issue 553290043 by lemzwerg@googlemail.com)

nine.fierce.ballads
In reply to this post by nine.fierce.ballads
On 2019/12/14 16:47:15, Dan Eble wrote:
> I think it would be better for a RehearsalMark to be center-aligned at
a bar
> line, but left-aligned at a key signature or clef (maybe generalized
to anything
> with break-align-anchor-alignment = RIGHT?).  I don't know if it's
currently
> possible to define that, but it's probably worth thinking through what
it would
> require.

What might work is a new option (possibly made the default?) for
self-alignment-X
that uses the opposite of the reference grob's
break-align-anchor-alignment.

https://codereview.appspot.com/553290043/

Reply | Threaded
Open this post in threaded view
|

Re: Issue 5621: Improve rehearsal mark position at beginning of staff. (issue 553290043 by lemzwerg@googlemail.com)

nine.fierce.ballads
In reply to this post by nine.fierce.ballads
On 2019/12/14 16:47:15, Dan Eble wrote:
> I think it would be better for a RehearsalMark to be center-aligned at
a bar
> line, but left-aligned at a key signature or clef (maybe generalized
to anything
> with break-align-anchor-alignment = RIGHT?).  I don't know if it's
currently
> possible to define that, but it's probably worth thinking through what
it would
> require.

I'm on a path to making this possible.  I don't know if I'll have
anything to show today; if not, perhaps Monday.

https://codereview.appspot.com/553290043/

dak
Reply | Threaded
Open this post in threaded view
|

Re: Issue 5621: Improve rehearsal mark position at beginning of staff. (issue 553290043 by lemzwerg@googlemail.com)

dak
[hidden email] writes:

> On 2019/12/14 16:47:15, Dan Eble wrote:
>> I think it would be better for a RehearsalMark to be center-aligned at
> a bar
>> line, but left-aligned at a key signature or clef (maybe generalized
> to anything
>> with break-align-anchor-alignment = RIGHT?).  I don't know if it's
> currently
>> possible to define that, but it's probably worth thinking through what
> it would
>> require.
>
> I'm on a path to making this possible.  I don't know if I'll have
> anything to show today; if not, perhaps Monday.
>
> https://codereview.appspot.com/553290043/

A callback function, if necessary due to early evaluation otherwise, a
pure/unpure container ?

--
David Kastrup

Reply | Threaded
Open this post in threaded view
|

Re: Issue 5621: Improve rehearsal mark position at beginning of staff. (issue 553290043 by lemzwerg@googlemail.com)

nine.fierce.ballads
In reply to this post by nine.fierce.ballads
On 2019/12/14 22:42:05, dak wrote:
> A callback function, if necessary due to early evaluation otherwise, a
> pure/unpure container ?

See https://codereview.appspot.com/547340043/ .


https://codereview.appspot.com/553290043/

Reply | Threaded
Open this post in threaded view
|

Re: Issue 5621: Improve rehearsal mark position at beginning of staff. (issue 553290043 by lemzwerg@googlemail.com)

Dev mailing list
In reply to this post by nine.fierce.ballads