[Top][All Lists]

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

Re: feature-request / doc-actualization (right-margin)

From: Michael Käppler
Subject: Re: feature-request / doc-actualization (right-margin)
Date: Sat, 08 Aug 2009 15:33:53 +0200
User-agent: Thunderbird (X11/20071114)

This is because line-spacing is done earlier than page-spacing - Lily needs a value for line-width when doing horizontal spacing. Therefore line-width isn't really discarded - but later in page.scm it is overwritten, so you can't see it in the page layout. What I wasn't unable to figure out is at which time line-width is calculated if you don't set it explicitly. And, much more confusing, I don't see any procedures in C++ that actually check the line-width. A "grep -R line-width *" isn't very informative.
Any ideas?
Ok, after a lot of time investigating this I think the problem is the following function (paper.scm:212):

(define (set-paper-dimensions m w h)
 "M is a module (i.e. layout->scope_ )"
 (let* ((mm (eval 'mm m)))
   (module-define! m 'paper-width w)
   (module-define! m 'paper-height h)
   (module-define! m 'line-width (- w
(ly:modules-lookup (list m) 'left-margin (* 10 mm)) (ly:modules-lookup (list m) 'right-margin (* 10 mm))))
   (module-define! m 'indent (/ w 14))
   (module-define! m 'short-indent 0)
   ;; page layout - what to do with (printer specific!) margin settings?

The proposal of this function is IMHO to set the line-width to (paper-width - 20 mm) if no margins are specified. Then, in page.scm:191, the difference between paper-width and line-width is divided into two equal parts. That's the default behaviour if you specify nothing: left-margin and right-margin set to 10 mm. But even if you set left-margin and right-margin, the function won't work, since there is never a 'left-margin or 'right-margin symbol in the module the function is called about. Therefore (ly:modules-lookup) returns (* 10 mm) in any case. You can easily test this: the default line-width is 190 mm in any case, what margins you ever specify.

I will try to provide a fix as soon as possible.


reply via email to

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