[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Alignment of custom dynamics
From: |
Valentin Petzel |
Subject: |
Alignment of custom dynamics |
Date: |
Fri, 04 Feb 2022 20:32:39 +0100 |
Hello,
LSR 393 contains many methods to align a piece of custom dynamics text like
"sub. pp" or something on the dynamics, with each methods having some
drawbacks, like using TextScript, overriding X-offset, adding nonsensical
horizontal space at the end, setting the dimensions of the text to (0,0),
(0,0), using translation in the markup and setting X-offset.
I’ve come up with a nice method that achieves this with much less effort and
caveats.
The idea is to create a markup command to wrap (ly:stencil-combine-at-edge
markup2 X LEFT markup1 nice-value-for-padding) and then define our #(make-
dynamic-script ...) with the dynamics centered and the text added to the left
using this command.
Now we only need to prevent the self-alignment-interface to center this thing
again, which we can do by simply tweaking self-alignment-X to #f.
We can of course also do this to add to the right, though this does not
require such a custom function. The important thing is that the "first" (not
counting markups added to the left) markup is centered.
So I thought I’d share this with you.
Cheers,
Valentin
align-custom-dynamics.ly
Description: Text Data
signature.asc
Description: This is a digitally signed message part.
- Alignment of custom dynamics,
Valentin Petzel <=