[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Text alignment center of note head
From: |
Mats Bengtsson |
Subject: |
Re: Text alignment center of note head |
Date: |
Sun, 17 Jun 2007 01:04:13 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20061113 Debian/1.7.8-1sarge8 |
Arjen Bax wrote:
TiagoM <tiagomorin <at> gmail.com> writes:
How can one align a \markup with the center of the notehead instead of it's
left edge?
Use \halign:
\version "2.10.20"
{
c''^\markup{\halign #0 "Centered"}
}
See
http://lilypond.org/doc/v2.10/Documentation/user/lilypond/Overview-of-text-markup-commands#Overview-of-text-markup-commands
In that case, I would rather propose
c''^\markup{\hcenter "Centered" }
or
\override TextScript #'self-alignment-X = #CENTER c''^"Centered"
However, if I understand correctly, the question was about the
alignment point of the note, not of the text itself. You can get
it centered on the note head by the setting:
\override TextScript #'X-offset =#(ly:make-simple-closure
`(,+
,(ly:make-simple-closure (list
ly:self-alignment-interface::centered-on-x-parent))
,(ly:make-simple-closure (list
ly:self-alignment-interface::x-aligned-on-self))))
I recommend you to use copy/paste to insert this into your file,
since it's very critical to get all backwards quote marks and commas
correct.
/Mats