lilypond-user
[Top][All Lists]
Advanced

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

Re: Center text over measure


From: Urs Liska
Subject: Re: Center text over measure
Date: Fri, 11 May 2018 18:23:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0



Am 11.05.2018 um 18:04 schrieb Urs Liska:


Am 11.05.2018 um 17:45 schrieb Malte Meyn:


Am 11.05.2018 um 17:39 schrieb Urs Liska:
Hi all,

somehow I have the feeling this is a stupid question, but I'm unable to find the solution.

Is there a convenient and semantically clean way to center a markup above/below a measure?

I need a solution that doesn't rely on separate contexts (e.g. a Dynamics context above the staff). What *would* be acceptable is a Scheme function that calculates the actual width of the measure and does the centering from that. But since that would probably only be possible in a after-line-breaking callback it would seem quite dirty to move around a markup at that point.

Any suggestions?
Thanks
Urs

MultiMeasureRestText above an invisible MMR?

OMG. That's what I meant.
Of course I thought about this, but I was convinced that making the MMR invisible wouldn't work because it would still affect the spacing and collision handling.
But this seems to do exactly what I need:

\version "2.19.80"

\score {
  \new Staff
  \relative {
    <<
      {
        \hide MultiMeasureRest
        R1
        ^\markup "Is this centered?"
        _\markup "and this?"
      }
      \new Voice {
        \oneVoice
        c'4 c c c
        \break
        c1
      }
    >>
  }
}


Thanks
Urs

Well, looking more closely shows me that I'd prefer a solution that doesn't even require a a separate *voice*. The problem is that I'll also have to *export* the stuff in a clean way to MusicXML, and I don't think a hidden additional layer should be the way to go. Ideally I'd have something like a \measureMarkup that would apply (and center) the markup to the measure (instead of to a note or rest). But I would also be able to go with a solution where I can attach the markup to the first element in a measure and have it positioned relative to the measure.

Urs

Or have a look at the code that positions those grobs and adapt ;) Another grob that is centered: PercentRepeat.

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

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