lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: within \markup, how to \translate by width of another markup?


From: Jean Abou Samra
Subject: Re: within \markup, how to \translate by width of another markup?
Date: Mon, 16 May 2022 16:43:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1



Le 16/05/2022 à 15:45, Werner LEMBERG a écrit :
Within a markup, I want to `\translate` an object by the x-extent
of another markup.  How can I do that?

While we have `\with-dimensions` and friends to adjust the size of
an object, it seems to me that we don't have something similar for
offsets...  Would it be necessary to define
`\translate-with-dimensions` and similar commands?
Can't you just concat a \with-dimensions ... \null together with
what you want to see shifted?
I don't think so.  The problem at hand is stacking fixed-width
single-digit and two-digit numbers.  Single-digit numbers should be
left-aligned for various reasons:

```
   9
   8
   7
```

If there is a two-digit number, it should be right-aligned at the
right edge of the left-aligned single-digit numbers:

```
  10
   9
   8
```

My idea was to translate the two-digit number to the left by the width
of a single digit.

Is there a solution for this with the current LilyPond markup
commands?



How about

\markup \typewriter \column { 9 \general-align #X #CENTER 10 }

?

Also, do you really need the origin to be on the left of the 9 and not on the left of the 10? Why not

\markup \typewriter \right-column { 9 10 }

?

Best,
Jean




reply via email to

[Prev in Thread] Current Thread [Next in Thread]