lilypond-devel
[Top][All Lists]
Advanced

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

Re: system position, extents, space, padding


From: Nicolas Sceaux
Subject: Re: system position, extents, space, padding
Date: Wed, 17 May 2006 20:31:19 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

Han-Wen Nienhuys <address@hidden> writes:

> Nicolas Sceaux schreef:

>> 1) The system position as computed in `optimal-page-breaks'
>> ('position property of a page) is the top of the Y-extent arrow?
>
> I think so, but not sure.

After further investigations, the position refers to the system stencil
origin, near the top of the stencil in case of music systems, but can be
a bit lower.

>> 2) How to compute the 2nd system position, given the two system
>> Y-extent and refpoint-Y-extent, and the first system next-space and
>> position?  (disregarding next-padding, supposed too short here). I've
>> been lost when reading ly:solve-spring-rod-problem, and I don't
>> really understand what the two numbers are in extents.
>
> the 2nd system position is variable: it depends on the stretching, but
> at its natural length the top of 2nd system refpoint-extent and bottom
> of 1st system refpoint-extent are at next-space distance. In tighter
> situations, they get closer, and for looser further.

Actually I meant in ragged condition.
For the record (in case I lose my notes), it seems that positions are
computed that way, with ragged=#t:

(loop for line in lines
  for prev-line in (cons #f lines)
  for prev-title? = (if prev-line
                        (paper-system-title? prev-line)
                        #f)
  for title? = (paper-system-title? line)
  for space = (cond ((and prev-title? title?)
                          (ly:output-def-lookup layout 'between-title-space))
                         (prev-title?
                          (ly:output-def-lookup layout 'after-title-space))
                         (title?
                          (ly:output-def-lookup layout 'before-title-space))
                         (prev-line
                          (ly:prob-property
                           prev-line 'next-space
                           (ly:output-def-lookup layout 'between-system-space)))
                         (else
                          0))
  for padding = (if prev-line
                    (ly:prob-property
                     prev-line 'next-padding
                     (ly:output-def-lookup layout 'between-system-padding))
                    0)
  for distance = (if prev-line
                     (max 0 (- (+ (cdr (paper-system-extent line Y))
                                  padding)
                              (car (paper-system-extent prev-line Y))))
                     0)
  with top-skip = (max (+ (ly:output-def-lookup layout 'page-top-space)
                          (interval-end
                           (paper-system-staff-extents (car lines))))
                       (interval-end
                        (paper-system-extent (car lines) Y)))
  for prev-position = #f then position
  for position = (if prev-line
                     (+ prev-position
                        (max distance
                             (cond (prev-title? 0.0)
                                   (title?
                                    (- (+ space padding)
                                       (car (paper-system-staff-extents 
prev-line))))
                                   (else
                                    (- (+ space padding
                                          (cdr (paper-system-staff-extents 
line)))
                                       (car (paper-system-staff-extents 
prev-line)))))))
                     top-skip)
  collect position)




reply via email to

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