Re: Horizontal alignment of DynamicTextSpanner left text

2022-02-27 Thread Jean Abou Samra



Le 02/02/2022 à 00:24, Jean Abou Samra a écrit :

Le 01/02/2022 à 22:27, Simon Albrecht a écrit :

Thanks for the encouragement ;)

I don’t have any knowledge of C++ at all and haven’t made any 
contributions to the code for a long time. I’ll see whether I can 
find time to try.





For a start, renaming attach-dir can be done via search/replace
without any knowledge of C++ at all. You just need to update
documentation and regtests as well [1]. You should also add
a convert-ly rule in python/convertrules.py (if you don't know
Python, it's famous for being easy to learn, and you can mimic
the existing rules).

I'm actually starting to wonder if parent-alignment-X will be
the best name since bound-details.right.parent-alignment-X aligns
on the right bound, which is not at all the X parent of the spanner;
the parent is normally the left bound. So bound-alignment-X
would be more appropriate, although the little lie in
parent-alignment-X might be acceptable for the benefit of
making interfaces easier to remember.

Best,
Jean



Opened
https://gitlab.com/lilypond/lilypond/-/issues/6294

Jean

___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Horizontal alignment of DynamicTextSpanner left text

2022-02-01 Thread Jean Abou Samra

Le 01/02/2022 à 22:27, Simon Albrecht a écrit :

Thanks for the encouragement ;)

I don’t have any knowledge of C++ at all and haven’t made any 
contributions to the code for a long time. I’ll see whether I can find 
time to try.





For a start, renaming attach-dir can be done via search/replace
without any knowledge of C++ at all. You just need to update
documentation and regtests as well [1]. You should also add
a convert-ly rule in python/convertrules.py (if you don't know
Python, it's famous for being easy to learn, and you can mimic
the existing rules).

I'm actually starting to wonder if parent-alignment-X will be
the best name since bound-details.right.parent-alignment-X aligns
on the right bound, which is not at all the X parent of the spanner;
the parent is normally the left bound. So bound-alignment-X
would be more appropriate, although the little lie in
parent-alignment-X might be acceptable for the benefit of
making interfaces easier to remember.

Best,
Jean


[1] Careful if you use the shell for this. I once did

    find . -name "*" -exec sed -i "s/something/something else/g" {} \;

    and my Git repository got borked since this had modified
    internal files in .git/. I was unable to recover it.
    So better do

    sed -i".backup" "s/something/something else/g" $(git ls-files)

    where the use of git ls-files ensures you're only touching
    source files, and ".backup" specifies a backup suffix
    so you will always be able to recover should anything go wrong.


___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Horizontal alignment of DynamicTextSpanner left text

2022-02-01 Thread Simon Albrecht

Thanks for the encouragement ;)

I don’t have any knowledge of C++ at all and haven’t made any 
contributions to the code for a long time. I’ll see whether I can find 
time to try.


Best, Simon

On 31/01/2022 17:39, Jean Abou Samra wrote:

Do you have some knowledge of C++? Unlike vertical
placement, which is a little subtler, horizontal placement
in lily/line-spanner.cc is quite straightforward.
I'd expect a patch for this not to require extensive
knowledge of internals. 


___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Horizontal alignment of DynamicTextSpanner left text

2022-01-31 Thread Jean Abou Samra

Le 31/01/2022 à 16:54, Simon Albrecht a écrit :

Hello list,

normally, horizontal alignment of grobs to other grobs is adjusted 
using self-alignment-X and parent-alignment-X—IIRC, this was 
homogenised some a couple years ago.


However, when wanting to adjust the alignment of a 
DynamicTextSpanner’s left bound, I found that this is much less clear 
for spanners. They have the parent-alignment-X component hidden behind 
the misleading property name attach-dir, and no default way of 
adjusting self-alignment-X via grob property (see this thread [1] for 
workarounds).


I suggest modifying line-spanner-interface to use self-alignment-X and 
parent-alignment-X in all subproperties of bound-details, and heeding 
these properties for DynamicTextSpanner and similar grobs.


Best, Simon


[1] 
https://lists.gnu.org/archive/html/lilypond-user/2022-01/msg00389.html



Do you have some knowledge of C++? Unlike vertical
placement, which is a little subtler, horizontal placement
in lily/line-spanner.cc is quite straightforward.
I'd expect a patch for this not to require extensive
knowledge of internals.

Best,
Jean


___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond