[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Centering Systems
From: |
Jean Abou Samra |
Subject: |
Re: Centering Systems |
Date: |
Sun, 21 Aug 2022 19:39:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 |
Le 15/08/2022 à 18:28, josh a écrit :
Thanks for helping me out. I've attached some examples of what I am
working with so far.
The ANSIAsuccessful files have the code that works correctly (minus
all of the vertical collision, which I can deal with). What it shows
best is that there is one system per page and the systems vertically
fill the pages.
The ANSICunccessful files show that there are multiple systems per
page with and the systems are all bunched together.
The finishedexample pdf shows what I have been able to achieve in the
past using the ANSI A page size. I am moving to ANSI C page size for
better spacing in general.
I hope all of this makes sense.
OK, I've opened a bug report about this:
https://gitlab.com/lilypond/lilypond/-/issues/6407
And I suggest a completely different solution to center the systems,
sidestepping the issue:
\version "2.22.2"
\paper {
ragged-right = ##t
indent = 0
short-indent = 0
}
\layout {
\context {
\Score
%% Can't use a callback for line-break-system-details because it is
sometimes
%% read before line breaking, for alignment-distances. Even
after-line-breaking
%% can be too early for the System's X-extent due to things like
system start
%% delimiters which trigger page layout prematurely.
\override NonMusicalPaperColumn.stencil =
#(lambda (grob)
(let* ((sys (ly:grob-system grob))
(ext (ly:grob-extent sys sys X))
(len (interval-length ext))
(layout (ly:grob-layout grob))
(width (ly:output-def-lookup layout 'paper-width))
(left-margin (ly:output-def-lookup layout 'left-margin))
(off (- (* 1/2 (- width len))
left-margin))
(det (ly:grob-property grob 'line-break-system-details)))
(ly:grob-set-property! grob
'line-break-system-details
(acons 'extra-offset
(cons off 0)
det)))
#f)
}
}
{
#@(map (lambda (i)
#{ \repeat unfold #i { c'1 \noBreak } \break #})
(cdr (iota 15)))
}
I tested it on the score you sent me privately and it seems to work.
Best,
Jean