lilypond-devel
[Top][All Lists]
Advanced

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

Re: two pass spacing patch


From: Joe Neeman
Subject: Re: two pass spacing patch
Date: Sun, 01 Oct 2006 07:24:25 +1000

On Sat, 2006-09-30 at 16:25 +0200, Nicolas Sceaux wrote:
> Han-Wen Nienhuys <address@hidden> writes:
> 
> > Nicolas Sceaux schreef:
> >> Here is a patch defining a few functions for using the two-pass vertical
> >> spacing scheme. Example:
> >
> > given that Joe is now the Page breaking guru, I invite him to review
> > the code. Joe?
> 
> Joe,
> 
> What the patch changes to the page breaking code is that the call of the
> page post processing function (which dumps the page layout) is moved
> to another place: a page breaking wrapper now takes care of calling the
> page breaking function, then the post processing function.
> 
> Rationale:
> 1) the post processing function is used in a single place (the page
> breaking wrapper, instead of once in the C++ page breaking code + once
> in the old optimal-page-breaks + once in each user defined page breaking
> function)
> 2) the post processing function is parametrized, so that the user can
> change the page layout dumping function.
> 
> Other changes to the code are
>  - functions for computing system stretch (the goal is to stretch systems
>  so that they should use all the space left on a page)
>  - music functions used by the user to trigger the whole thing.
> 
> If this is fine, I'll add some documentation on how to use that.

It all looks good to me.

Just some random thoughts: it seems that you need the exact extent and
staff-extent for determining if a system is stretchable. If it were
possible to do it another way (say by setting a property from the C++
side whenever we see a VerticalAlignment with more than one child) then
you could theoretically do everything using just the estimated extents.

That is, you could calculate the maximum stretch before the systems have
even been typeset and insert the tweaks immediately instead of writing
them to a file. That way, "two-pass" spacing happens automatically on
only one pass. Of course, it would be less accurate since you rely on
the estimated extents, but it's something to consider anyway.





reply via email to

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