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: David Kastrup
Subject: Re: within \markup, how to \translate by width of another markup?
Date: Mon, 16 May 2022 19:36:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Werner LEMBERG <wl@gnu.org> writes:

>>>>> 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?
>>>>
>>>> I don't understand why you wouldn't use alignment commands for
>>>> aligning numbers.
>>>
>>> I would like to, however, I couldn't find a proper solution.  Do
>>> you know one?
>>
>> \markup \right-column { 10 9 8 7 6 5 4 3 2 1 }
>>
>> Obviously I am missing something here.
>
> I'm working on `format-bass-figure`.  The vertical alignment of
> figured bass digits is 'left-align' by default.  Let's assume that all
> digits have the same width but there is kerning between them for
> better appearance.  For this reason,
>
> ```
> \general-align #X #CENTER
> ```
>
> doesn't align correctly because of the kerning.  Contrary to LaTeX it
> seems impossible to right-align stuff on the right edge of
> left-aligned stuff because LilyPond doesn't provide an equivalent to
> `\hss` (which is a stretchable space).

I still have no idea what you are talking about.  Multiple digits with
different kerning will not align.  That has nothing to do with
"right-align stuff on the right edge of left-aligned stuff" and it's
nonsensical to talk about "right-align stuff on the right edge of
left-aligned stuff" since once you align stuff, its size and position is
fixed.  You just attach something to that aligned stuff.

> Currently, `format-bass-figure` uses
>
> ```
> \translate-scaled-markup #'(-0.7 0) ...
> ```

What does it want to achieve with that, and in which case?

> where '-0.7' is an ad-hoc value.  I would like to do
>
> ```
> \translate-scaled-markup-from #X #LEFT { \number "1" } ...
> ```
>
> instead to avoid the ad-hoc value.

Again, I have no idea what you are trying to achieve here and how
kerning has anything to do with it.

-- 
David Kastrup



reply via email to

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