* lily/page-breaking.cc (find_chunks_and_breaks):
* lily/paper-score.cc (calc_breaking): Follow changes to the
Constrained_breaking interface
* lily/constrained-breaking.cc (calc_subproblem): run the main loop
here backwards, as an optimisation
(initialize): new function; move most of the code in resize () here
(combine_demerits): cache ragged_right_
(Constrained_breaking): constructor now takes the Paper_score
Nicolas Sceaux [Sun, 1 Oct 2006 11:10:15 +0000 (11:10 +0000)]
* scm/layout-page-layout.scm (page-breaking-wrapper): new
function. Call the page breaking function selected in the
`page-breaking' \paper variable, then the post processing function
chosen using the `page-post-process' \paper variable.
(line-height): new function. Return the height of a system.
(line-minimum-position-on-page): new function. Return the position
of a system on page (using the previous line position), only
considering between system padding.
(stretchable-line?): new function. Says whether a line can be
stretched (ie. is not a title nor a single staff system).
(page-maximum-space-left): new function. Computes space left on a
page, when all systems are separated by their padding.
* lily/page-breaking.cc (breaking::make_pages): Move page post
processing function call to page breaking wrapper (common to all
page breakers).
* lily/paper-book.cc (book::pages): call the page breaking
wrapper, instead of the page breaker directly
* ly/paper-defaults.ly: Add \paper variables for page breaking
wrapper and page post processing function. Make
`write-page-layout' value depend on the 'dump-tweaks option. Add a
`system-maximum-stretch-procedure' variable for holding a function
computing the maximum stretch a system allows.
* scm/layout-page-dump.scm (write-page-breaks): computes the
stretch to apply to systems on a page to minimize left
space. Dump this stretch length.
* ly/music-functions-init.ly (spacingTweaks): implement it. Read
the system-stretch property of the tweak data to stretch the
system.
(includePageLayoutFile): Void function which includes the
generated page-layout file if it exists and if the page layout
dumping is not asked.
(scoreTweak): if the score tweak named by the argument exists,
return it.
Joe Neeman [Sat, 30 Sep 2006 10:30:47 +0000 (10:30 +0000)]
* lily/page-turn-page-breaking.cc (calc_demerits): now that we allow
put_systems_on_pages to return an empty result, we need to assign
demerits properly in that case.
(put_systems_on_pages): Make the number of pages depend on the
evenness of page_number. Add auto-first-page-number.
(calc_subproblem): ensure that the page-number is even for the
left-hand page. Warn if the first page-turn doesn't fit onto the
first (right-hand) page.
* lily/page-spacing.cc (solve): bug: demerits_ would always be inf
(min_page_count): make this publicly accessible
(min_page_count): fix a bug when there are forced page breaks that
was introduced when I made this loop run backwards
(space_systems_on_n_pages, space_systems_on_n_or_one_more_pages):
replace space_systems_on_min_pages with these two. The logic in
space_systems_on_min_pages was getting too convoluted and is better
contained in page-turn-page-breaking.
Joe Neeman [Sun, 24 Sep 2006 06:21:56 +0000 (06:21 +0000)]
* lily/paper-book.cc (get_system_specs):
(set_system_penalty): fix breakbefore.
We used to set a penalty on the system after the break, now we
set a permission on the system before the break
Joe Neeman [Sat, 23 Sep 2006 22:51:56 +0000 (22:51 +0000)]
* lily/grob-property.cc: add scm debugging hooks into
property modification
* lily/context-property.cc:
* lily/engraver.cc:
rename make_foo_from_properties to internal_make_foo and
move it from context-property.cc to a member function of
Engraver.
* lily/include/lily-guile-macros.hh:
overload ly_symbol2scm macro so that there is no more need
to use internal_foo
Erik Sandberg [Fri, 22 Sep 2006 06:18:00 +0000 (06:18 +0000)]
2006-09-22 Erik Sandberg <mandolaerik@gmail.com>
* lily/lexer.ll: remove limitation on music function arity. New
mode extratoken, which inserts extra EXPECT_* tokens after
MUSIC_FUNCTION token. Junk all MUSIC_FUNCTION_* tokens.
* lily/parser.yy: Change grammar for music function accordingly.
* lily/include/lily-parser.hh: New method get_state, new member
hidden_state. Works around a problem when parser fetches
MUSIC_FUNCTION token but not the following EXPECT_* token.
Joe Neeman [Tue, 19 Sep 2006 22:57:34 +0000 (22:57 +0000)]
* lily/page-breaking.cc (find_chunks_and_breaks): ignore breaks
that happen at the start of a score: having a zero-length
chunk was messing up min_system_count calculations.
* lily/source-file.cc (get_line): lower_bound, not
binary_search. Fixes problem where point-and-click would
always point to the first line.
* input/mutopia/W.A.Mozart/mozart-hrn3-defs.ily:
ragged-last-bottom = ##f (test the new page breaker)
* flower/include/std-vector.hh (vector_sort): use STL sort stuff
* scm/define-context-properties.scm
(all-internal-translation-properties): remove properties that
were used to communicate page-turn stuff to the paper-column
engraver.
* lily/lily-guile.cc (robust_scm2string): new function
* lily/paper-column-engraver.cc: Clean up page turn stuff
* lily/page-turn-engraver.cc: Re-write the page turn logic here
instead of cluttering up paper-column-engraver.cc
Nicolas Sceaux [Sun, 17 Sep 2006 07:45:56 +0000 (07:45 +0000)]
* scm/layout-page-dump.scm (scm): export utility function names,
to allow user writing cutsom dumping functions.
* scm/layout-page-layout.scm: export utility function names to
enable custom page breaking function writing. Tabify.
(line-next-space): use ?-suffix only for predicates
(page-maximum-space-to-fill): new function. Return the space
between first and bottom system of a page, to give to
space-systems.
(space-systems): use a space-to-fill argument (for instance as
computed by page-maximum-space-to-fill) instead of computing
internaly this space with the page height. That way, the caller
can adjust the space to use.
(make-page-from-systems, walk-paths): compute space to fill before
calling space-systems.
Joe Neeman [Mon, 4 Sep 2006 05:51:14 +0000 (05:51 +0000)]
The last commit was an accident. Revert 3 files that shouldn't have been
committed. (And here's the missing commit log):
* lily/simple-spacer.cc (get_line_forces): Ignore loose columns
unless they are breakable. This fixes discrepancies between the forces
calculated here and the forces calculated in get_line_configuration.
* lily/grob.cc (pure_relative_y_coordinate): fix some
mis-estimation that was happening with piano staves.
* lily/constrained-breaking.cc (resize): don't choke if we get a
measure that won't fit on a line.
(combine_demerits): don't consider uniformity when ragged
* lily/page-spacing.cc (solve): why the f* were there two of these?
(calc_subproblem): properly handle the case where a system is taller
than the page.
* lily/system.cc (get_paper_system): ensure that all the permissions
and penalties are passed to the paper systems.
* lily/page-breaking.cc (create_system_list): support system-count.
* lily/page-spacing.cc (min_page_count): fix calculation of min
pages if we are ragged and there are non-zero springs.
* scm/layout-page-layout.scm: if the pure-height estimates are under
the real height, allow space-systems to ignore padding if it is
needed in order to fit the systems on one page
* lily/optimal-page-breaking.cc (try_page_spacing): fix reading
ragged properties
(solve): fix performance problem. Make sure we always get at least
one solution
* lily/page-breaking.cc (make_pages): include write-page-breaks
and page-stencil