[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TextScript implements self-alignment interface
From: |
Trevor Bača |
Subject: |
Re: TextScript implements self-alignment interface |
Date: |
Mon, 4 Sep 2006 16:30:06 -0500 |
On 8/28/05, Trevor Baca <address@hidden> wrote:
On 8/28/05, Han-Wen Nienhuys <address@hidden> wrote:
> Trevor Baca wrote:
> > So the question is: is the pair of self-alignment and extra-offset (in
> > the second example) the best way to center markup relative to
> > *notecenter* or is there a way to specify the
> > position-from-which-relative-measures-are-made (like extra-offset)
> > directly, possibly by referencing the parent grob?
>
> No, you want to use the same alignment as OctavateEight, ie. using
>
> (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent
> ,Self_alignment_interface::aligned_on_self)
>
> check define-grobs.scm for more examples of centered_on_parent.
Nice.
For the at-home audience that might wanna try out the syntax, this will work:
%%%% BEGIN PERFECT CENTERING RELATIVE TO PARENT SNIPPET %%%%
\score {
\context Staff = "1" {
c'4^\markup {AA} % regular centering at left note-edge
c'4_\markup {AA} % regular centering at left note-edge
\override TextScript #'X-offset-callbacks = #(list
Self_alignment_interface::centered_on_parent
Self_alignment_interface::aligned_on_self)
\override TextScript #'self-alignment-X = #0
c'4^\markup {AA} % fiddled centering at notecenter
c'4_\markup {AA} % fiddled centering at notecenter
\revert TextScript #'X-offset-callbacks
\revert TextScript #'self-alignment-X
}
}
%%%%%%% END PERFECT CENTERING SNIPPET %%%%%%%%%%
Somewhere in the 2.7 development work there was a really nice
simplification that removed the need for X-offset-callbacks in
examples like the one above.
However, running convert-ly on the 2.7.7 snippet above produces this.
$> convert-ly -e 307.ly
convert-ly (GNU LilyPond) 2.9.16
Processing `307.ly'...
Applying conversion: 2.7.10, 2.7.11, 2.7.12, 2.7.13, 2.7.14, 2.7.15,
Not smart enough to convert [XY]-offset-callbacks2.7.22, 2.7.24,
2.7.28, 2.7.29, 2.7.30, 2.7.31, 2.7.32, 2.7.32, 2.7.36, 2.7.40, 2.9.4,
2.9.6, 2.9.9, 2.9.11, 2.9.13, 2.9.16
So does anyone have a syntax snippet to show the best way to
center-align a TextScript relative to its NoteHead parent, using the
modern syntax?
--
Trevor Bača
address@hidden
- Re: TextScript implements self-alignment interface,
Trevor Bača <=