lilypond-user
[Top][All Lists]
Advanced

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

Access the first/last line of a markup


From: Urs Liska
Subject: Access the first/last line of a markup
Date: Mon, 11 Mar 2019 10:49:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

Hi,

returning to my notorious "center-markup-over-measure" issue I was pointed to yet another issue: vertical alignment when the last line contains descenders or the first line does not contain ascenders.

Since I am manually placing the markups (given as arguments) using ly:stencil-combine-at-edge above and below the staff I can't use staff-padding for padding against the baseline. So what I *think* I need is retrieving the first and last lines of the markup (which would be the same if it's a single line markup) and analyze that. However, that seems difficult. I checked with \displayMusic -\markup ... to see if I could retrieve stuff from that expression, and although it seems complicated-but-feasible for most cases it would fail with e.g. \wordwrap because there's no notion of the resutling lines yet.

I can also access the resulting stencils after using grob-interpret-markup. However, I have no idea if/how it is possible to get to the information I need (either a "sub-stencil" for the first/last line or some information through the stencil-extent).

Do you think there's any automatic solution I can pursue - or will I be left manually adjusting the padding on a case-by-case basis?

Thanks for any suggestions
Urs




reply via email to

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