lilypond-devel
[Top][All Lists]
Advanced

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

Re: horizontally centering denominator in compound time signatures


From: Reinhold Kainhofer
Subject: Re: horizontally centering denominator in compound time signatures
Date: Sun, 30 Nov 2008 22:52:45 +0100
User-agent: KMail/1.10.3 (Linux/2.6.27-9-generic; KDE/4.1.3; i686; ; )

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Sonntag, 30. November 2008 19:06:09 schrieb Neil Puttock:
> 2008/11/30 Reinhold Kainhofer <address@hidden>:
> > So, this is a general problem with the general-column scheme function...
>
> Perhaps there's a bug in stack-lines?

I've now done some more digging and understand the situation. I just need some 
info on how things are supposed to work.

Here's the situation:
- -) make-center-column-markup (or rather general-column) does 
        (ly:stencil-aligned-to x X align-dir)
   to center-align the markup. This shifts the origin 0 to the horizontal
   center of the markup
- -) stack-lines is called on the centered markups, which places the lines one
   above each other and creates a stencil with X-extents (-halfwidth .
   halfwidth), so this part seems to work. 

We now have a stencil with x-extents (-halfwidth . halfwidth)

The problem is when line (which calls stack-stencil-line) comes into play:

- -) the stack-stencil-line markup function goes through the markups starting
    from the tail and moves all markups after the currently process by the cdr
   of the x-extents of the stencil:
                 (xoff (+ space (cdr (ly:stencil-extent head X)))))
            (ly:stencil-add head
                             (ly:stencil-translate-axis tail xoff X)))
   The car of the extents (ie. in our case the part of the stencil left of the
   center) is never used. This explains the output that we see...


The question now is how things are supposed to work. I suppose that stack-
stencil-line is correct in using only the x-extents right of the origin, is 
it? 

So, basically, there are two solutions:
1) Change stack-stencil-line to use the whole extents of the stencil (i.e. 
make it work correctly with stencils where the left edge is not at 0.
2) Change center-column to translate the stencil so that 0 lies at the left 
edge.

Thinking about it, I suppose that 1) is the better solution. The only reason I 
see against it is to be able to let a stencil print something beyond its left 
edge. But then, a stencil can always print something beyond its extents, so 
there is no reason to special-case stack-stencil-line. It would even make 
sense to fix this for stencils where the left edge of the extent starts at a 
positive value. Those stencils get translated too much.

What do you think is the correct solution?

Cheers,
Reinhold
- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFJMwstTqjEwhXvPN0RAswfAJ0QXLblj/6E21e+geZ0i6CIZ3acfwCfbMLV
tzr+7naR4XfIDfuGMtuTx+A=
=6X5f
-----END PGP SIGNATURE-----




reply via email to

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