[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ly:one-page-breaking (was: ly:one-line-breaking)
From: |
Paul Morris |
Subject: |
ly:one-page-breaking (was: ly:one-line-breaking) |
Date: |
Mon, 18 Jan 2016 22:51:44 -0500 |
> On Jan 9, 2016, at 1:30 PM, Richard Shann <address@hidden> wrote:
>
> I was wondering if it would be possible to develop a variant of "all on
> one line", namely "all on one page", where the page height would be
> automatically adjusted to fit the music, leaving the width as set.
I’m glad to report that I’ve made some real progress. The code in the attached
patch delivers the basic functionality, with a few "known issues". Namely the
tagline and any footnotes are not included, and bookparts trigger default page
breaking for some reason. I haven’t tested it extensively but titles (etc.),
top level markups, multiple scores, all seem to work just fine.
The approach is to temporarily set the page-height to the largest size
possible, do the line breaking and page layout for that page height, then get
the vertical position on the page and the height of the lowest system (or top
level markup), and use that to calculate and then set the final page height so
that it fits the content of the page.
-Paul
%%% TEST SNIPPET %%%
\version "2.19.36"
\paper {
% system-system-spacing.basic-distance = #0
page-breaking = #ly:one-page-breaking
% ragged-bottom = ##t
% top-margin = 0
% bottom-margin = 0
% system-system-spacing.minimum-distance = #0
% system-system-spacing.padding = #0
}
\header {
% title = "a title”
% tagline = ""
}
% \markup \large "top level markup"
\repeat unfold 100 { c’4 d' e' f’ }
\repeat unfold 10 { g'1 }
{ c,,,,,1 }
% \markup \large “another top level markup"
%%%%%%%%%
one-page-breaking-1-18-2016.patch
Description: Binary data