David Kastrup <d...@gnu.org> writes:

> Urs Liska <li...@openlilylib.org> writes:
>
>> What I would *like* to do is a function like
>>
>> propagate-direction =
>> #(define-event-function (text)(markup?)
>>    #{
>>      -\tweak direction #UP
>>      -(
>>      -\tweak direction #UP
>>      -\markup #text
>>    #})
>>
>> but instead of hard-coding #UP I'd like to calculate the values based
>> on something. For example let the text have the opposite direction of
>> the slur and have the slur accept the ^\_ operator.
>
> Even assuming PostEvents are fixed, you'd still be stuck having to
> look at one event from another, independent one.  You'd be missing a
> reliable handle for that.  You'd need to use an engraver for doing
> that kind of interaction.

Correction: you could put a callback into a direction tweak on the text
event and this callback could check the _text_ event's direction and
then assume the _opposite_.  So after "assuming PostEvents are fixed"
should more or less work for this particular scenario, but

\tweak direction #UP \propagate-direction

would then override both tweaks.  I mean, you could still override with
a callback that reverses direction only on markup grobs but things get
increasingly murky and awkward when trying to do stuff like that.

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to