lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme: Is there a ... - Doc error? & other stuff


From: Risto Vääräniemi
Subject: Re: Scheme: Is there a ... - Doc error? & other stuff
Date: Wed, 6 Feb 2008 15:25:20 +0200

Dear All,

I'm sorry if this arrives twice. My Gmail is behaving a bit strangely
today. This one is improved a bit from the previous one.

On 05/02/2008, Mats Bengtsson wrote:
> I have already answered that question in my previous email:

Yes you did, thanks. I'm sorry. I just couldn't believe that scheme
could create these new names "by itself". :-)

>  >see the end of "Markup construction in Scheme".

One thing though ... about the document section you mentioned. It
recommends using make-center-markup. I wonder if that should be
make-center-align-markup? The latter works as well as make-line-markup
and make-column-markup but the make-center-markup doesn't (at least if
used in the example code I posted earlier).

Another thing: I wonder why \right-align is implemented as it is, i.e.
no support for a list of markups. If I create a \column or use
\center-align with multiple strings or markups the texts are printed
"with line feeds". If I use \right-align instead the texts are set on
one line on top of each other. I have to use baseline-skip to get them
properly printed. Is this behaviour needed by some other function or
could it be modified to match \center-align?

Anyway, below you can find the code I cooked up if someone is
interested in it. It was pretty straightforward to use the
\center-align as a template. Thanks again, Mats and Bert.

-Risto

%%%%%%%
\version "2.11.37"

#(define-markup-command (right-align layout props args) (markup-list?)
  "Put @code{args} in a centered column."
  (let* ((mols (interpret-markup-list layout props args))
         (cmols (map (lambda (x) (ly:stencil-aligned-to x X RIGHT)) mols)))
    (stack-lines -1 0.0 (chain-assoc-get 'baseline-skip props) cmols)))


#(define-markup-command (instruments layout props markups) (markup-list?)
  (interpret-markup layout props
    (markup (make-right-align-markup markups) )))

{
    \set Staff.instrumentName = \markup \instruments { Soprano Alto }
    c'1
}
%%%%%%%




reply via email to

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