[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme: Is there a make-right-align-markup?
From: |
Mats Bengtsson |
Subject: |
Re: Scheme: Is there a make-right-align-markup? |
Date: |
Mon, 04 Feb 2008 16:12:19 +0100 |
User-agent: |
Thunderbird 2.0.0.5 (X11/20070716) |
I'm afraid the easiest solution is to copy paste from the file
.../scm/define-markup-commands.scm, where you can find the implementation
of all the standard markup commands. For example, the \center-align markup
command is implemented by
(define-builtin-markup-command (center-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 CENTER)) mols)))
and even if you don't know anything about Scheme, I think it's fairly
obvious
what you should modify to get right alignment instead. Just remember to
replace define-builtin-markup-command by define-markup-command.
Note also that the make-right-align-markup Scheme function is just an
automatically generated Scheme wrapper to the \right-align markup command,
see the end of "Markup construction in Scheme".
/Mats
Risto Vääräniemi wrote:
Dear All,
OK. I must admit that there's no such thing. I just wanted to get your
attention. :-)
I've been searching for a scheme function that I could use for
aligning markups on their right edges. I found a solution for
centering them (below) and it uses a function / procedure called
make-center-align-markup. It centers the texts alright. If I use
make-column-markup I get a column thats aligned on the left edge.
How to get the texts aligned to the right? I tried to add
#:right-align and #:column to various places but they didn't work or
caused errors. I consider myself as a newbie scheme user and perhaps
this is still out of my league. :-)
Why I don't simply do that directly at the Staff.instrumentName?
Because I've got that song book I'm writing and I'd like to be able to
adjust the instrument name (and other) settings for all the songs in
one place (an .ily file).
Is there a complete list of Lilypond scheme functions and their usage
(an API)? I tried to search for the make-center-align-markup in the
docs but couldn't find any reference to it.
-Risto
%%% Snip %%%
\version "2.11.37"
#(define-markup-command (instruments layout props markups) (markup-list?)
(interpret-markup layout props
(markup
(#:override '(baseline-skip . 2.8)
(markup (make-center-align-markup markups))))))
{
\set Staff.instrumentName = \markup \instruments { Soprano Alto }
c'1
}
%%% END %%%
_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user
--
=============================================
Mats Bengtsson
Signal Processing
Signals, Sensors and Systems
Royal Institute of Technology
SE-100 44 STOCKHOLM
Sweden
Phone: (+46) 8 790 8463
Fax: (+46) 8 790 7260
Email: address@hidden
WWW: http://www.s3.kth.se/~mabe
=============================================