Hello everyone!
I'm trying to use make-dynamic-script to engrave dynamic marks that also have some kind of text (for example: p dolce, etc) and have them behave consistently with other dynamic marks.
The problem is that I have a difficult time aligning them correctly, as you can see in the example I uploaded (both .ly and .pdf).
In the first example, I write a function and tweaked the X-offset of its output so that it would behave like I want, but it only works with scripts that start with either p or f. This approach would require making different functions for every dynamic that I'm going to use. I'm also concerned that if I change layout settings later I'm going to have to tweak everything again.
In the second example I attempted to make a function that can calculate the tweaking, modifying
this snippet. As you can see it's not working as intended. I checked the math a few times and I think it should be right (although I'm sure that I can be wrong on this), and that makes me think that there is something else going on that prevents me from achieving the results I want.
How can I solve this issue so that I can have a generic function that corrects the tweaking by itself? Any help with this issue will be greatly appreciated.