[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TextScript implements self-alignment interface
From: |
Trevor Baca |
Subject: |
Re: TextScript implements self-alignment interface |
Date: |
Sun, 28 Aug 2005 22:23:21 -0500 |
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 %%%%%%%%%%
Trevor Bača
address@hidden